Re: [PATCH v9 06/10] ata: zpodd: check zero power ready status

2013-01-03 Thread Aaron Lu
On 12/29/2012 05:16 AM, Tejun Heo wrote: Hello, On Wed, Dec 26, 2012 at 09:42:14AM +0800, Aaron Lu wrote: This is really a round-about way to find out the matching device and it wouldn't work if the disk device nests deeper. Doesn't really look like a good idea to me. I don't quite

Re: [PATCH v9 06/10] ata: zpodd: check zero power ready status

2012-12-28 Thread Tejun Heo
Hello, On Wed, Dec 26, 2012 at 09:42:14AM +0800, Aaron Lu wrote: This is really a round-about way to find out the matching device and it wouldn't work if the disk device nests deeper. Doesn't really look like a good idea to me. I don't quite understand the 'disk device nests deeper'

Re: [PATCH v9 06/10] ata: zpodd: check zero power ready status

2012-12-25 Thread Tejun Heo
Hello, Aaron. On Thu, Dec 20, 2012 at 02:07:25PM +0800, Aaron Lu wrote: +static int is_gendisk_part0(struct device *dev, void *data) +{ + struct device **child = data; + + if (dev-class == block_class dev-type == disk_type) { + *child = dev; + return 1; +

Re: [PATCH v9 06/10] ata: zpodd: check zero power ready status

2012-12-25 Thread Aaron Lu
On 12/26/2012 01:17 AM, Tejun Heo wrote: Hello, Aaron. On Thu, Dec 20, 2012 at 02:07:25PM +0800, Aaron Lu wrote: +static int is_gendisk_part0(struct device *dev, void *data) +{ +struct device **child = data; + +if (dev-class == block_class dev-type == disk_type) { +

Re: [PATCH v9 06/10] ata: zpodd: check zero power ready status

2012-12-19 Thread Aaron Lu
Hi Tejun, On 12/04/2012 12:23 AM, Tejun Heo wrote: Hello, James. On Mon, Dec 03, 2012 at 08:25:43AM +, James Bottomley wrote: diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index e65c62e..1756151 100644 --- a/include/scsi/scsi_device.h +++

Re: [PATCH v9 06/10] ata: zpodd: check zero power ready status

2012-12-18 Thread Aaron Lu
Hi Everyone, Due to lack of information, I think I'll go ahead and pick up a simple solution for this(i.e. the code I attached previously to set a flag event_driven in scsi_device to let sr skip events poll) and send a new series out for you to review. After all, I can't wait forever... Please

Re: [PATCH v9 06/10] ata: zpodd: check zero power ready status

2012-12-10 Thread Tejun Heo
Hello, guys. On Mon, Dec 10, 2012 at 11:26:07AM +0800, Aaron Lu wrote: The problem here is there's no easy to reach genhd from libata (or the other way around) without going through sr. I think we're gonna have to have something in sr one way or the other. Can't we do that via an

Re: [PATCH v9 06/10] ata: zpodd: check zero power ready status

2012-12-09 Thread Aaron Lu
On 12/07/2012 02:13 PM, Aaron Lu wrote: On 12/04/2012 08:11 PM, James Bottomley wrote: On Mon, 2012-12-03 at 08:23 -0800, Tejun Heo wrote: Hello, James. On Mon, Dec 03, 2012 at 08:25:43AM +, James Bottomley wrote: diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h

Re: [PATCH v9 06/10] ata: zpodd: check zero power ready status

2012-12-06 Thread Aaron Lu
On 12/04/2012 08:11 PM, James Bottomley wrote: On Mon, 2012-12-03 at 08:23 -0800, Tejun Heo wrote: Hello, James. On Mon, Dec 03, 2012 at 08:25:43AM +, James Bottomley wrote: diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index e65c62e..1756151 100644 ---

Re: [PATCH v9 06/10] ata: zpodd: check zero power ready status

2012-12-04 Thread James Bottomley
On Mon, 2012-12-03 at 08:23 -0800, Tejun Heo wrote: Hello, James. On Mon, Dec 03, 2012 at 08:25:43AM +, James Bottomley wrote: diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index e65c62e..1756151 100644 --- a/include/scsi/scsi_device.h +++

Re: [PATCH v9 06/10] ata: zpodd: check zero power ready status

2012-12-03 Thread Aaron Lu
On Wed, Nov 28, 2012 at 08:56:09AM +, James Bottomley wrote: On Tue, 2012-11-27 at 17:39 -0800, Tejun Heo wrote: Hey, Rafael. On Wed, Nov 28, 2012 at 01:51:00AM +0100, Rafael J. Wysocki wrote: Having considered that a bit more I'm now thinking that in fact the power state the

Re: [PATCH v9 06/10] ata: zpodd: check zero power ready status

2012-12-03 Thread James Bottomley
On Mon, 2012-12-03 at 16:13 +0800, Aaron Lu wrote: On Wed, Nov 28, 2012 at 08:56:09AM +, James Bottomley wrote: On Tue, 2012-11-27 at 17:39 -0800, Tejun Heo wrote: Hey, Rafael. On Wed, Nov 28, 2012 at 01:51:00AM +0100, Rafael J. Wysocki wrote: Having considered that a bit more

Re: [PATCH v9 06/10] ata: zpodd: check zero power ready status

2012-12-03 Thread Aaron Lu
On Mon, Dec 03, 2012 at 08:25:43AM +, James Bottomley wrote: On Mon, 2012-12-03 at 16:13 +0800, Aaron Lu wrote: On Wed, Nov 28, 2012 at 08:56:09AM +, James Bottomley wrote: On Tue, 2012-11-27 at 17:39 -0800, Tejun Heo wrote: Hey, Rafael. On Wed, Nov 28, 2012 at

Re: [PATCH v9 06/10] ata: zpodd: check zero power ready status

2012-12-03 Thread Tejun Heo
Hello, James. On Mon, Dec 03, 2012 at 08:25:43AM +, James Bottomley wrote: diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index e65c62e..1756151 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h @@ -160,6 +160,7 @@ struct scsi_device {

Re: [PATCH v9 06/10] ata: zpodd: check zero power ready status

2012-12-03 Thread Jeff Garzik
On 12/03/2012 11:23 AM, Tejun Heo wrote: Hello, James. On Mon, Dec 03, 2012 at 08:25:43AM +, James Bottomley wrote: diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index e65c62e..1756151 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h @@ -160,6

Re: [PATCH v9 06/10] ata: zpodd: check zero power ready status

2012-12-03 Thread Aaron Lu
On 12/04/2012 02:56 AM, Jeff Garzik wrote: On 12/03/2012 11:23 AM, Tejun Heo wrote: Hello, James. On Mon, Dec 03, 2012 at 08:25:43AM +, James Bottomley wrote: diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index e65c62e..1756151 100644 ---

Re: [PATCH v9 06/10] ata: zpodd: check zero power ready status

2012-11-30 Thread Aaron Lu
On 11/28/2012 09:39 AM, Tejun Heo wrote: Hey, Rafael. On Wed, Nov 28, 2012 at 01:51:00AM +0100, Rafael J. Wysocki wrote: Having considered that a bit more I'm now thinking that in fact the power state the device is in at the moment doesn't really matter, so the polling code need not

Re: [PATCH v9 06/10] ata: zpodd: check zero power ready status

2012-11-30 Thread Rafael J. Wysocki
On Friday, November 30, 2012 04:55:56 PM Aaron Lu wrote: On 11/28/2012 09:39 AM, Tejun Heo wrote: Hey, Rafael. On Wed, Nov 28, 2012 at 01:51:00AM +0100, Rafael J. Wysocki wrote: Having considered that a bit more I'm now thinking that in fact the power state the device is in at the

Re: [PATCH v9 06/10] ata: zpodd: check zero power ready status

2012-11-28 Thread James Bottomley
On Tue, 2012-11-27 at 17:39 -0800, Tejun Heo wrote: Hey, Rafael. On Wed, Nov 28, 2012 at 01:51:00AM +0100, Rafael J. Wysocki wrote: Having considered that a bit more I'm now thinking that in fact the power state the device is in at the moment doesn't really matter, so the polling code

Re: [PATCH v9 06/10] ata: zpodd: check zero power ready status

2012-11-27 Thread Rafael J. Wysocki
On Monday, November 26, 2012 09:03:11 AM James Bottomley wrote: On Mon, 2012-11-26 at 01:33 +0100, Rafael J. Wysocki wrote: On Monday, November 19, 2012 03:06:51 PM James Bottomley wrote: I really think we need a way for (auto)pm and event polling to talk to each other so that autopm

Re: [PATCH v9 06/10] ata: zpodd: check zero power ready status

2012-11-27 Thread Tejun Heo
Hey, Rafael. On Wed, Nov 28, 2012 at 01:51:00AM +0100, Rafael J. Wysocki wrote: Having considered that a bit more I'm now thinking that in fact the power state the device is in at the moment doesn't really matter, so the polling code need not really know what PM is doing. What it needs to

Re: [PATCH v9 06/10] ata: zpodd: check zero power ready status

2012-11-27 Thread Aaron Lu
On 11/28/2012 09:39 AM, Tejun Heo wrote: Hey, Rafael. On Wed, Nov 28, 2012 at 01:51:00AM +0100, Rafael J. Wysocki wrote: Having considered that a bit more I'm now thinking that in fact the power state the device is in at the moment doesn't really matter, so the polling code need not

Re: [PATCH v9 06/10] ata: zpodd: check zero power ready status

2012-11-26 Thread Aaron Lu
On 11/26/2012 03:32 PM, James Bottomley wrote: On Mon, 2012-11-26 at 13:09 +0800, Aaron Lu wrote: On 11/26/2012 01:03 PM, James Bottomley wrote: On Mon, 2012-11-26 at 01:33 +0100, Rafael J. Wysocki wrote: On Monday, November 19, 2012 03:06:51 PM James Bottomley wrote: I really think we need a

Re: [PATCH v9 06/10] ata: zpodd: check zero power ready status

2012-11-26 Thread James Bottomley
On Mon, 2012-11-26 at 16:27 +0800, Aaron Lu wrote: Well, ZPREADY is not a power state that we can program the ODD to enter(figure 234 and table 323 of the SPEC), it servers more like an information provided by ODD to host so that host does not need to do TUR and then examine the sense code to

Re: [PATCH v9 06/10] ata: zpodd: check zero power ready status

2012-11-26 Thread Alan Stern
On Mon, 26 Nov 2012, James Bottomley wrote: I'm also curious about driving sleep from autopm, since mode page timers don't control the sleep transition. Is it feasible to do this the other way around? That is, to drive runtime suspend by noticing when the device decides to put itself into a

Re: [PATCH v9 06/10] ata: zpodd: check zero power ready status

2012-11-26 Thread James Bottomley
On Mon, 2012-11-26 at 11:21 -0500, Alan Stern wrote: On Mon, 26 Nov 2012, James Bottomley wrote: I'm also curious about driving sleep from autopm, since mode page timers don't control the sleep transition. Is it feasible to do this the other way around? That is, to drive runtime

Re: [PATCH v9 06/10] ata: zpodd: check zero power ready status

2012-11-26 Thread Aaron Lu
On 11/26/2012 09:17 PM, James Bottomley wrote: On Mon, 2012-11-26 at 16:27 +0800, Aaron Lu wrote: Well, ZPREADY is not a power state that we can program the ODD to enter(figure 234 and table 323 of the SPEC), it servers more like an information provided by ODD to host so that host does not

Re: [PATCH v9 06/10] ata: zpodd: check zero power ready status

2012-11-25 Thread Rafael J. Wysocki
On Monday, November 19, 2012 03:06:51 PM James Bottomley wrote: On Mon, 2012-11-19 at 06:56 -0800, Tejun Heo wrote: Hey, Aaron. On Mon, Nov 19, 2012 at 11:09:40AM +0800, Aaron Lu wrote: What I'm confused about is what autopm does for devices w/o zpodd. What happens then? Is it

Re: [PATCH v9 06/10] ata: zpodd: check zero power ready status

2012-11-25 Thread Aaron Lu
On 11/26/2012 08:33 AM, Rafael J. Wysocki wrote: On Monday, November 19, 2012 03:06:51 PM James Bottomley wrote: On Mon, 2012-11-19 at 06:56 -0800, Tejun Heo wrote: Hey, Aaron. On Mon, Nov 19, 2012 at 11:09:40AM +0800, Aaron Lu wrote: What I'm confused about is what autopm does for devices

Re: [PATCH v9 06/10] ata: zpodd: check zero power ready status

2012-11-25 Thread Rafael J. Wysocki
On Tuesday, November 20, 2012 04:59:57 PM Aaron Lu wrote: On 11/20/2012 02:00 PM, Aaron Lu wrote: On 11/19/2012 10:56 PM, Tejun Heo wrote: I really think we need a way for (auto)pm and event polling to talk to each other so that autopm can tell event poll to sod off while pm is in effect.

Re: [PATCH v9 06/10] ata: zpodd: check zero power ready status

2012-11-25 Thread Aaron Lu
On 11/26/2012 08:50 AM, Rafael J. Wysocki wrote: On Tuesday, November 20, 2012 04:59:57 PM Aaron Lu wrote: On 11/20/2012 02:00 PM, Aaron Lu wrote: On 11/19/2012 10:56 PM, Tejun Heo wrote: I really think we need a way for (auto)pm and event polling to talk to each other so that autopm can tell

Re: [PATCH v9 06/10] ata: zpodd: check zero power ready status

2012-11-25 Thread Rafael J. Wysocki
On Monday, November 26, 2012 08:48:51 AM Aaron Lu wrote: On 11/26/2012 08:50 AM, Rafael J. Wysocki wrote: On Tuesday, November 20, 2012 04:59:57 PM Aaron Lu wrote: On 11/20/2012 02:00 PM, Aaron Lu wrote: On 11/19/2012 10:56 PM, Tejun Heo wrote: I really think we need a way for (auto)pm

Re: [PATCH v9 06/10] ata: zpodd: check zero power ready status

2012-11-25 Thread Aaron Lu
On 11/26/2012 09:03 AM, Rafael J. Wysocki wrote: On Monday, November 26, 2012 08:48:51 AM Aaron Lu wrote: On 11/26/2012 08:50 AM, Rafael J. Wysocki wrote: On Tuesday, November 20, 2012 04:59:57 PM Aaron Lu wrote: On 11/20/2012 02:00 PM, Aaron Lu wrote: On 11/19/2012 10:56 PM, Tejun Heo wrote:

Re: [PATCH v9 06/10] ata: zpodd: check zero power ready status

2012-11-25 Thread Rafael J. Wysocki
On Monday, November 26, 2012 09:05:58 AM Aaron Lu wrote: On 11/26/2012 09:03 AM, Rafael J. Wysocki wrote: On Monday, November 26, 2012 08:48:51 AM Aaron Lu wrote: On 11/26/2012 08:50 AM, Rafael J. Wysocki wrote: On Tuesday, November 20, 2012 04:59:57 PM Aaron Lu wrote: On 11/20/2012 02:00

Re: [PATCH v9 06/10] ata: zpodd: check zero power ready status

2012-11-25 Thread Aaron Lu
On 11/26/2012 09:11 AM, Rafael J. Wysocki wrote: On Monday, November 26, 2012 09:05:58 AM Aaron Lu wrote: On 11/26/2012 09:03 AM, Rafael J. Wysocki wrote: On Monday, November 26, 2012 08:48:51 AM Aaron Lu wrote: On 11/26/2012 08:50 AM, Rafael J. Wysocki wrote: On Tuesday, November 20, 2012

Re: [PATCH v9 06/10] ata: zpodd: check zero power ready status

2012-11-25 Thread Aaron Lu
On 11/26/2012 09:11 AM, Rafael J. Wysocki wrote: On Monday, November 26, 2012 09:05:58 AM Aaron Lu wrote: On 11/26/2012 09:03 AM, Rafael J. Wysocki wrote: On Monday, November 26, 2012 08:48:51 AM Aaron Lu wrote: On 11/26/2012 08:50 AM, Rafael J. Wysocki wrote: On Tuesday, November 20, 2012

Re: [PATCH v9 06/10] ata: zpodd: check zero power ready status

2012-11-25 Thread Rafael J. Wysocki
On Monday, November 26, 2012 09:09:36 AM Aaron Lu wrote: On 11/26/2012 09:11 AM, Rafael J. Wysocki wrote: On Monday, November 26, 2012 09:05:58 AM Aaron Lu wrote: On 11/26/2012 09:03 AM, Rafael J. Wysocki wrote: On Monday, November 26, 2012 08:48:51 AM Aaron Lu wrote: On 11/26/2012 08:50

Re: [PATCH v9 06/10] ata: zpodd: check zero power ready status

2012-11-25 Thread Aaron Lu
On 11/26/2012 09:22 AM, Rafael J. Wysocki wrote: On Monday, November 26, 2012 09:09:36 AM Aaron Lu wrote: On 11/26/2012 09:11 AM, Rafael J. Wysocki wrote: On Monday, November 26, 2012 09:05:58 AM Aaron Lu wrote: On 11/26/2012 09:03 AM, Rafael J. Wysocki wrote: On Monday, November 26, 2012

Re: [PATCH v9 06/10] ata: zpodd: check zero power ready status

2012-11-25 Thread James Bottomley
On Mon, 2012-11-26 at 01:33 +0100, Rafael J. Wysocki wrote: On Monday, November 19, 2012 03:06:51 PM James Bottomley wrote: I really think we need a way for (auto)pm and event polling to talk to each other so that autopm can tell event poll to sod off while pm is in effect. Trying to

Re: [PATCH v9 06/10] ata: zpodd: check zero power ready status

2012-11-25 Thread Aaron Lu
On 11/26/2012 01:03 PM, James Bottomley wrote: On Mon, 2012-11-26 at 01:33 +0100, Rafael J. Wysocki wrote: On Monday, November 19, 2012 03:06:51 PM James Bottomley wrote: I really think we need a way for (auto)pm and event polling to talk to each other so that autopm can tell event poll to sod

Re: [PATCH v9 06/10] ata: zpodd: check zero power ready status

2012-11-25 Thread James Bottomley
On Mon, 2012-11-26 at 13:09 +0800, Aaron Lu wrote: On 11/26/2012 01:03 PM, James Bottomley wrote: On Mon, 2012-11-26 at 01:33 +0100, Rafael J. Wysocki wrote: On Monday, November 19, 2012 03:06:51 PM James Bottomley wrote: I really think we need a way for (auto)pm and event polling to talk

Re: [PATCH v9 06/10] ata: zpodd: check zero power ready status

2012-11-20 Thread Aaron Lu
On 11/20/2012 02:00 PM, Aaron Lu wrote: On 11/19/2012 10:56 PM, Tejun Heo wrote: I really think we need a way for (auto)pm and event polling to talk to each other so that autopm can tell event poll to sod off while pm is in effect. Trying to solve this from inside libata doesn't seem right.

Re: [PATCH v9 06/10] ata: zpodd: check zero power ready status

2012-11-19 Thread Tejun Heo
Hey, Aaron. On Mon, Nov 19, 2012 at 11:09:40AM +0800, Aaron Lu wrote: What I'm confused about is what autopm does for devices w/o zpodd. What happens then? Is it gonna leave power on for the device and, say, go on to suspend the controller? But, how would that work for, say, future

Re: [PATCH v9 06/10] ata: zpodd: check zero power ready status

2012-11-19 Thread James Bottomley
On Mon, 2012-11-19 at 06:56 -0800, Tejun Heo wrote: Hey, Aaron. On Mon, Nov 19, 2012 at 11:09:40AM +0800, Aaron Lu wrote: What I'm confused about is what autopm does for devices w/o zpodd. What happens then? Is it gonna leave power on for the device and, say, go on to suspend the

Re: [PATCH v9 06/10] ata: zpodd: check zero power ready status

2012-11-19 Thread Aaron Lu
On 11/19/2012 10:56 PM, Tejun Heo wrote: Hey, Aaron. On Mon, Nov 19, 2012 at 11:09:40AM +0800, Aaron Lu wrote: What I'm confused about is what autopm does for devices w/o zpodd. What happens then? Is it gonna leave power on for the device and, say, go on to suspend the controller? But,

Re: [PATCH v9 06/10] ata: zpodd: check zero power ready status

2012-11-18 Thread Tejun Heo
Hello, Aaron. On Wed, Nov 14, 2012 at 10:18:23AM +0800, Aaron Lu wrote: On 11/13/2012 03:13 AM, Tejun Heo wrote: Hello, On Fri, Nov 09, 2012 at 02:51:58PM +0800, Aaron Lu wrote: +#define POWEROFF_DELAY (30 * 1000) /* 30 seconds for power off delay */ + struct zpodd {

Re: [PATCH v9 06/10] ata: zpodd: check zero power ready status

2012-11-18 Thread Aaron Lu
On 11/18/2012 11:00 PM, Tejun Heo wrote: Hello, Aaron. Hi, On Wed, Nov 14, 2012 at 10:18:23AM +0800, Aaron Lu wrote: On 11/13/2012 03:13 AM, Tejun Heo wrote: Hello, On Fri, Nov 09, 2012 at 02:51:58PM +0800, Aaron Lu wrote: +#define POWEROFF_DELAY (30 * 1000) /* 30 seconds for power

Re: [PATCH v9 06/10] ata: zpodd: check zero power ready status

2012-11-13 Thread Aaron Lu
On Mon, Nov 12, 2012 at 11:13:03AM -0800, Tejun Heo wrote: Hello, On Fri, Nov 09, 2012 at 02:51:58PM +0800, Aaron Lu wrote: +/* + * Check ODD's zero power ready status. + * + * This function is called during ATA port's suspend path, + * when the port is not frozen yet, so that we can

Re: [PATCH v9 06/10] ata: zpodd: check zero power ready status

2012-11-13 Thread Aaron Lu
On 11/13/2012 03:13 AM, Tejun Heo wrote: Hello, On Fri, Nov 09, 2012 at 02:51:58PM +0800, Aaron Lu wrote: +#define POWEROFF_DELAY (30 * 1000) /* 30 seconds for power off delay */ + struct zpodd { bool slot:1; bool drawer:1; bool from_notify:1; /* resumed as a

Re: [PATCH v9 06/10] ata: zpodd: check zero power ready status

2012-11-12 Thread Tejun Heo
Hello, On Fri, Nov 09, 2012 at 02:51:58PM +0800, Aaron Lu wrote: @@ -784,7 +784,13 @@ static int ata_acpi_push_id(struct ata_device *dev) */ int ata_acpi_on_suspend(struct ata_port *ap) { - /* nada */ + struct ata_device *dev; + + ata_for_each_dev(dev, ap-link, ENABLED) {

[PATCH v9 06/10] ata: zpodd: check zero power ready status

2012-11-08 Thread Aaron Lu
Per the Mount Fuji spec, the ODD is considered zero power ready when: - For slot type ODD, no media inside; - For tray type ODD, no media inside and tray closed. The information can be retrieved by either the returned information of command GET_EVENT_STATUS_NOTIFICATION(the command is used to