linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Jeff Garzik <jeff@garzik.org>, Tejun Heo <htejun@gmail.com>,
	ACPI Devel Maling List <linux-acpi@vger.kernel.org>,
	linux-ide@vger.kernel.org, Thomas Renninger <trenn@suse.de>,
	Robert Hancock <hancockr@shaw.ca>,
	LKML <linux-kernel@vger.kernel.org>,
	Frans Pop <elendil@planet.nl>,
	Maciej Rutecki <maciej.rutecki@gmail.com>
Subject: [PATCH 6/6] SATA PIIX: Blacklist system that spins off disks during ACPI power off
Date: Fri, 3 Oct 2008 23:58:20 +0200	[thread overview]
Message-ID: <200810032358.21833.rjw@sisk.pl> (raw)
In-Reply-To: <200810032348.59709.rjw@sisk.pl>

From: Rafael J. Wysocki <rjw@sisk.pl>

SATA PIIX: Blacklist system that spins 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.

Blacklist HP 2510p that uses the ata_piix driver.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Tejun Heo <htejun@gmail.com>
---
 drivers/ata/ata_piix.c |   34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)

Index: linux-2.6/drivers/ata/ata_piix.c
===================================================================
--- linux-2.6.orig/drivers/ata/ata_piix.c
+++ linux-2.6/drivers/ata/ata_piix.c
@@ -1449,6 +1449,32 @@ static void piix_iocfg_bit18_quirk(struc
 	}
 }
 
