public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] blkpm: avoid sleep when holding queue lock
@ 2013-05-17  7:47 Aaron Lu
  2013-05-17  8:01 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Aaron Lu @ 2013-05-17  7:47 UTC (permalink / raw)
  To: Alan Stern, Jens Axboe; +Cc: linux-kernel, Aaron Lu, Aaron Lu

In blk_post_runtime_resume, an autosuspend request will be initiated for
the device. Since we are holding the queue lock, we can't sleep and thus
we should use the async version to initiate an autosuspend, i.e.
pm_request_suspend instead of pm_runtime_suspend, which might sleep.

Signed-off-by: Aaron Lu <aaron.lu@intel.com>
---
I didn't turn on the lock debugging config options while doing test so
this issue didn't show up until recently I have all those lock debugging
options turned on, a warning instantly showed up. While it is correctly
using pm_request_autosuspend in pre-v7 series, and is brought by me
mistakenly, sorry for this.

 block/blk-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block/blk-core.c b/block/blk-core.c
index 33c33bc..d5745b5 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -3164,7 +3164,7 @@ void blk_post_runtime_resume(struct request_queue *q, int err)
 		q->rpm_status = RPM_ACTIVE;
 		__blk_run_queue(q);
 		pm_runtime_mark_last_busy(q->dev);
-		pm_runtime_autosuspend(q->dev);
+		pm_request_autosuspend(q->dev);
 	} else {
 		q->rpm_status = RPM_SUSPENDED;
 	}
-- 
1.8.3.rc2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-05-17  8:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-17  7:47 [PATCH] blkpm: avoid sleep when holding queue lock Aaron Lu
2013-05-17  8:01 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox