Re: [PATCH v7 2/6] scsi: sr: support runtime pm

2012-10-11 Thread Aaron Lu
On Tue, Oct 09, 2012 at 03:58:34PM +0100, James Bottomley wrote: > On Tue, 2012-10-09 at 15:20 +0800, Aaron Lu wrote: > > On 10/08/2012 06:21 PM, James Bottomley wrote: > > > On Mon, 2012-10-08 at 17:27 +0800, Aaron Lu wrote: > > >> On Sun, Sep 30, 2012 at 03:43:27PM -0400, Alan Stern wrote: > > >>

Re: [PATCH v7 2/6] scsi: sr: support runtime pm

2012-10-09 Thread Rafael J. Wysocki
On Tuesday 09 of October 2012 15:20:39 Aaron Lu wrote: > On 10/08/2012 06:21 PM, James Bottomley wrote: > > On Mon, 2012-10-08 at 17:27 +0800, Aaron Lu wrote: > >> On Sun, Sep 30, 2012 at 03:43:27PM -0400, Alan Stern wrote: > >>> On Sun, 30 Sep 2012, Jeff Garzik wrote: > >>> > The simple fact

Re: [PATCH v7 2/6] scsi: sr: support runtime pm

2012-10-09 Thread James Bottomley
On Tue, 2012-10-09 at 15:20 +0800, Aaron Lu wrote: > On 10/08/2012 06:21 PM, James Bottomley wrote: > > On Mon, 2012-10-08 at 17:27 +0800, Aaron Lu wrote: > >> On Sun, Sep 30, 2012 at 03:43:27PM -0400, Alan Stern wrote: > >>> On Sun, 30 Sep 2012, Jeff Garzik wrote: > >>> > The simple fact of "

Re: [PATCH v7 2/6] scsi: sr: support runtime pm

2012-10-09 Thread Aaron Lu
On 10/08/2012 06:21 PM, James Bottomley wrote: > On Mon, 2012-10-08 at 17:27 +0800, Aaron Lu wrote: >> On Sun, Sep 30, 2012 at 03:43:27PM -0400, Alan Stern wrote: >>> On Sun, 30 Sep 2012, Jeff Garzik wrote: >>> The simple fact of "only ZPODD devices out there are ATA" is not the decision

Re: [PATCH v7 2/6] scsi: sr: support runtime pm

2012-10-08 Thread James Bottomley
On Mon, 2012-10-08 at 17:27 +0800, Aaron Lu wrote: > On Sun, Sep 30, 2012 at 03:43:27PM -0400, Alan Stern wrote: > > On Sun, 30 Sep 2012, Jeff Garzik wrote: > > > > > The simple fact of "only ZPODD devices out there are ATA" is not the > > > decision-maker for where the code should live. It is m

Re: [PATCH v7 2/6] scsi: sr: support runtime pm

2012-10-08 Thread Aaron Lu
On Sun, Sep 30, 2012 at 03:43:27PM -0400, Alan Stern wrote: > On Sun, 30 Sep 2012, Jeff Garzik wrote: > > > The simple fact of "only ZPODD devices out there are ATA" is not the > > decision-maker for where the code should live. It is more a question > > where ZPODD belongs in the device/command

Re: [PATCH v7 2/6] scsi: sr: support runtime pm

2012-09-30 Thread Jeff Garzik
On 09/30/2012 03:43 PM, Alan Stern wrote: On Sun, 30 Sep 2012, Jeff Garzik wrote: The simple fact of "only ZPODD devices out there are ATA" is not the decision-maker for where the code should live. It is more a question where ZPODD belongs in the device/command set model currently employed.

Re: [PATCH v7 2/6] scsi: sr: support runtime pm

2012-09-30 Thread Alan Stern
On Sun, 30 Sep 2012, Jeff Garzik wrote: > The simple fact of "only ZPODD devices out there are ATA" is not the > decision-maker for where the code should live. It is more a question > where ZPODD belongs in the device/command set model currently employed. I don't really accept this argument.

Re: [PATCH v7 2/6] scsi: sr: support runtime pm

