Re: [PATCH 2/3] scsi: add hooks for host runtime power management

Alan Stern
2011-11-03T16:08:54Z

On Thu, 3 Nov 2011, Tejun Heo wrote:

> Hello,
>
> On Thu, Nov 3, 2011 at 8:39 AM, Alan Stern <stern@rowland.harvard.edu> wrote:
> >> I don't know. I haven't really thought about it but as it's currently
> >> designed, I don't think it'll be possible to avoid going through EH to
> >> put ATA ports into suspend mode.
> >
> > Why not?
>
> It's just how things are designed now. There's no reason why it's
> fundamentally impossible but going around that would require some
> amount of hackery or preferably re-design. Synchronization against
> command processing, interrupts and all are built around EH.

Then it sounds like the best idea is something like what Ming proposed
earlier: Have the error handler make some sort of test to determine
whether it has been invoked for suspend/resume handling, and skip the
runtime-PM calls on the host if it has.

This new test, whatever it is, should apply both to system suspend and
runtime suspend. By the way, what would happen if a system suspend
occurred while the ATA port was already runtime-suspended?

Alan Stern