+static bool piix_broken_system_poweroff(struct pci_dev *pdev)
+{
+	static const struct dmi_system_id broken_systems[] = {
+		{
+			.ident = "HP Compaq 2510p",
+			.matches = {
+				DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
+				DMI_MATCH(DMI_PRODUCT_NAME, "HP Compaq 2510p"),
+			},
+			/* PCI slot number of the controller */
+			.driver_data = (void *)0x1FUL,
+		},
+
+		{ }	/* terminate list */
+	};
+	const struct dmi_system_id *dmi = dmi_first_match(broken_systems);
+
+	if (dmi) {
+		unsigned long slot = (unsigned long)dmi->driver_data;
+		/* apply the quirk only to on-board controllers */
+		return slot == PCI_SLOT(pdev->devfn);
+	}
+
+	return false;
+}
+
 /**
  *	piix_init_one - Register PIIX ATA PCI device with kernel services
  *	@pdev: PCI device to register
@@ -1484,6 +1510,14 @@ static int __devinit piix_init_one(struc
 	if (!in_module_init)
 		return -ENODEV;
 
+	if (piix_broken_system_poweroff(pdev)) {
+		piix_port_info[ent->driver_data].flags |=
+				ATA_FLAG_NO_POWEROFF_SPINDOWN |
+					ATA_FLAG_NO_HIBERNATE_SPINDOWN;
+		dev_info(&pdev->dev, "quirky BIOS, skipping spindown "
+				"on poweroff and hibernation\n");
+	}
+
 	port_info[0] = piix_port_info[ent->driver_data];
 	port_info[1] = piix_port_info[ent->driver_data];
 


  parent reply	other threads:[~2008-10-03 21:55 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-28 22:02 Regression: SATA disk double spin-off during hibernation on hp nx6325 Rafael J. Wysocki
2008-08-29 10:03 ` Tejun Heo
2008-08-29 10:41   ` Rafael J. Wysocki
2008-08-29 10:42     ` Tejun Heo
2008-09-06 17:23       ` [PATCH] SATA: Blacklist systems that spin off disks during ACPI power off Rafael J. Wysocki
2008-09-08 11:38         ` Tejun Heo
2008-09-14  2:21           ` Jeff Garzik
2008-09-15  0:00             ` Rafael J. Wysocki
2008-09-17 21:50               ` Jeff Garzik
2008-09-29 22:06                 ` [PATCH 0/6] " Rafael J. Wysocki
2008-09-29 22:10                   ` [PATCH 1/6] Hibernation: Introduce new system state for the last phase of hibernation Rafael J. Wysocki
2008-10-01  3:32                     ` Tejun Heo
2008-10-01 11:36                       ` Rafael J. Wysocki
2008-10-03  8:35                     ` Andrew Morton
2008-10-03 11:27                       ` Rafael J. Wysocki
2008-10-03 12:43                         ` Andrew Morton
2008-10-03 15:03                           ` Rafael J. Wysocki
2008-10-03 21:48                             ` [PATCH 0/6] SATA: Blacklist systems that spin off disks during ACPI power off (rev. 2) Rafael J. Wysocki
2008-10-03 21:51                               ` [PATCH 1/6] Hibernation: Introduce system_entering_hibernation Rafael J. Wysocki
2008-10-03 23:27                                 ` Alan Cox
2008-10-04 10:13                                   ` Rafael J. Wysocki
2008-10-04 21:50                                     ` Alan Cox
2008-10-04 21:52                                       ` Tejun Heo
2008-10-04 22:30                                         ` Rafael J. Wysocki
2008-10-04 22:27                                           ` Tejun Heo
2008-10-04  7:02                                 ` Tejun Heo
2008-10-04 10:14                                   ` Rafael J. Wysocki
2008-10-03 21:52                               ` [PATCH 2/6] DMI: Introduce dmi_first_match to make the interface more flexible Rafael J. Wysocki
2008-10-03 21:57                               ` [PATCH 3/6] SATA: Blacklisting of systems that spin off disks during ACPI power off (rev. 2) Rafael J. Wysocki
2008-10-03 21:57                               ` [PATCH 4/6] SATA AHCI: Blacklist system that spins off disks during ACPI power off Rafael J. Wysocki
2008-10-03 21:58                               ` [PATCH 5/6] SATA Sil: " Rafael J. Wysocki
2008-10-03 21:58                               ` Rafael J. Wysocki [this message]
2008-10-03 12:49                         ` [PATCH 1/6] Hibernation: Introduce new system state for the last phase of hibernation Arjan van de Ven
2008-10-03 15:05                           ` Rafael J. Wysocki
2008-09-29 22:13                   ` [PATCH 2/6] DMI: Introduce dmi_first_match to make the interface more flexible Rafael J. Wysocki
2008-10-01  3:31                     ` Tejun Heo
2008-09-29 22:14                   ` [PATCH 3/6] SATA: Blacklisting of systems that spin off disks during ACPI power off Rafael J. Wysocki
2008-10-01  3:34                     ` Tejun Heo
2008-10-01 11:36                       ` Rafael J. Wysocki
2008-09-29 22:15                   ` [PATCH 4/6] SATA AHCI: Blacklist system that spins " Rafael J. Wysocki
2008-09-29 22:16                   ` [PATCH 5/6] SATA Sil: " Rafael J. Wysocki
2008-09-29 22:18                   ` [PATCH 6/6] SATA PIIX: " Rafael J. Wysocki
     [not found] ` <200808291245.27436.elendil@planet.nl>
2008-08-29 10:57   ` Regression: SATA disk double spin-off during hibernation on hp nx6325 Rafael J. Wysocki
2008-08-29 11:30     ` Frans Pop
2008-09-04 14:05       ` Rafael J. Wysocki
2008-09-05 22:25         ` Frans Pop
2008-09-05 23:18           ` Rafael J. Wysocki
2008-09-06  0:09             ` Frans Pop
2008-09-06 11:06               ` Rafael J. Wysocki
  -- strict thread matches above, loose matches on Subject: below --
2008-11-04  6:27 [git patches] libata hibernation fixes Jeff Garzik
2009-01-18 20:39 ` Jeff Garzik
2009-01-19 19:53   ` [PATCH 0/6] Hibernation/poweroff quirks (was: Re: [git patches] libata hibernation fixes) Rafael J. Wysocki
2009-01-19 19:59     ` [PATCH 6/6] SATA PIIX: Blacklist system that spins off disks during ACPI power off Rafael J. Wysocki
2009-01-19 22:08       ` Frans Pop
2009-01-20  7:33       ` Maciej Rutecki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200810032358.21833.rjw@sisk.pl \
    --to=rjw@sisk.pl \
    --cc=akpm@linux-foundation.org \
    --cc=elendil@planet.nl \
    --cc=hancockr@shaw.ca \
    --cc=htejun@gmail.com \
    --cc=jeff@garzik.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maciej.rutecki@gmail.com \
    --cc=trenn@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).