2012-09-30 Thread Jeff Garzik
On 09/30/2012 10:47 AM, Alan Stern wrote: On Sun, 30 Sep 2012, Aaron Lu wrote: Makes sense to me, but there is a problem if I want to block events checking for the disk, as I do not have a pointer to the gendisk in ATA layer. You may discover the gendisk by going the ATA -> SCSI -> block rout

Re: [PATCH v7 2/6] scsi: sr: support runtime pm

2012-09-30 Thread Jeff Garzik
On 09/29/2012 06:44 PM, Rafael J. Wysocki wrote: On Saturday, September 29, 2012, Aaron Lu wrote: On 09/29/2012 10:29 PM, Alan Stern wrote: On Sat, 29 Sep 2012, Aaron Lu wrote: I don't think this is a good idea, quite frankly. sr seems to be a too generic place for that. Does this mean sr

Re: [PATCH v7 2/6] scsi: sr: support runtime pm

2012-09-30 Thread Jeff Garzik
On 09/29/2012 06:31 PM, Rafael J. Wysocki wrote: On Saturday, September 29, 2012, Alan Stern wrote: Can arbitrary SCSI devices be ZP, or does this notion apply only to ATAPI-based drives? That's the key question, and the answer determines where the ZP support belongs. I agree. That said for

Re: [PATCH v7 2/6] scsi: sr: support runtime pm

2012-09-30 Thread Aaron Lu
On 09/30/2012 10:47 PM, Alan Stern wrote: > On Sun, 30 Sep 2012, Aaron Lu wrote: > >> Makes sense to me, but there is a problem if I want to block events >> checking for the disk, as I do not have a pointer to the gendisk in ATA >> layer. > >> The tray will be ejected by the ODD itself when it ha

Re: [PATCH v7 2/6] scsi: sr: support runtime pm

2012-09-30 Thread Alan Stern
On Sun, 30 Sep 2012, Aaron Lu wrote: > Makes sense to me, but there is a problem if I want to block events > checking for the disk, as I do not have a pointer to the gendisk in ATA > layer. > The tray will be ejected by the ODD itself when it has power, I do not > need to do that. Moreover, I don

Re: [PATCH v7 2/6] scsi: sr: support runtime pm

2012-09-30 Thread Aaron Lu
On Sun, Sep 30, 2012 at 12:27:41AM +0200, Rafael J. Wysocki wrote: > On Saturday, September 29, 2012, Aaron Lu wrote: > > [Adding more people and list back in] > > > > On 09/29/2012 05:46 AM, Rafael J. Wysocki wrote: > > > On Friday, September 28, 2012, Aaron Lu wrote: > > >> On 09/28/2012 07:15 A

Re: [PATCH v7 2/6] scsi: sr: support runtime pm

2012-09-30 Thread Aaron Lu
On Sun, Sep 30, 2012 at 12:44:50AM +0200, Rafael J. Wysocki wrote: > On Saturday, September 29, 2012, Aaron Lu wrote: > > On 09/29/2012 10:29 PM, Alan Stern wrote: > > > On Sat, 29 Sep 2012, Aaron Lu wrote: > > > > > >>> I don't think this is a good idea, quite frankly. sr seems to be a too > > >

Re: [PATCH v7 2/6] scsi: sr: support runtime pm

2012-09-29 Thread Rafael J. Wysocki
On Saturday, September 29, 2012, Aaron Lu wrote: > On 09/29/2012 10:29 PM, Alan Stern wrote: > > On Sat, 29 Sep 2012, Aaron Lu wrote: > > > >>> I don't think this is a good idea, quite frankly. sr seems to be a too > >>> generic place for that. > >> > >> Does this mean sr can only have code that

Re: [PATCH v7 2/6] scsi: sr: support runtime pm

2012-09-29 Thread Rafael J. Wysocki
On Saturday, September 29, 2012, Alan Stern wrote: > On Sat, 29 Sep 2012, Aaron Lu wrote: > > > > I don't think this is a good idea, quite frankly. sr seems to be a too > > > generic place for that. > > > > Does this mean sr can only have code that is useful to all devices it > > manages? i.e. I

Re: [PATCH v7 2/6] scsi: sr: support runtime pm

