Thread (29 messages) 29 messages, 5 authors, 2012-04-06

Re: [PATCH v3 7/7] [SCSI] sr: adds Zero-power ODD support

From: Alan Stern <stern@rowland.harvard.edu>
Date: 2012-03-30 14:28:28
Also in: linux-acpi, linux-scsi, lkml

On Fri, 30 Mar 2012, Aaron Lu wrote:
quoted
quoted
For the ODD to be put into suspend state, the conditions should be:
1 tray closed
2 no media inside
I think we missed the condition 1 check now.

And if we follow the two conditions, the events can be safely ignored.
No, they can't.  Otherwise the device won't power back up when the user 
inserts a new disc.
The ODD is put to zero power state, so it can't react to the eject
button without being powered up back first ;-)
On current implementation, ACPI is used to power back up the ODD like this:
1 User press the eject button;
2 A gpe event fired, and ACPI interrupt, and the corresponding gpe
handler runs and the ODD's ACPI handle is notified about DEVICE_WAKE_UP;
3 In ODD's acpi notify handler, we power back up it by scsi_autopm_get_device.
This is handled in the following Lin Ming's patch:
[PATCH v3 2/7] libata-acpi: add ata port runtime D3Cold support
I see.  Then you are right; it's not necessary to check for events 
while the drive is at zero power.
When the ODD is put to zero power state, it will not be able to handle
commands like CDROMEJECT. We have to power it up first and then handle
the ioctl request. Currently, we only power back up the ODD when user
press the eject button as explained above.
Then you may want to avoid going to zero-power while a program is
holding the device file open.  After all, the program might issue a
CDROMEJECT ioctl.

Alan Stern
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help