Skip to content

Commit

Permalink
ata: libata-core: Do not try to set sleeping devices to standby
Browse files Browse the repository at this point in the history
commit 4b08573 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: aa3998d ("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>
  • Loading branch information
damien-lemoal authored and gregkh committed Mar 1, 2024
1 parent cf245e8 commit 699e264
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/ata/libata-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 699e264

Please sign in to comment.