File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -2323,6 +2323,18 @@ int ahci_port_resume(struct ata_port *ap)
2323
2323
EXPORT_SYMBOL_GPL (ahci_port_resume );
2324
2324
2325
2325
#ifdef CONFIG_PM
2326
+ static void ahci_handle_s2idle (struct ata_port * ap )
2327
+ {
2328
+ void __iomem * port_mmio = ahci_port_base (ap );
2329
+ u32 devslp ;
2330
+
2331
+ if (pm_suspend_via_firmware ())
2332
+ return ;
2333
+ devslp = readl (port_mmio + PORT_DEVSLP );
2334
+ if ((devslp & PORT_DEVSLP_ADSE ))
2335
+ ata_msleep (ap , devslp_idle_timeout );
2336
+ }
2337
+
2326
2338
static int ahci_port_suspend (struct ata_port * ap , pm_message_t mesg )
2327
2339
{
2328
2340
const char * emsg = NULL ;
@@ -2336,6 +2348,9 @@ static int ahci_port_suspend(struct ata_port *ap, pm_message_t mesg)
2336
2348
ata_port_freeze (ap );
2337
2349
}
2338
2350
2351
+ if (acpi_storage_d3 (ap -> host -> dev ))
2352
+ ahci_handle_s2idle (ap );
2353
+
2339
2354
ahci_rpm_put_port (ap );
2340
2355
return rc ;
2341
2356
}
You can’t perform that action at this time.
0 commit comments