Damien Le Moal 2da4c5e24e ata: libata-core: Improve ata_dev_power_set_active()
Improve the function ata_dev_power_set_active() by having it do nothing
for a disk that is already in the active power state. To do that,
introduce the function ata_dev_power_is_active() to test the current
power state of the disk and return true if the disk is in the PM0:
active or PM1: idle state (0xff value for the count field of the CHECK
POWER MODE command output).

To preserve the existing behavior, if the CHECK POWER MODE command
issued in ata_dev_power_is_active() fails, the drive is assumed to be in
standby mode and false is returned.

With this change, issuing the VERIFY command to access the disk media to
spin it up becomes unnecessary most of the time during system resume as
the port reset done by libata-eh on resume often result in the drive to
spin-up (this behavior is not clearly defined by the ACS specifications
and may thus vary between disk models).

Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Niklas Cassel <niklas.cassel@wdc.com>
2023-10-16 07:03:02 +09:00
..
2023-08-02 17:37:06 +09:00
2023-03-23 10:29:26 +09:00
2023-02-22 13:35:51 -08:00
2023-04-26 15:39:25 -07:00
2023-08-02 17:37:06 +09:00
2023-08-02 17:37:06 +09:00
2023-08-02 17:37:06 +09:00