summaryrefslogtreecommitdiff
path: root/drivers/ata
diff options
context:
space:
mode:
authorDamien Le Moal <dlemoal@kernel.org>2024-01-11 14:51:22 +0300
committerNiklas Cassel <cassel@kernel.org>2024-02-14 13:02:08 +0300
commit4b085736e44dbbe69b5eea1a8a294f404678a1f4 (patch)
tree1f2ed5b8f7f6ad2feeba23c951f6ad6814a60e9c /drivers/ata
parent51af8f255bdaca6d501afc0d085b808f67b44d91 (diff)
downloadlinux-4b085736e44dbbe69b5eea1a8a294f404678a1f4.tar.xz
ata: libata-core: Do not try to set sleeping devices to standby
In ata ata_dev_power_set_standby(), check that the target device is not sleeping. If it is, there is no need to do anything. Fixes: aa3998dbeb3a ("ata: libata-scsi: Disable scsi device manage_system_start_stop") Cc: stable@vger.kernel.org Signed-off-by: Damien Le Moal <dlemoal@kernel.org> Signed-off-by: Niklas Cassel <cassel@kernel.org>
Diffstat (limited to 'drivers/ata')
-rw-r--r--drivers/ata/libata-core.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 09ed67772fae..d9f80f4f70f5 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -2017,6 +2017,10 @@ void ata_dev_power_set_standby(struct ata_device *dev)
struct ata_taskfile tf;
unsigned int err_mask;
+ /* If the device is already sleeping, do nothing. */
+ if (dev->flags & ATA_DFLAG_SLEEPING)
+ return;
+
/*
* Some odd clown BIOSes issue spindown on power off (ACPI S4 or S5)
* causing some drives to spin up and down again. For these, do nothing