[PATCH] ice: use msleep instead of mdelay

Jonathan Toppins posted 1 patch 4 years, 3 months ago
drivers/net/ethernet/intel/ice/ice_common.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
[PATCH] ice: use msleep instead of mdelay
Posted by Jonathan Toppins 4 years, 3 months ago
Use msleep for long delays instead of spinning in the driver.

Suggested-by: Jocelyn Falempe <jfalempe@redhat.com>
Signed-off-by: Jonathan Toppins <jtoppins@redhat.com>
---
 drivers/net/ethernet/intel/ice/ice_common.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/ice/ice_common.c b/drivers/net/ethernet/intel/ice/ice_common.c
index 0e4434e3c290..75860259c6d7 100644
--- a/drivers/net/ethernet/intel/ice/ice_common.c
+++ b/drivers/net/ethernet/intel/ice/ice_common.c
@@ -1107,7 +1107,7 @@ int ice_check_reset(struct ice_hw *hw)
 			GLGEN_RSTCTL_GRSTDEL_S) + 10;
 
 	for (cnt = 0; cnt < grst_timeout; cnt++) {
-		mdelay(100);
+		msleep(100);
 		reg = rd32(hw, GLGEN_RSTAT);
 		if (!(reg & GLGEN_RSTAT_DEVSTATE_M))
 			break;
@@ -3235,7 +3235,7 @@ ice_set_fc(struct ice_port_info *pi, u8 *aq_failures, bool ena_auto_link_update)
 			if (!status)
 				break;
 
-			mdelay(100);
+			msleep(100);
 		}
 
 		if (status)
-- 
2.27.0
Re: [PATCH] ice: use msleep instead of mdelay
Posted by Jakub Kicinski 4 years, 3 months ago
On Tue,  1 Mar 2022 09:48:45 -0500 Jonathan Toppins wrote:
> Use msleep for long delays instead of spinning in the driver.

You should add the justification for why sleeping / scheduling out 
is okay in these particular spots to the commit message.