From: Grzegorz Nitka <[email protected]>

Block HW write access for the driver while the device is in reset to
avoid potential race condition and access to the PTP HW in
non-nominal state which could lead to undesired effects

Signed-off-by: Grzegorz Nitka <[email protected]>
Co-developed-by: Karol Kolacinski <[email protected]>
Signed-off-by: Karol Kolacinski <[email protected]>
Signed-off-by: Sergey Temerkhanov <[email protected]>
Fixes: 4aad5335969f ("ice: add individual interrupt allocation")
Reviewed-by: Przemek Kitszel <[email protected]>
---
 drivers/net/ethernet/intel/ice/ice_ptp.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/ethernet/intel/ice/ice_ptp.c 
b/drivers/net/ethernet/intel/ice/ice_ptp.c
index 11fbf2bbcae7..40a07d0bb341 100644
--- a/drivers/net/ethernet/intel/ice/ice_ptp.c
+++ b/drivers/net/ethernet/intel/ice/ice_ptp.c
@@ -1408,6 +1408,10 @@ void ice_ptp_link_change(struct ice_pf *pf, u8 port, 
bool linkup)
        /* Update cached link status for this port immediately */
        ptp_port->link_up = linkup;
 
+       /* Skip HW writes if reset is in progress */
+       if (pf->hw.reset_ongoing)
+               return;
+
        switch (hw->ptp.phy_model) {
        case ICE_PHY_E810:
                /* Do not reconfigure E810 PHY */
-- 
2.43.0

Reply via email to