summaryrefslogtreecommitdiffstats
path: root/drivers/ata
diff options
context:
space:
mode:
authorDamien Le Moal <dlemoal@kernel.org>2023-09-02 09:32:21 +0200
committerDamien Le Moal <dlemoal@kernel.org>2023-10-03 02:39:50 +0200
commit3341b82368fb26dcf75f2c60320dc7442dac7075 (patch)
tree8edec84c8a0b33c3a2e3b1cb2cd26c5be575f8e1 /drivers/ata
parentata: libata-core: Do not poweroff runtime suspended ports (diff)
downloadlinux-3341b82368fb26dcf75f2c60320dc7442dac7075.tar.xz
linux-3341b82368fb26dcf75f2c60320dc7442dac7075.zip
ata: libata-core: Do not resume runtime suspended ports
The scsi disk driver does not resume disks that have been runtime suspended by the user. To be consistent with this behavior, do the same for ata ports and skip the PM request in ata_port_pm_resume() if the port was already runtime suspended. With this change, it is no longer necessary to force the PM state of the port to ACTIVE as the PM core code will take care of that when handling runtime resume. Signed-off-by: Damien Le Moal <dlemoal@kernel.org> Reviewed-by: Hannes Reinecke <hare@suse.de> Tested-by: Chia-Lin Kao (AceLan) <acelan.kao@canonical.com> Tested-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/ata')
-rw-r--r--drivers/ata/libata-core.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index c9db2da582b7..83613280928b 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -5230,10 +5230,8 @@ static void ata_port_resume(struct ata_port *ap, pm_message_t mesg,
static int ata_port_pm_resume(struct device *dev)
{
- ata_port_resume(to_ata_port(dev), PMSG_RESUME, true);
- pm_runtime_disable(dev);
- pm_runtime_set_active(dev);
- pm_runtime_enable(dev);
+ if (!pm_runtime_suspended(dev))
+ ata_port_resume(to_ata_port(dev), PMSG_RESUME, true);
return 0;
}