From: Lin Ming <ming.m.lin@intel.com>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-ide@vger.kernel.org" <linux-ide@vger.kernel.org>,
"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
Jeff Garzik <jgarzik@pobox.com>,
"Rafael J. Wysocki" <rjw@sisk.pl>,
James Bottomley <JBottomley@Parallels.com>,
Tejun Heo <tj@kernel.org>, "Huang, Ying" <ying.huang@intel.com>,
"Zhang, Rui" <rui.zhang@intel.com>
Subject: Re: [PATCH 2/3] scsi: add hooks for host runtime power management
Date: Thu, 03 Nov 2011 22:37:43 +0800 [thread overview]
Message-ID: <1320331063.2813.78.camel@hp6530s> (raw)
In-Reply-To: <Pine.LNX.4.44L0.1111031019250.2136-100000@iolanthe.rowland.org>
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
>
next prev parent reply other threads:[~2011-11-03 14:38 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-02 6:21 [PATCH 0/3] ata port runtime power management support Lin Ming
2011-11-02 6:21 ` [PATCH 1/3] scsi: fix potential dead lock for host runtime pm Lin Ming
2011-11-02 14:41 ` Alan Stern
2011-11-02 6:21 ` [PATCH 2/3] scsi: add hooks for host runtime power management Lin Ming
2011-11-02 14:53 ` Alan Stern
2011-11-03 13:08 ` Lin Ming
2011-11-03 14:22 ` Alan Stern
2011-11-03 14:37 ` Lin Ming [this message]
2011-11-03 14:41 ` Tejun Heo
2011-11-03 15:39 ` Alan Stern
2011-11-03 15:51 ` Tejun Heo
2011-11-03 16:08 ` Alan Stern
2011-11-02 6:21 ` [PATCH 3/3] ata: implement ata port runtime pm hooks Lin Ming
2011-11-02 15:17 ` [PATCH 0/3] ata port runtime power management support Tejun Heo
2011-11-03 14:21 ` Lin Ming
2011-11-03 14:30 ` Tejun Heo
2011-11-03 14:47 ` Lin Ming
2011-11-03 14:59 ` Tejun Heo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1320331063.2813.78.camel@hp6530s \
--to=ming.m.lin@intel.com \
--cc=JBottomley@Parallels.com \
--cc=jgarzik@pobox.com \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=rjw@sisk.pl \
--cc=rui.zhang@intel.com \
--cc=stern@rowland.harvard.edu \
--cc=tj@kernel.org \
--cc=ying.huang@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox