diff options
author | Todd Fujinaka <todd.fujinaka@intel.com> | 2014-01-18 07:09:33 +0100 |
---|---|---|
committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2014-03-08 05:53:56 +0100 |
commit | 6c2ed39c1c0a7118b89394c26e86a24e5070e579 (patch) | |
tree | 1ae43d1c7842a043988ffaf18a49793967b035cb /drivers/net/ethernet/intel/e1000e/ptp.c | |
parent | 6lowpan: reassembly: fix return of init function (diff) | |
download | linux-6c2ed39c1c0a7118b89394c26e86a24e5070e579.tar.xz linux-6c2ed39c1c0a7118b89394c26e86a24e5070e579.zip |
e1000e: PTP lock in e1000e_phc_adjustfreq
Add lock in e1000e_phc_adjfreq to prevent concurrent changes to TIMINCA
and SYSTIMH/L.
Signed-off-by: Todd Fujinaka <todd.fujinaka@intel.com>
Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to '')
-rw-r--r-- | drivers/net/ethernet/intel/e1000e/ptp.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/ethernet/intel/e1000e/ptp.c b/drivers/net/ethernet/intel/e1000e/ptp.c index 065f8c80d4f2..e24160de4926 100644 --- 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; } |