Thread (7 messages) 7 messages, 5 authors, 2018-02-12

Re: [PATCH] base: power: domain: Replace mdelay with msleep

From: Rafael J. Wysocki <hidden>
Date: 2018-02-09 11:56:50
Also in: lkml

On Friday, January 26, 2018 9:38:19 AM CET Jia-Ju Bai wrote:
quoted hunk ↗ jump to hunk
After checking all possible call chains to genpd_dev_pm_detach() and
genpd_dev_pm_attach() here,
my tool finds that these functions are never called in atomic context,
namely never in an interrupt handler or holding a spinlock.
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 <redacted>
---
 drivers/base/power/domain.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
index 0c80bea..f84ac72 100644
--- a/drivers/base/power/domain.c
+++ b/drivers/base/power/domain.c
@@ -2144,7 +2144,7 @@ static void genpd_dev_pm_detach(struct device *dev, bool power_off)
 		if (ret != -EAGAIN)
 			break;
 
-		mdelay(i);
+		msleep(i);
 		cond_resched();
 	}
 
@@ -2231,7 +2231,7 @@ int genpd_dev_pm_attach(struct device *dev)
 		if (ret != -EAGAIN)
 			break;
 
-		mdelay(i);
+		msleep(i);
 		cond_resched();
 	}
 	mutex_unlock(&gpd_list_lock);
Ulf, Kevin, any concerns or objections?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help