All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] rt_e1000e: Fix __bad_udelay linking error
@ 2021-03-06 22:13 Vitaly Chikunov
  2021-03-08 10:43 ` Jan Kiszka
  0 siblings, 1 reply; 2+ messages in thread
From: Vitaly Chikunov @ 2021-03-06 22:13 UTC (permalink / raw)
  To: Jan Kiszka, Xenomai

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!

Signed-off-by: Vitaly Chikunov <vt@altlinux.org>
---
 kernel/drivers/net/drivers/e1000e/phy.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/kernel/drivers/net/drivers/e1000e/phy.c b/kernel/drivers/net/drivers/e1000e/phy.c
index 66ae3891a..9ec7835bc 100644
--- a/kernel/drivers/net/drivers/e1000e/phy.c
+++ b/kernel/drivers/net/drivers/e1000e/phy.c
@@ -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;
-- 
2.29.2



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] rt_e1000e: Fix __bad_udelay linking error
  2021-03-06 22:13 [PATCH] rt_e1000e: Fix __bad_udelay linking error Vitaly Chikunov
@ 2021-03-08 10:43 ` Jan Kiszka
  0 siblings, 0 replies; 2+ messages in thread
From: Jan Kiszka @ 2021-03-08 10:43 UTC (permalink / raw)
  To: Vitaly Chikunov, Xenomai

On 06.03.21 23:13, Vitaly Chikunov wrote:
> 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!
> 
> Signed-off-by: Vitaly Chikunov <vt@altlinux.org>
> ---
>  kernel/drivers/net/drivers/e1000e/phy.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/kernel/drivers/net/drivers/e1000e/phy.c b/kernel/drivers/net/drivers/e1000e/phy.c
> index 66ae3891a..9ec7835bc 100644
> --- a/kernel/drivers/net/drivers/e1000e/phy.c
> +++ b/kernel/drivers/net/drivers/e1000e/phy.c
> @@ -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;
> 

Thanks, applied.

Jan

-- 
Siemens AG, T RDA IOT
Corporate Competence Center Embedded Linux


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-03-08 10:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-06 22:13 [PATCH] rt_e1000e: Fix __bad_udelay linking error Vitaly Chikunov
2021-03-08 10:43 ` Jan Kiszka

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.