lkml.org 
[lkml]   [2018]   [Jan]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 3/3] block: mtip32xx: Replace mdelay with msleep in mtip_handle_tfe
Date
After checking all possible call chains to mtip_handle_tfe() here,
my tool finds that this function is never called in atomic context,
namely never in an interrupt handler or holding a spinlock.
And mtip_handle_tfe() is only called by mtip_service_thread() that
can sleep as described in the last patch,
so it indicates that mtip_handle_tfe() can call functions that can sleep.
Thus mdelay can be replaced with msleep to avoid busy wait.

This is found by a static analysis tool named DCNS written by myself.

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

diff --git a/drivers/block/mtip32xx/mtip32xx.c b/drivers/block/mtip32xx/mtip32xx.c
index b8af735..b302167 100644
--- a/drivers/block/mtip32xx/mtip32xx.c
+++ b/drivers/block/mtip32xx/mtip32xx.c
@@ -604,7 +604,7 @@ static void mtip_handle_tfe(struct driver_data *dd)
print_tags(dd, "completed (TFE)", tagaccum, cmd_cnt);

/* Restart the port */
- mdelay(20);
+ msleep(20);
mtip_restart_port(port);

/* Trying to determine the cause of the error */
--
1.7.9.5
\
 
 \ /
  Last update: 2018-01-26 16:28    [W:0.037 / U:0.220 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site