projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3714765
)
e1000e: PTP lock in e1000e_phc_adjustfreq
author
Todd Fujinaka
<
[email protected]
>
Sat, 18 Jan 2014 06:09:33 +0000
(06:09 +0000)
committer
Jeff Kirsher
<
[email protected]
>
Sat, 8 Mar 2014 04:53:56 +0000
(20:53 -0800)
Add lock in e1000e_phc_adjfreq to prevent concurrent changes to TIMINCA
and SYSTIMH/L.
Signed-off-by: Todd Fujinaka <
[email protected]
>
Tested-by: Jeff Pieper <
[email protected]
>
Signed-off-by: Jeff Kirsher <
[email protected]
>
drivers/net/ethernet/intel/e1000e/ptp.c
patch
|
blob
|
history
diff --git
a/drivers/net/ethernet/intel/e1000e/ptp.c
b/drivers/net/ethernet/intel/e1000e/ptp.c
index 065f8c80d4f2d751e2cd2763f3bd6d1e73b6ab9b..e24160de49265667e622d0c0bf05fe5621cd4ace 100644
(file)
--- a/
drivers/net/ethernet/intel/e1000e/ptp.c
+++ b/
drivers/net/ethernet/intel/e1000e/ptp.c
@@
-47,6
+47,7
@@
static int e1000e_phc_adjfreq(struct ptp_clock_info *ptp, s32 delta)
ptp_clock_info);
struct e1000_hw *hw = &adapter->hw;
bool neg_adj = false;
+ unsigned long flags;
u64 adjustment;
u32 timinca, incvalue;
s32 ret_val;
@@
-64,6
+65,8
@@
static int e1000e_phc_adjfreq(struct ptp_clock_info *ptp, s32 delta)
if (ret_val)
return ret_val;
+ spin_lock_irqsave(&adapter->systim_lock, flags);
+
incvalue = timinca & E1000_TIMINCA_INCVALUE_MASK;
adjustment = incvalue;
@@
-77,6
+80,8
@@
static int e1000e_phc_adjfreq(struct ptp_clock_info *ptp, s32 delta)
ew32(TIMINCA, timinca);
+ spin_unlock_irqrestore(&adapter->systim_lock, flags);
+
return 0;
}