Thread (50 messages) 50 messages, 6 authors, 2012-02-23

Re: [RFC PATCH 6/6] libata: add ZPODD support

From: Lin Ming <hidden>
Date: 2012-02-15 06:46:12
Also in: linux-scsi, lkml

On Wed, 2012-02-15 at 14:06 +0800, Aaron Lu wrote:
Hi,

Good work, I'm also working on ZPODD for AMD platforms, some comments below.
Great :)
On Mon, Feb 13, 2012 at 5:11 PM, Lin Ming [off-list ref] wrote:
quoted
ZPODD(Zero Power Optical Disk Drive) is a new feature in
SATA 3.1 specification. It provides a way to power off unused CDROM.
I don't see anywhere in the sata 3.1 spec mentioned how to power off the
cdrom, the only relevant content is the newly defined device attention pin,
which is used to notify the host that this powered off device needs attention.
Or do I miss something?
You're right.
quoted
CDROM is powered off by executing ACPI power resource's _OFF method.
AMD has a different implementation to power off the CDROM, I'll need to
prepare another patch based on yours.
Could you share AMD's implementation?
quoted
When CDROM is powered off(D3Cold state), inserting disk will trigger a
wakeup event(GPE). GPE AML handler notifies the associated device. Then
CDROM is resumed in the notify handler.

Signed-off-by: Lin Ming <redacted>
---
 drivers/ata/libata-acpi.c |   64 +++++++++++++++++++++++++++++++++++++-------
 drivers/scsi/sr.c         |   39 +++++++++++++++++++++++++++
 drivers/scsi/sr.h         |    3 ++
 3 files changed, 95 insertions(+), 11 deletions(-)
diff --git a/drivers/scsi/sr.c b/drivers/scsi/sr.c
index 5fc97d2..bf4eace 100644
--- a/drivers/scsi/sr.c
+++ b/drivers/scsi/sr.c
@@ -716,6 +752,9 @@ static int sr_probe(struct device *dev)
       disk->flags |= GENHD_FL_REMOVABLE;
       add_disk(disk);

+       if (device_run_wake(dev))
+               cd->zpodd = 1;
+
For a cd to support zero power, it has to support device attention pin.
If it does not support that, once it is powered off, it can't be power up
back. So I don't think device_run_wake is enough to set the zpodd flag,
unless your firmware has done the check and created the acpi table
according to the result. Is it the case?
I should add device attention pin check.

Thanks for the comments.
Lin Ming
Thanks,
Aaron
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help