From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tejun Heo Subject: Re: [PATCH 2/6] DMI: Introduce dmi_first_match to make the interface more flexible Date: Wed, 01 Oct 2008 12:31:57 +0900 Message-ID: <48E2EF2D.4030006@gmail.com> References: <200808290002.55026.rjw@sisk.pl> <48D17BBE.5020807@garzik.org> <200809300006.24919.rjw@sisk.pl> <200809300013.22924.rjw@sisk.pl> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-2 Content-Transfer-Encoding: 7bit Return-path: Received: from ti-out-0910.google.com ([209.85.142.188]:36262 "EHLO ti-out-0910.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751696AbYJADdg (ORCPT ); Tue, 30 Sep 2008 23:33:36 -0400 Received: by ti-out-0910.google.com with SMTP id b6so108967tic.23 for ; Tue, 30 Sep 2008 20:33:34 -0700 (PDT) In-Reply-To: <200809300013.22924.rjw@sisk.pl> Sender: linux-ide-owner@vger.kernel.org List-Id: linux-ide@vger.kernel.org To: "Rafael J. Wysocki" Cc: Jeff Garzik , ACPI Devel Maling List , linux-ide@vger.kernel.org, Thomas Renninger , Robert Hancock , LKML , Frans Pop , Maciej Rutecki , Andrew Morton , Len Brown , Jean Delvare , ralf@linux-mips.org Rafael J. Wysocki wrote: > From: Rafael J. Wysocki > > DMI: Introduce dmi_first_match to make the interface more flexible > > 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. > > Signed-off-by: Rafael J. Wysocki Acked-by: Tejun Heo (cc'ing recent committers to dmi) If no one objects, I'd like to push this through libata-dev#upstream. Any objections? Thanks. -- tejun