netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] sky2: Replace mdelay with msleep in sky2_vpd_wait
@ 2017-12-24  3:54 Jia-Ju Bai
  0 siblings, 0 replies; 4+ messages in thread
From: Jia-Ju Bai @ 2017-12-24  3:54 UTC (permalink / raw)
  To: mlindner, stephen, shemminger; +Cc: netdev, linux-kernel, Jia-Ju Bai

sky2_vpd_wait is not called in an interrupt handler nor holding a spinlock.
The function mdelay in it can be replaced with msleep, to reduce busy wait.

Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
---
 drivers/net/ethernet/marvell/sky2.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/marvell/sky2.c b/drivers/net/ethernet/marvell/sky2.c
index 9efe177..9fe8530 100644
--- a/drivers/net/ethernet/marvell/sky2.c
+++ b/drivers/net/ethernet/marvell/sky2.c
@@ -4287,7 +4287,7 @@ static int sky2_vpd_wait(const struct sky2_hw *hw, int cap, u16 busy)
 			dev_err(&hw->pdev->dev, "VPD cycle timed out\n");
 			return -ETIMEDOUT;
 		}
-		mdelay(1);
+		msleep(1);
 	}
 
 	return 0;
-- 
1.7.9.5

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

* [PATCH] sky2: Replace mdelay with msleep in sky2_vpd_wait
@ 2017-12-30 11:09 Jia-Ju Bai
  2017-12-30 17:19 ` Stephen Hemminger
  2018-01-02 17:27 ` David Miller
  0 siblings, 2 replies; 4+ messages in thread
From: Jia-Ju Bai @ 2017-12-30 11:09 UTC (permalink / raw)
  To: mlindner, stephen, shemminger; +Cc: netdev, linux-kernel, Jia-Ju Bai

sky2_vpd_wait is not called in an interrupt handler nor holding a spinlock.
The function mdelay in it can be replaced with msleep, to reduce busy wait.

Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
---
 drivers/net/ethernet/marvell/sky2.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/marvell/sky2.c b/drivers/net/ethernet/marvell/sky2.c
index 9efe177..9fe8530 100644
--- a/drivers/net/ethernet/marvell/sky2.c
+++ b/drivers/net/ethernet/marvell/sky2.c
@@ -4287,7 +4287,7 @@ static int sky2_vpd_wait(const struct sky2_hw *hw, int cap, u16 busy)
 			dev_err(&hw->pdev->dev, "VPD cycle timed out\n");
 			return -ETIMEDOUT;
 		}
-		mdelay(1);
+		msleep(1);
 	}
 
 	return 0;
-- 
1.7.9.5

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

* Re: [PATCH] sky2: Replace mdelay with msleep in sky2_vpd_wait
  2017-12-30 11:09 [PATCH] sky2: Replace mdelay with msleep in sky2_vpd_wait Jia-Ju Bai
@ 2017-12-30 17:19 ` Stephen Hemminger
  2018-01-02 17:27 ` David Miller
  1 sibling, 0 replies; 4+ messages in thread
From: Stephen Hemminger @ 2017-12-30 17:19 UTC (permalink / raw)
  To: Jia-Ju Bai; +Cc: mlindner, shemminger, netdev, linux-kernel

On Sat, 30 Dec 2017 19:09:47 +0800
Jia-Ju Bai <baijiaju1990@gmail.com> wrote:

> sky2_vpd_wait is not called in an interrupt handler nor holding a spinlock.
> The function mdelay in it can be replaced with msleep, to reduce busy wait.
> 
> Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
> ---
>  drivers/net/ethernet/marvell/sky2.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/marvell/sky2.c b/drivers/net/ethernet/marvell/sky2.c
> index 9efe177..9fe8530 100644
> --- a/drivers/net/ethernet/marvell/sky2.c
> +++ b/drivers/net/ethernet/marvell/sky2.c
> @@ -4287,7 +4287,7 @@ static int sky2_vpd_wait(const struct sky2_hw *hw, int cap, u16 busy)
>  			dev_err(&hw->pdev->dev, "VPD cycle timed out\n");
>  			return -ETIMEDOUT;
>  		}
> -		mdelay(1);
> +		msleep(1);
>  	}
>  
>  	return 0;

When sky2 was written mdelay was equivalent to current msleep.

Acked-by: Stephen Hemminger <stephen@networkplumber.org>

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

* Re: [PATCH] sky2: Replace mdelay with msleep in sky2_vpd_wait
  2017-12-30 11:09 [PATCH] sky2: Replace mdelay with msleep in sky2_vpd_wait Jia-Ju Bai
  2017-12-30 17:19 ` Stephen Hemminger
@ 2018-01-02 17:27 ` David Miller
  1 sibling, 0 replies; 4+ messages in thread
From: David Miller @ 2018-01-02 17:27 UTC (permalink / raw)
  To: baijiaju1990; +Cc: mlindner, stephen, shemminger, netdev, linux-kernel

From: Jia-Ju Bai <baijiaju1990@gmail.com>
Date: Sat, 30 Dec 2017 19:09:47 +0800

> sky2_vpd_wait is not called in an interrupt handler nor holding a spinlock.
> The function mdelay in it can be replaced with msleep, to reduce busy wait.
> 
> Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>

Applied.

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

end of thread, other threads:[~2018-01-02 17:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-30 11:09 [PATCH] sky2: Replace mdelay with msleep in sky2_vpd_wait Jia-Ju Bai
2017-12-30 17:19 ` Stephen Hemminger
2018-01-02 17:27 ` David Miller
  -- strict thread matches above, loose matches on Subject: below --
2017-12-24  3:54 Jia-Ju Bai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).