[PATCH] sky2: Replace mdelay with msleep in sky2_vpd_wait

Subsystems: marvell gigabit ethernet drivers (skge/sky2), networking drivers, the rest

STALE3213d

3 messages, 3 authors, 2018-01-02 · open the first message on its own page

[PATCH] sky2: Replace mdelay with msleep in sky2_vpd_wait

From: Jia-Ju Bai <hidden>
Date: 2017-12-30 11:06:38

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 <redacted>
---
 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

Re: [PATCH] sky2: Replace mdelay with msleep in sky2_vpd_wait

From: Stephen Hemminger <stephen@networkplumber.org>
Date: 2017-12-30 17:19:16

On Sat, 30 Dec 2017 19:09:47 +0800
Jia-Ju Bai [off-list ref] wrote:
quoted hunk
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 <redacted>
---
 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>

Re: [PATCH] sky2: Replace mdelay with msleep in sky2_vpd_wait

From: David Miller <davem@davemloft.net>
Date: 2018-01-02 17:30:10

From: Jia-Ju Bai <redacted>
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 <redacted>
Applied.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help