Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753910Ab0AEMaX (ORCPT ); Tue, 5 Jan 2010 07:30:23 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751396Ab0AEMaV (ORCPT ); Tue, 5 Jan 2010 07:30:21 -0500 Received: from poutre.nerim.net ([62.4.16.124]:64934 "EHLO poutre.nerim.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751179Ab0AEMaU (ORCPT ); Tue, 5 Jan 2010 07:30:20 -0500 Date: Tue, 5 Jan 2010 13:30:14 +0100 From: Jean Delvare To: Bjorn Helgaas , lenb@kernel.org Cc: djwong@us.ibm.com, Crane Cai , linux-kernel , linux-i2c@vger.kernel.org, linux-acpi@vger.kernel.org Subject: Re: [RESEND PATCH v2 1/2] ACPI: Quirk to make SMBus objects work on IBM machines with broken BIOSes Message-ID: <20100105133014.0d584b70@hyperion.delvare> In-Reply-To: <20091217150243.0d2749a2@hyperion.delvare> References: <20091021173733.GN26149@tux1.beaverton.ibm.com> <20091027183619.16b0b952@hyperion.delvare> <20091204170621.GA10356@tux1.beaverton.ibm.com> <200912041036.36686.bjorn.helgaas@hp.com> <20091204181103.GN10295@tux1.beaverton.ibm.com> <20091217150243.0d2749a2@hyperion.delvare> X-Mailer: Claws Mail 3.5.0 (GTK+ 2.14.4; i586-suse-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4210 Lines: 115 On Thu, 17 Dec 2009 15:02:43 +0100, Jean Delvare wrote: > On Fri, 4 Dec 2009 10:11:03 -0800, Darrick J. Wong wrote: > > On some old IBM workstations and desktop computers, the BIOS presents in the > > DSDT an SMBus object that is missing the HID identifier that the i2c-scmi > > driver looks for. Modify the ACPI device scan code to insert the missing HID > > if it finds an IBM system with such an object. This patch requires Crane Cai's > > update to i2c-scmi to work around incorrectly named methods within the SMBus > > control object. > > > > Affected machines: ThinkCenter M52, IntelliStation Z20/Z30. Note that the > > i2c-i801 driver no longer works on these machines because of ACPI resource > > conflicts. > > > > Signed-off-by: Darrick J. Wong > > --- > > > > drivers/acpi/scan.c | 38 ++++++++++++++++++++++++++++++++++++++ > > include/acpi/acpi_drivers.h | 2 ++ > > 2 files changed, 40 insertions(+), 0 deletions(-) > > > > > > diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c > > index 14a7481..5a24429 100644 > > --- a/drivers/acpi/scan.c > > +++ b/drivers/acpi/scan.c > > @@ -8,6 +8,7 @@ > > #include > > #include > > #include > > +#include > > > > #include > > > > @@ -1014,6 +1015,41 @@ static void acpi_add_id(struct acpi_device *device, const char *dev_id) > > list_add_tail(&id->list, &device->pnp.ids); > > } > > > > +/* > > + * Old IBM workstations have a DSDT bug wherein the SMBus object > > + * lacks the SMBUS01 HID and the methods do not have the necessary "_" > > + * prefix. Work around this. > > + */ > > +static int acpi_ibm_smbus_match(struct acpi_device *device) > > +{ > > + acpi_handle h_dummy; > > + struct acpi_buffer path = {ACPI_ALLOCATE_BUFFER, NULL}; > > + int result; > > + > > + if (!dmi_name_in_vendors("IBM")) > > + return -ENODEV; > > + > > + /* Look for SMBS object */ > > + result = acpi_get_name(device->handle, ACPI_SINGLE_NAME, &path); > > + if (result) > > + return result; > > + > > + if (strcmp("SMBS", path.pointer)) { > > + result = -ENODEV; > > + goto out; > > + } > > + > > + /* Does it have the necessary (but misnamed) methods? */ > > + result = -ENODEV; > > + if (ACPI_SUCCESS(acpi_get_handle(device->handle, "SBI", &h_dummy)) && > > + ACPI_SUCCESS(acpi_get_handle(device->handle, "SBR", &h_dummy)) && > > + ACPI_SUCCESS(acpi_get_handle(device->handle, "SBW", &h_dummy))) > > + result = 0; > > +out: > > + kfree(path.pointer); > > + return result; > > +} > > + > > static void acpi_device_set_id(struct acpi_device *device) > > { > > acpi_status status; > > @@ -1064,6 +1100,8 @@ static void acpi_device_set_id(struct acpi_device *device) > > acpi_add_id(device, ACPI_BAY_HID); > > else if (ACPI_SUCCESS(acpi_dock_match(device))) > > acpi_add_id(device, ACPI_DOCK_HID); > > + else if (!acpi_ibm_smbus_match(device)) > > + acpi_add_id(device, ACPI_SMBUS_IBM_HID); > > > > break; > > case ACPI_BUS_TYPE_POWER: > > diff --git a/include/acpi/acpi_drivers.h b/include/acpi/acpi_drivers.h > > index f4906f6..83a2960 100644 > > --- a/include/acpi/acpi_drivers.h > > +++ b/include/acpi/acpi_drivers.h > > @@ -65,6 +65,8 @@ > > #define ACPI_VIDEO_HID "LNXVIDEO" > > #define ACPI_BAY_HID "LNXIOBAY" > > #define ACPI_DOCK_HID "LNXDOCK" > > +/* Quirk for broken IBM BIOSes */ > > +#define ACPI_SMBUS_IBM_HID "SMBUSIBM" > > > > /* > > * For fixed hardware buttons, we fabricate acpi_devices with HID > > Bjorn, Len, can you please apply this quickly? The i2c-scmi side of the > changes is pending for weeks now, but I can't apply it as long as the > ACPI parts aren't in. Guys, I am sorry to insist but I still can't see this patch upstream while (I guess) rc3 is about to be released. Is there anything wrong with Darrick's patch? If not, please apply it and push it to Linus quickly. Thanks, -- Jean Delvare -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/