Messages in this thread | | | Date | Fri, 6 Jul 2012 01:27:52 -0600 | From | Matthew Wilcox <> | Subject | Re: [PATCH v5 3/4] block: implement runtime pm strategy |
| |
On Fri, Jul 06, 2012 at 12:04:31PM +0800, Lin Ming wrote: > When a request is added: > If device is suspended or is suspending and the request is not a > PM request, resume the device. > > When a request finishes: > Call pm_runtime_mark_last_busy(). > > When pick a request: > If device is resuming/suspending, then only PM request is allowed to go. > Return NULL for other cases.
This only works for drivers which are struct request based. For those that handle struct bio directly, nr_pending will always be 0.
I think the right place to increment nr_pending is in generic_make_request. But I'm not sure where to decrement it. I think we need a blk_bio_endio() which does some housekeeping and then calls bio_endio().
-- Matthew Wilcox Intel Open Source Technology Centre "Bill, look, we understand that you're interested in selling us this operating system, but compare it to ours. We can't possibly take such a retrograde step."
| |