Commit 6c2ed39c authored by Todd Fujinaka's avatar Todd Fujinaka Committed by Jeff Kirsher
Browse files

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: default avatarTodd Fujinaka <todd.fujinaka@intel.com>
Tested-by: default avatarJeff Pieper <jeffrey.e.pieper@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent 37147652
...@@ -47,6 +47,7 @@ static int e1000e_phc_adjfreq(struct ptp_clock_info *ptp, s32 delta) ...@@ -47,6 +47,7 @@ static int e1000e_phc_adjfreq(struct ptp_clock_info *ptp, s32 delta)
ptp_clock_info); ptp_clock_info);
struct e1000_hw *hw = &adapter->hw; struct e1000_hw *hw = &adapter->hw;
bool neg_adj = false; bool neg_adj = false;
unsigned long flags;
u64 adjustment; u64 adjustment;
u32 timinca, incvalue; u32 timinca, incvalue;
s32 ret_val; s32 ret_val;
...@@ -64,6 +65,8 @@ static int e1000e_phc_adjfreq(struct ptp_clock_info *ptp, s32 delta) ...@@ -64,6 +65,8 @@ static int e1000e_phc_adjfreq(struct ptp_clock_info *ptp, s32 delta)
if (ret_val) if (ret_val)
return ret_val; return ret_val;
spin_lock_irqsave(&adapter->systim_lock, flags);
incvalue = timinca & E1000_TIMINCA_INCVALUE_MASK; incvalue = timinca & E1000_TIMINCA_INCVALUE_MASK;
adjustment = incvalue; adjustment = incvalue;
...@@ -77,6 +80,8 @@ static int e1000e_phc_adjfreq(struct ptp_clock_info *ptp, s32 delta) ...@@ -77,6 +80,8 @@ static int e1000e_phc_adjfreq(struct ptp_clock_info *ptp, s32 delta)
ew32(TIMINCA, timinca); ew32(TIMINCA, timinca);
spin_unlock_irqrestore(&adapter->systim_lock, flags);
return 0; return 0;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment