[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1320331063.2813.78.camel@hp6530s>
Date: Thu, 03 Nov 2011 22:37:43 +0800
From: Lin Ming <ming.m.lin@...el.com>
To: Alan Stern <stern@...land.harvard.edu>
Cc: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-ide@...r.kernel.org" <linux-ide@...r.kernel.org>,
"linux-scsi@...r.kernel.org" <linux-scsi@...r.kernel.org>,
"linux-pm@...r.kernel.org" <linux-pm@...r.kernel.org>,
Jeff Garzik <jgarzik@...ox.com>,
"Rafael J. Wysocki" <rjw@...k.pl>,
James Bottomley <JBottomley@...allels.com>,
Tejun Heo <tj@...nel.org>,
"Huang, Ying" <ying.huang@...el.com>,
"Zhang, Rui" <rui.zhang@...el.com>
Subject: Re: [PATCH 2/3] scsi: add hooks for host runtime power management
On Thu, 2011-11-03 at 22:22 +0800, Alan Stern wrote:
> On Thu, 3 Nov 2011, Lin Ming wrote:
>
> > I realize that this is not the natural way to do ata port runtime pm.
> > Hooking it to scsi host runtime pm is not good. It does not deal with
> > the races with system suspend/resume of host controller.
> >
> > How about making ata port as the parent device of scsi host?
> > Then, for example, the runtime suspend happens as below,
> >
> > disk suspend --> scsi target suspend --> scsi host suspend --> ata port
> > suspend.
> >
> > Current device tree is:
> > /sys/devices/pci0000:00/0000:00:1f.2/
> > |-- ata1
> > |-- host0
> >
> > After the change, the tree will become as:
> > /sys/devices/pci0000:00/0000:00:1f.2/ata1/
> > |-- host0
>
> I don't know enough about the ATA subsystem to say much, except that
> this looks more logical.
>
> > The tricky part is ata port(parent device) suspend need to schedule scsi
> > EH which will resume scsi host(child device). Then the child device
> > resume will in turn make parent device resume first. This is kind of
> > recursive.
> >
> > We can fix this by adding a flag somewhere to tell scsi EH don't resume
> > the host in ata port pm request handling case.
> >
> > What do you think?
>
> Yes, it is a problem. But it looks like the underlying issue is that
> you're using the SCSI error handler to do something it was not intended
> for. Can't you suspend and resume the ATA port without using the error
> handler?
The system suspend and resume of the ATA port uses the error handler.
I think the runtime suspend and resume should use the error handler too.
Tejun,
Could you comment more on this?
Thanks.
>
> Alan Stern
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists