diff options
author | Aaron Lu <aaron.lu@intel.com> | 2013-01-15 17:21:00 +0800 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2013-01-21 15:41:34 -0500 |
commit | 3dc67440d99b2c718ef5f1eb1424a9066ffa3fb9 (patch) | |
tree | 4eee59932d2b99daf76f2bca624c05e719a4b004 /fs/mpage.c | |
parent | f064a20dded807448669426c9bfb7d03aba5659c (diff) | |
download | linux-3dc67440d99b2c718ef5f1eb1424a9066ffa3fb9.tar.bz2 |
libata: check zero power ready status for ZPODD
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 poll for
media event) or sense code.
The information provided by the media status byte is not accurate, it
is possible that after a new disc is just inserted, the status byte
still returns media not present. So this information can not be used as
the deciding factor, we use sense code to decide if zpready status is
true.
When we first sensed the ODD in the zero power ready state, the
zp_sampled will be set and timestamp will be recoreded. And after ODD
stayed in this state for some pre-defined period, the ODD is considered
as power off ready and the zp_ready flag will be set. The zp_ready flag
serves as the deciding factor other code will use to see if power off is
OK for the ODD.
The Mount Fuji spec suggests a delay should be used here, to avoid the
case user ejects the ODD and then instantly inserts a new one again, so
that we can avoid a power transition. And some ODDs may be slow to place
its head to the home position after disc is ejected, so a delay here is
generally a good idea. And the delay time can be changed via the module
param zpodd_poweroff_delay.
The zero power ready status check is performed in the ata port's runtime
suspend code path, when port is not frozen yet, as we need to issue some
IOs to the ODD.
Signed-off-by: Aaron Lu <aaron.lu@intel.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'fs/mpage.c')
0 files changed, 0 insertions, 0 deletions