Skip to contentSkip to conversation

rt_e1000e: Fix __bad_udelay linking error

PATCH Applied Vitaly Chikunov 2 participants 2 messages Mar 6, 2021 – Mar 8, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rt_e1000e: Fix __bad_udelay linking error

This is similar to upstream commit 9e6c3b63399dd ("e1000e: fix compiler warnings" by David Ertman). Fix compile error:

ERROR: "__bad_udelay" [drivers/xenomai/net/drivers/e1000e/rt_e1000e.ko] undefined!

---
 kernel/drivers/net/drivers/e1000e/phy.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
kernel/drivers/net/drivers/e1000e/phy.c +6 -2
index 66ae3891a..9ec7835bc 100644
@@ -1787,13 +1787,17 @@ s32 e1000e_phy_has_link_generic(struct e1000_hw *hw, u32 iterations,
 		 * it across the board.
 		 */
 		ret_val = e1e_rphy(hw, PHY_STATUS, &phy_status);
-		if (ret_val)
+		if (ret_val) {
 			/*
 			 * If the first read fails, another entity may have
 			 * ownership of the resources, wait and try again to
 			 * see if they have relinquished the resources yet.
 			 */
-			udelay(usec_interval);
+			if (usec_interval >= 1000)
+				mdelay(usec_interval/1000);
+			else
+				udelay(usec_interval);
+		}
 		ret_val = e1e_rphy(hw, PHY_STATUS, &phy_status);
 		if (ret_val)
 			break;
Signature · 1 line
2.29.2
Applied
#1 lore raw
Quoted 25 lines · Vitaly Chikunov

This is similar to upstream commit 9e6c3b63399dd ("e1000e: fix compiler warnings" by David Ertman). Fix compile error:

ERROR: "__bad_udelay" [drivers/xenomai/net/drivers/e1000e/rt_e1000e.ko] undefined!

---
 kernel/drivers/net/drivers/e1000e/phy.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
kernel/drivers/net/drivers/e1000e/phy.c +1 -1
index 66ae3891a..9ec7835bc 100644
@@ -1787,13 +1787,17 @@ s32 e1000e_phy_has_link_generic(struct e1000_hw *hw, u32 iterations,
 		 * it across the board.
 		 */
 		ret_val = e1e_rphy(hw, PHY_STATUS, &phy_status);
-		if (ret_val)
+		if (ret_val) {
 			/*
 			 * If the first read fails, another entity may have
 			 * ownership of the resources, wait and try again to
 			 * see if they have relinquished the resources yet.

kernel/drivers/net/drivers/e1000e/phy.c s32 e1000e_phy_has_link_generic(struct e1000_hw *hw, u32 iterations, · line 1803

Quoted 10 lines
kernel/drivers/net/drivers/e1000e/phy.c +5 -1
 			 */
-			udelay(usec_interval);
+			if (usec_interval >= 1000)
+				mdelay(usec_interval/1000);
+			else
+				udelay(usec_interval);
+		}
 		ret_val = e1e_rphy(hw, PHY_STATUS, &phy_status);
 		if (ret_val)
 			break;

Thanks, applied.

Jan

Signature · 2 lines
Siemens AG, T RDA IOT
Corporate Competence Center Embedded Linux