Re: Runtime PM and the block layer

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Jens Axboe
Date: Tuesday, August 24, 2010 - 6:38 am

On 2010-08-23 23:51, Alan Stern wrote:

It depends on where you want to handle it. If you want the driver to
reject it, then we don't have to change the block layer bits a lot. We
could add a DEFER_AND_STOP or something, which would never retry and it
would stop the queue. If the driver passed that back, then it would be
responsible for starting the queue at some point in the future.


I think it will be a lot cleaner to add specific support for this, as
per the DEFER_AND_STOP above.


Doing it in the driver is fine. We can always make things more generic
and share them across drivers if there's sharing to be had there.

It also means we don't need special request types that are allowed to
bypass certain queue states, since the driver will track the state and
know what to defer and what to pass through.


->power_mode() was just a suggested way to implement this, it doesn't
exist. But if you want to push it to the driver, then great, less work
for me :-)

Sounds like all you need is a way to return BLKPREP_DEFER_AND_STOP and
have the block layer stop the queue for you. When you need to restart,
you would insert a special request at the head of the queue and call
blk_start_queue() to get things going again.

The only missing bit would then be the idle detection. That would need
to be in the block layer itself, and the scheme I described should be
fine for that still.

-- 
Jens Axboe

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: Runtime PM and the block layer, Alan Stern, (Mon Aug 23, 2:51 pm)
Runtime power management during system resume, Raj Kumar, (Tue Aug 24, 6:15 am)
Re: Runtime PM and the block layer, Jens Axboe, (Tue Aug 24, 6:38 am)