]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
ata: libata-core: Do not try to set sleeping devices to standby
authorDamien Le Moal <dlemoal@kernel.org>
Thu, 11 Jan 2024 11:51:22 +0000 (20:51 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 1 Mar 2024 12:34:59 +0000 (13:34 +0100)
commit 4b085736e44dbbe69b5eea1a8a294f404678a1f4 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/ata/libata-core.c

index d8cc1e27a125f0fbcadcd31fa146afc8868e2b6e..f12beeb96629d0264d1dfc3aa5c4261925754fb8 100644 (file)
@@ -2034,6 +2034,10 @@ void ata_dev_power_set_active(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;
+
        /*
         * Issue READ VERIFY SECTORS command for 1 sector at lba=0 only
         * if supported by the device.