linux/drivers/ata
Niklas Cassel a38719e315 ata: libata: avoid superfluous disk spin down + spin up during hibernation
A user reported that commit aa3998dbeb ("ata: libata-scsi: Disable scsi
device manage_system_start_stop") introduced a spin down + immediate spin
up of the disk both when entering and when resuming from hibernation.
This behavior was not there before, and causes an increased latency both
when entering and when resuming from hibernation.

Hibernation is done by three consecutive PM events, in the following order:
1) PM_EVENT_FREEZE
2) PM_EVENT_THAW
3) PM_EVENT_HIBERNATE

Commit aa3998dbeb ("ata: libata-scsi: Disable scsi device
manage_system_start_stop") modified ata_eh_handle_port_suspend() to call
ata_dev_power_set_standby() (which spins down the disk), for both event
PM_EVENT_FREEZE and event PM_EVENT_HIBERNATE.

Documentation/driver-api/pm/devices.rst, section "Entering Hibernation",
explicitly mentions that PM_EVENT_FREEZE does not have to be put the device
in a low-power state, and actually recommends not doing so. Thus, let's not
spin down the disk on PM_EVENT_FREEZE. (The disk will instead be spun down
during the subsequent PM_EVENT_HIBERNATE event.)

This way, PM_EVENT_FREEZE will behave as it did before commit aa3998dbeb
("ata: libata-scsi: Disable scsi device manage_system_start_stop"), while
PM_EVENT_HIBERNATE will continue to spin down the disk.

This will avoid the superfluous spin down + spin up when entering and
resuming from hibernation, while still making sure that the disk is spun
down before actually entering hibernation.

Cc: stable@vger.kernel.org # v6.6+
Fixes: aa3998dbeb ("ata: libata-scsi: Disable scsi device manage_system_start_stop")
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Link: https://lore.kernel.org/r/20241008135843.1266244-2-cassel@kernel.org
Signed-off-by: Niklas Cassel <cassel@kernel.org>
2024-10-09 16:21:19 +02:00
..
pata_parport
acard-ahci.c
ahci.c
ahci.h
ahci_brcm.c ata: ahci_brcm: Use devm_platform_ioremap_resource_byname() helper function 2024-08-28 10:32:21 +09:00
ahci_ceva.c
ahci_da850.c
ahci_dm816.c
ahci_dwc.c
ahci_imx.c ata: ahci_imx: Fix error code in probe() 2024-08-15 13:44:33 +02:00
ahci_mtk.c
ahci_mvebu.c
ahci_octeon.c
ahci_platform.c
ahci_qoriq.c
ahci_seattle.c
ahci_st.c
ahci_sunxi.c
ahci_tegra.c
ahci_xgene.c
ata_generic.c
ata_piix.c
Kconfig
libahci.c
libahci_platform.c
libata-acpi.c
libata-core.c move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
libata-eh.c ata: libata: avoid superfluous disk spin down + spin up during hibernation 2024-10-09 16:21:19 +02:00
libata-pata-timings.c
libata-pmp.c ata: libata: Move sector_buf from struct ata_port to struct ata_device 2024-09-07 10:16:55 +09:00
libata-sata.c move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
libata-scsi.c move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
libata-sff.c
libata-trace.c
libata-transport.c ata: libata: Fix W=1 compilation warning 2024-09-07 11:02:52 +09:00
libata-transport.h
libata-zpodd.c ata: libata: Move sector_buf from struct ata_port to struct ata_device 2024-09-07 10:16:55 +09:00
libata.h ata: libata: Improve CDL resource management 2024-09-07 10:16:56 +09:00
Makefile
pata_acpi.c
pata_ali.c
pata_amd.c
pata_arasan_cf.c
pata_artop.c
pata_atiixp.c
pata_atp867x.c
pata_buddha.c
pata_cmd64x.c
pata_cmd640.c
pata_cs5520.c
pata_cs5530.c
pata_cs5535.c
pata_cs5536.c
pata_cypress.c
pata_efar.c
pata_ep93xx.c soc: convert ep93xx to devicetree 2024-09-26 12:00:25 -07:00
pata_falcon.c
pata_ftide010.c ata: pata_ftide010: Enable module autoloading 2024-09-02 08:05:36 +09:00
pata_gayle.c
pata_hpt3x2n.c
pata_hpt3x3.c
pata_hpt37x.c
pata_hpt366.c
pata_icside.c
pata_imx.c
pata_isapnp.c
pata_it821x.c
pata_it8213.c
pata_ixp4xx_cf.c ata: pata_ixp4xx: Enable module autoloading 2024-09-02 08:06:04 +09:00
pata_jmicron.c
pata_legacy.c
pata_macio.c ata: pata_macio: Use WARN instead of BUG 2024-08-21 14:33:23 +09:00
pata_marvell.c
pata_mpc52xx.c
pata_mpiix.c
pata_netcell.c
pata_ninja32.c
pata_ns87410.c
pata_ns87415.c
pata_octeon_cf.c
pata_of_platform.c
pata_oldpiix.c
pata_opti.c
pata_optidma.c
pata_pcmcia.c
pata_pdc202xx_old.c
pata_pdc2027x.c
pata_piccolo.c
pata_platform.c
pata_pxa.c
pata_radisys.c
pata_rb532_cf.c
pata_rdc.c
pata_rz1000.c
pata_sc1200.c
pata_sch.c
pata_serverworks.c
pata_sil680.c
pata_sis.c
pata_sl82c105.c
pata_triflex.c
pata_via.c
pdc_adma.c
sata_dwc_460ex.c
sata_fsl.c
sata_gemini.c ata: sata_gemini: Enable module autoloading 2024-09-02 08:06:23 +09:00
sata_gemini.h
sata_highbank.c
sata_inic162x.c
sata_mv.c
sata_nv.c
sata_promise.c
sata_promise.h
sata_qstor.c
sata_rcar.c
sata_sil.c
sata_sil24.c
sata_sis.c
sata_svw.c
sata_sx4.c
sata_uli.c
sata_via.c
sata_vsc.c
sis.h