Skip to content

SATA: Blacklist systems that spin off disks during ACPI power off

Rafael J. Wysocki linux-acpi linux-ide lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest6 patches 19 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6Hibernation: Introduce new system state for the last phase of hibernationinclude/linux/kernel.h kernel/power/disk.c+3 -19 replies
1/6Hibernation: Introduce system_entering_hibernationinclude/linux/suspend.h kernel/power/disk.c+11 -08 replies
2/6DMI: Introduce dmi_first_match to make the interface more flexibledrivers/firmware/dmi_scan.c include/linux/dmi.h+53 -161 reply
2/6DMI: Introduce dmi_first_match to make the interface more flexibledrivers/firmware/dmi_scan.c include/linux/dmi.h+53 -160 replies
3/6SATA: Blacklisting of systems that spin off disks during ACPI power offdrivers/ata/libata-scsi.c include/linux/libata.h+18 -32 replies
3/6SATA: Blacklisting of systems that spin off disks during ACPI power off (rev. 2)drivers/ata/libata-scsi.c include/linux/libata.h+19 -30 replies
4/6SATA AHCI: Blacklist system that spins off disks during ACPI power offdrivers/ata/ahci.c+32 -00 replies
4/6SATA AHCI: Blacklist system that spins off disks during ACPI power offdrivers/ata/ahci.c+32 -00 replies
5/6SATA Sil: Blacklist system that spins off disks during ACPI power offdrivers/ata/sata_sil.c+35 -10 replies
5/6SATA Sil: Blacklist system that spins off disks during ACPI power offdrivers/ata/sata_sil.c+35 -10 replies
6/6SATA PIIX: Blacklist system that spins off disks during ACPI power offdrivers/ata/ata_piix.c+34 -00 replies
6/6SATA PIIX: Blacklist system that spins off disks during ACPI power offdrivers/ata/ata_piix.c+34 -00 replies

Reviews trailers per patch

10 of 12 patches have a Reviewed-by or Acked-by.

PatchTejun Heo
1/6
1/6
2/6A-b
2/6A-b
3/6A-b
3/6A-b
4/6A-b
4/6A-b
5/6A-b
5/6A-b
6/6A-b
6/6A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/6] SATA: Blacklist systems that spin off disks during ACPI power off
Quoted 48 lines · Jeff Garzik
Quoted 39 lines · Rafael J. Wysocki
Quoted 38 lines · Jeff Garzik
Quoted 37 lines · Tejun Heo
Quoted 33 lines · Rafael J. Wysocki

SATA: Blacklist systems that spin off disks during ACPI power off

Some notebooks from HP have the problem that their BIOSes attempt to spin down hard drives before entering ACPI system states S4 and S5. This leads to a yo-yo effect during system power-off shutdown and the last phase of hibernation when the disk is first spun down by the kernel and then almost immediately turned on and off by the BIOS. This, in turn, may result in shortening the disk's life times.

To prevent this from happening we can blacklist the affected systems using DMI information. However, only the on-board controlles should be blacklisted and their PCI slot numbers can be used for this purpose. Unfortunately the existing interface for checking DMI information of the system is not very convenient for this purpose, because to use it, we would have to define special callback functions or create a separate struct dmi_system_id table for each blacklisted system.

To overcome this difficulty introduce a new function dmi_first_match() returning a pointer to the first entry in an array of struct dmi_system_id elements that matches the system DMI information. Then, we can use this pointer to access the entry's .driver_data field containing the additional information, such as the PCI slot number, allowing us to do the desired blacklisting.

Introduce a new libata flag ATA_FLAG_NO_POWEROFF_SPINDOWN that, if set, will prevent disks from being spun off during system power off and hibernation (to handle the hibernation case we need a new system state SYSTEM_HIBERNATE_ENTER that can be checked against by libata, in analogy with SYSTEM_POWER_OFF). Use dmi_first_match() to set this flag for some systems affected by the problem described above (HP nx6325, HP nx6310, HP 2510p).

Quoted 1 line

libata part looks good to me but I think it would be better to separate out DMI changes into a separate patch.

Quoted 7 lines
Quoted 1 line

Did these changes ever get separated out?

I only have the 'combo' patch if that's what you're asking about. [The latest version is at http://bugzilla.kernel.org/attachment.cgi?id=17702&action=view]

Still, I can easily split the patch, although in that case the reason for the DMI changes won't be very clear without a reference to the SATA changes IMO.

Quoted 8 lines

That's the nature of every single API change -- you have the change, and then you have the users.

Respectfully, please split up the patch as requested, into DMI subsystem and ata subsystem pieces.

Re-reviewing the patch, I would even think that you should split out the kernel/power/disk and linux/kernel.h changes as well.

Here you go (sorry for the delay). I have also split the SATA changes so that the driver patches are droppable individually if there are problems with them (not anticipated).

Thanks,
Rafael

---
SATA: Blacklist systems that spin off disks during ACPI power off

Some notebooks from HP have the problem that their BIOSes attempt to spin down hard drives before entering ACPI system states S4 and S5. This leads to a yo-yo effect during system power-off shutdown and the last phase of hibernation when the disk is first spun down by the kernel and then almost immediately turned on and off by the BIOS. This, in turn, may result in shortening the disk's life times.

To prevent this from happening we can blacklist the affected systems using DMI information, which is implemented by the following series of patches.