[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1516980732-7931-1-git-send-email-baijiaju1990@gmail.com>
Date: Fri, 26 Jan 2018 23:32:11 +0800
From: Jia-Ju Bai <baijiaju1990@...il.com>
To: axboe@...nel.dk, ming.lei@...hat.com, Bart.VanAssche@...disk.com,
jthumshirn@...e.de, hare@...e.com, sagi@...mberg.me
Cc: linux-kernel@...r.kernel.org, Jia-Ju Bai <baijiaju1990@...il.com>
Subject: [PATCH 2/3] block: mtip32xx: Replace mdelay with msleep in mtip_service_thread
After checking all possible call chains to mtip_service_thread() 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_service_thread() calls wait_event_interruptible(),
so it indicates that mtip_hw_init() 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@...il.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..1264c98 100644
--- a/drivers/block/mtip32xx/mtip32xx.c
+++ b/drivers/block/mtip32xx/mtip32xx.c
@@ -2807,7 +2807,7 @@ static int mtip_service_thread(void *data)
to = jiffies + msecs_to_jiffies(5000);
do {
- mdelay(100);
+ msleep(100);
} while (atomic_read(&dd->irq_workers_active) != 0 &&
time_before(jiffies, to));
--
1.7.9.5
Powered by blists - more mailing lists