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: On Sun, 30

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-maker for where

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 only ZPODD devices

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 of only ZPODD

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 set

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 more 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 generic place

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't

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 has power, I

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 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/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

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. It's

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. I

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(like the

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 enables a

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 wrote: On

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. If a piece of

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 is useful to all

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: I just

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: Say the

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 the ODD

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, Sep 25, 2012

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 r...@sisk.pl 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

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 theory a media

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. This

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 removed

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 frame

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 is

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 of enabling

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: On

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: Place

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. Wysocki

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: On Thu,

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 as there

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 the sr

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.

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 it may

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 drive) is

[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 aaron...@intel.com ---