2012-09-29 Thread Rafael J. Wysocki
On Saturday, September 29, 2012, Aaron Lu wrote: > [Adding more people and list back in] > > On 09/29/2012 05:46 AM, Rafael J. Wysocki wrote: > > On Friday, September 28, 2012, Aaron Lu wrote: > >> On 09/28/2012 07:15 AM, Rafael J. Wysocki wrote: > >>> On Thursday, September 27, 2012, Aaron Lu wro

Re: [PATCH v7 2/6] scsi: sr: support runtime pm

2012-09-29 Thread Aaron Lu
On 09/29/2012 10:29 PM, Alan Stern wrote: > On Sat, 29 Sep 2012, Aaron Lu wrote: > >>> I don't think this is a good idea, quite frankly. sr seems to be a too >>> generic place for that. >> >> Does this mean sr can only have code that is useful to all devices it >> manages? i.e. If a piece of code

Re: [PATCH v7 2/6] scsi: sr: support runtime pm

2012-09-29 Thread Alan Stern
On Sat, 29 Sep 2012, Aaron Lu wrote: > > I don't think this is a good idea, quite frankly. sr seems to be a too > > generic place for that. > > Does this mean sr can only have code that is useful to all devices it > manages? i.e. If a piece of code enables a feature for a special kind of > ODD(l

Re: [PATCH v7 2/6] scsi: sr: support runtime pm

2012-09-28 Thread Aaron Lu
[Adding more people and list back in] On 09/29/2012 05:46 AM, Rafael J. Wysocki wrote: > On Friday, September 28, 2012, Aaron Lu wrote: >> On 09/28/2012 07:15 AM, Rafael J. Wysocki wrote: >>> On Thursday, September 27, 2012, Aaron Lu wrote: On 09/27/2012 05:37 AM, Rafael J. Wysocki wrote: >>>

Re: [PATCH v7 2/6] scsi: sr: support runtime pm

2012-09-28 Thread Aaron Lu
On 09/27/2012 06:46 PM, Oliver Neukum wrote: > On Tuesday 25 September 2012 16:01:35 Aaron Lu wrote: >> On Mon, Sep 24, 2012 at 11:40:18PM +0200, Rafael J. Wysocki wrote: >>> On Monday, September 24, 2012, Aaron Lu wrote: On Mon, Sep 24, 2012 at 02:55:31PM +0200, Rafael J. Wysocki wrote: > >>

Re: [PATCH v7 2/6] scsi: sr: support runtime pm

2012-09-27 Thread Oliver Neukum
On Tuesday 25 September 2012 16:01:35 Aaron Lu wrote: > On Mon, Sep 24, 2012 at 11:40:18PM +0200, Rafael J. Wysocki wrote: > > On Monday, September 24, 2012, Aaron Lu wrote: > > > On Mon, Sep 24, 2012 at 02:55:31PM +0200, Rafael J. Wysocki wrote: > I just checked the spec again and tested, when th

Re: [PATCH v7 2/6] scsi: sr: support runtime pm

2012-09-26 Thread Aaron Lu
On Wed, Sep 26, 2012 at 7:18 PM, Rafael J. Wysocki wrote: > On Wednesday, September 26, 2012, Aaron Lu wrote: >> On Tue, Sep 25, 2012 at 11:45:34PM +0200, Rafael J. Wysocki wrote: >> > On Tuesday, September 25, 2012, Aaron Lu wrote: >> > > On 09/25/2012 10:23 PM, Oliver Neukum wrote: >> > > > On T

Re: [PATCH v7 2/6] scsi: sr: support runtime pm

2012-09-26 Thread Rafael J. Wysocki
On Wednesday, September 26, 2012, Aaron Lu wrote: > On Tue, Sep 25, 2012 at 11:45:34PM +0200, Rafael J. Wysocki wrote: > > On Tuesday, September 25, 2012, Aaron Lu wrote: > > > On 09/25/2012 10:23 PM, Oliver Neukum wrote: > > > > On Tuesday 25 September 2012 22:20:21 Aaron Lu wrote: > > > >> On Tue

Re: [PATCH v7 2/6] scsi: sr: support runtime pm

