Skip to content

Commit 387f295

Browse files
vlifshtskuba-moo
authored andcommitted
e1000e: change usleep_range to udelay in PHY mdic access
This is a partial revert of commit 6dbdd4d ("e1000e: Workaround for sporadic MDI error on Meteor Lake systems"). The referenced commit used usleep_range inside the PHY access routines, which are sometimes called from an atomic context. This can lead to a kernel panic in some scenarios, such as cable disconnection and reconnection on vPro systems. Solve this by changing the usleep_range calls back to udelay. Fixes: 6dbdd4d ("e1000e: Workaround for sporadic MDI error on Meteor Lake systems") Cc: [email protected] Reported-by: Jérôme Carretero <[email protected]> Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218740 Closes: https://lore.kernel.org/lkml/[email protected]/ Co-developed-by: Sasha Neftin <[email protected]> Signed-off-by: Sasha Neftin <[email protected]> Signed-off-by: Vitaly Lifshits <[email protected]> Tested-by: Dima Ruinskiy <[email protected]> Signed-off-by: Tony Nguyen <[email protected]> Reviewed-by: Simon Horman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent b9a61c2 commit 387f295

File tree

1 file changed

+4
-4
lines changed
  • drivers/net/ethernet/intel/e1000e

1 file changed

+4
-4
lines changed

drivers/net/ethernet/intel/e1000e/phy.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ s32 e1000e_read_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 *data)
157157
* the lower time out
158158
*/
159159
for (i = 0; i < (E1000_GEN_POLL_TIMEOUT * 3); i++) {
160-
usleep_range(50, 60);
160+
udelay(50);
161161
mdic = er32(MDIC);
162162
if (mdic & E1000_MDIC_READY)
163163
break;
@@ -181,7 +181,7 @@ s32 e1000e_read_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 *data)
181181
* reading duplicate data in the next MDIC transaction.
182182
*/
183183
if (hw->mac.type == e1000_pch2lan)
184-
usleep_range(100, 150);
184+
udelay(100);
185185

186186
if (success) {
187187
*data = (u16)mdic;
@@ -237,7 +237,7 @@ s32 e1000e_write_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 data)
237237
* the lower time out
238238
*/
239239
for (i = 0; i < (E1000_GEN_POLL_TIMEOUT * 3); i++) {
240-
usleep_range(50, 60);
240+
udelay(50);
241241
mdic = er32(MDIC);
242242
if (mdic & E1000_MDIC_READY)
243243
break;
@@ -261,7 +261,7 @@ s32 e1000e_write_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 data)
261261
* reading duplicate data in the next MDIC transaction.
262262
*/
263263
if (hw->mac.type == e1000_pch2lan)
264-
usleep_range(100, 150);
264+
udelay(100);
265265

266266
if (success)
267267
return 0;

0 commit comments

Comments
 (0)