2012-09-26 Thread Oliver Neukum
On Tuesday 25 September 2012 22:46:06 Aaron Lu wrote: > On 09/25/2012 10:23 PM, Oliver Neukum wrote: > >> BTW, if sr_suspend should be generic, that would suggest I shouldn't > >> write any ZPODD related code there, right? Any suggestion where these > >> code should go then? > > > > libata. Maybe

Re: [PATCH v7 2/6] scsi: sr: support runtime pm

2012-09-25 Thread Aaron Lu
On Tue, Sep 25, 2012 at 11:45:34PM +0200, Rafael J. Wysocki wrote: > On Tuesday, September 25, 2012, Aaron Lu wrote: > > On 09/25/2012 10:23 PM, Oliver Neukum wrote: > > > On Tuesday 25 September 2012 22:20:21 Aaron Lu wrote: > > >> On Tue, Sep 25, 2012 at 01:47:52PM +0200, Rafael J. Wysocki wrote:

Re: [PATCH v7 2/6] scsi: sr: support runtime pm

2012-09-25 Thread Rafael J. Wysocki
On Tuesday, September 25, 2012, Aaron Lu wrote: > On 09/25/2012 10:23 PM, Oliver Neukum wrote: > > On Tuesday 25 September 2012 22:20:21 Aaron Lu wrote: > >> On Tue, Sep 25, 2012 at 01:47:52PM +0200, Rafael J. Wysocki wrote: > >>> On Tuesday, September 25, 2012, Aaron Lu wrote: > I'm thinking

Re: [PATCH v7 2/6] scsi: sr: support runtime pm

2012-09-25 Thread Aaron Lu
On 09/25/2012 10:23 PM, Oliver Neukum wrote: > On Tuesday 25 September 2012 22:20:21 Aaron Lu wrote: >> On Tue, Sep 25, 2012 at 01:47:52PM +0200, Rafael J. Wysocki wrote: >>> On Tuesday, September 25, 2012, Aaron Lu wrote: I'm thinking of enabling this GPE in sr_suspend once we decided that it

Re: [PATCH v7 2/6] scsi: sr: support runtime pm

2012-09-25 Thread Oliver Neukum
On Tuesday 25 September 2012 22:20:21 Aaron Lu wrote: > On Tue, Sep 25, 2012 at 01:47:52PM +0200, Rafael J. Wysocki wrote: > > On Tuesday, September 25, 2012, Aaron Lu wrote: > > > I'm thinking of enabling this GPE in sr_suspend once we decided that it > > > is ready to be powered off, so the time

Re: [PATCH v7 2/6] scsi: sr: support runtime pm

2012-09-25 Thread Aaron Lu
On Tue, Sep 25, 2012 at 01:47:52PM +0200, Rafael J. Wysocki wrote: > On Tuesday, September 25, 2012, Aaron Lu wrote: > > I'm thinking of enabling this GPE in sr_suspend once we decided that it > > is ready to be powered off, so the time frame between sr_suspend and > > when the power is actually re

Re: [PATCH v7 2/6] scsi: sr: support runtime pm

2012-09-25 Thread Rafael J. Wysocki
On Tuesday, September 25, 2012, Aaron Lu wrote: > On Mon, Sep 24, 2012 at 11:40:18PM +0200, Rafael J. Wysocki wrote: > > On Monday, September 24, 2012, Aaron Lu wrote: > > > On Mon, Sep 24, 2012 at 02:55:31PM +0200, Rafael J. Wysocki wrote: > > > > And I'd add a comment about the next poll. > > > >

Re: [PATCH v7 2/6] scsi: sr: support runtime pm

2012-09-25 Thread Aaron Lu
On Mon, Sep 24, 2012 at 11:40:18PM +0200, Rafael J. Wysocki wrote: > On Monday, September 24, 2012, Aaron Lu wrote: > > On Mon, Sep 24, 2012 at 02:55:31PM +0200, Rafael J. Wysocki wrote: > > > And I'd add a comment about the next poll. > > > > > > This appears somewhat racy, though, because in the

Re: [PATCH v7 2/6] scsi: sr: support runtime pm

2012-09-24 Thread Rafael J. Wysocki
On Monday, September 24, 2012, Aaron Lu wrote: > On Mon, Sep 24, 2012 at 02:55:31PM +0200, Rafael J. Wysocki wrote: > > On Monday, September 24, 2012, Aaron Lu wrote: > > > On Fri, Sep 21, 2012 at 10:49:32PM +0200, Rafael J. Wysocki wrote: > > > > On Friday, September 21, 2012, Aaron Lu wrote: > >

Re: [PATCH v7 2/6] scsi: sr: support runtime pm

2012-09-24 Thread Aaron Lu
On Mon, Sep 24, 2012 at 02:55:31PM +0200, Rafael J. Wysocki wrote: > On Monday, September 24, 2012, Aaron Lu wrote: > > On Fri, Sep 21, 2012 at 10:49:32PM +0200, Rafael J. Wysocki wrote: > > > On Friday, September 21, 2012, Aaron Lu wrote: > > > > On Thu, Sep 20, 2012 at 10:48:10PM +0200, Rafael J.

Re: [PATCH v7 2/6] scsi: sr: support runtime pm

2012-09-24 Thread Rafael J. Wysocki
On Monday, September 24, 2012, Aaron Lu wrote: > On Fri, Sep 21, 2012 at 10:49:32PM +0200, Rafael J. Wysocki wrote: > > On Friday, September 21, 2012, Aaron Lu wrote: > > > On Thu, Sep 20, 2012 at 10:48:10PM +0200, Rafael J. Wysocki wrote: > > > > On Wednesday, September 12, 2012, Aaron Lu wrote: >

Re: [PATCH v7 2/6] scsi: sr: support runtime pm

2012-09-23 Thread Aaron Lu
On Fri, Sep 21, 2012 at 10:49:32PM +0200, Rafael J. Wysocki wrote: > On Friday, September 21, 2012, Aaron Lu wrote: > > On Thu, Sep 20, 2012 at 10:48:10PM +0200, Rafael J. Wysocki wrote: > > > On Wednesday, September 12, 2012, Aaron Lu wrote: > > > > Place the ODD into runtime suspend state as soon

Re: [PATCH v7 2/6] scsi: sr: support runtime pm

2012-09-21 Thread Rafael J. Wysocki
On Friday, September 21, 2012, Aaron Lu wrote: > On Thu, Sep 20, 2012 at 10:48:10PM +0200, Rafael J. Wysocki wrote: > > On Wednesday, September 12, 2012, Aaron Lu wrote: > > > Place the ODD into runtime suspend state as soon as there is nobody > > > using it. > > > > OK, so how is ODD related to t

Re: [PATCH v7 2/6] scsi: sr: support runtime pm

2012-09-20 Thread Aaron Lu
On Thu, Sep 20, 2012 at 10:48:10PM +0200, Rafael J. Wysocki wrote: > On Wednesday, September 12, 2012, Aaron Lu wrote: > > Place the ODD into runtime suspend state as soon as there is nobody > > using it. > > OK, so how is ODD related to the sr driver? As Alan has explained, ODD(optical disk driv

Re: [PATCH v7 2/6] scsi: sr: support runtime pm

2012-09-20 Thread Alan Stern
On Thu, 20 Sep 2012, Rafael J. Wysocki wrote: > On Wednesday, September 12, 2012, Aaron Lu wrote: > > Place the ODD into runtime suspend state as soon as there is nobody > > using it. > > OK, so how is ODD related to the sr driver? Aaron did not make it clear in this patch description, although

Re: [PATCH v7 2/6] scsi: sr: support runtime pm

2012-09-20 Thread Rafael J. Wysocki
On Wednesday, September 12, 2012, Aaron Lu wrote: > Place the ODD into runtime suspend state as soon as there is nobody > using it. OK, so how is ODD related to the sr driver? > The only exception is, if we just find that a new medium is > inserted, we wait for the next events checking to idle it

[PATCH v7 2/6] scsi: sr: support runtime pm

2012-09-12 Thread Aaron Lu
Place the ODD into runtime suspend state as soon as there is nobody using it. The only exception is, if we just find that a new medium is inserted, we wait for the next events checking to idle it. Based on ideas of Alan Stern and Oliver Neukum. Signed-off-by: Aaron Lu --- drivers/scsi/sr.c | 29