From patchwork Wed Sep 30 20:50:39 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 50761 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n8UKxGAJ001136 for ; Wed, 30 Sep 2009 20:59:16 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754209AbZI3U7K (ORCPT ); Wed, 30 Sep 2009 16:59:10 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754176AbZI3U7K (ORCPT ); Wed, 30 Sep 2009 16:59:10 -0400 Received: from g6t0185.atlanta.hp.com ([15.193.32.62]:31609 "EHLO g6t0185.atlanta.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754173AbZI3U7J (ORCPT ); Wed, 30 Sep 2009 16:59:09 -0400 X-Greylist: delayed 512 seconds by postgrey-1.27 at vger.kernel.org; Wed, 30 Sep 2009 16:59:09 EDT Received: from g5t0030.atlanta.hp.com (g5t0030.atlanta.hp.com [16.228.8.142]) by g6t0185.atlanta.hp.com (Postfix) with ESMTP id 4093E24C48; Wed, 30 Sep 2009 20:50:41 +0000 (UTC) Received: from ldl (linux.corp.hp.com [15.11.146.101]) by g5t0030.atlanta.hp.com (Postfix) with ESMTP id 6539F241ED; Wed, 30 Sep 2009 20:50:40 +0000 (UTC) Received: from localhost (ldl.fc.hp.com [127.0.0.1]) by ldl (Postfix) with ESMTP id 113BACF0018; Wed, 30 Sep 2009 14:50:40 -0600 (MDT) Received: from ldl ([127.0.0.1]) by localhost (ldl.fc.hp.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id sVvjsxc2fJ22; Wed, 30 Sep 2009 14:50:39 -0600 (MDT) Received: from eh.fc.hp.com (eh.fc.hp.com [15.11.146.105]) by ldl (Postfix) with ESMTP id F0A1BCF000A; Wed, 30 Sep 2009 14:50:39 -0600 (MDT) Received: from bob.kio (localhost [127.0.0.1]) by eh.fc.hp.com (Postfix) with ESMTP id ABFBD2613A; Wed, 30 Sep 2009 14:50:39 -0600 (MDT) Subject: [PATCH] PCIe hotplug: decline to manage slots under HP PCIe host bridge To: Jesse Barnes From: Bjorn Helgaas Cc: linux-pci@vger.kernel.org, Kenji Kaneshige Date: Wed, 30 Sep 2009 14:50:39 -0600 Message-ID: <20090930205039.26785.59632.stgit@bob.kio> User-Agent: StGit/0.14.3.386.gb02d MIME-Version: 1.0 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org diff --git a/drivers/pci/hotplug/acpi_pcihp.c b/drivers/pci/hotplug/acpi_pcihp.c index a73028e..24e6687 100644 --- a/drivers/pci/hotplug/acpi_pcihp.c +++ b/drivers/pci/hotplug/acpi_pcihp.c @@ -324,6 +324,26 @@ int pci_get_hp_params(struct pci_dev *dev, struct hotplug_params *hpp) } EXPORT_SYMBOL_GPL(pci_get_hp_params); +static int pciehp_quirk(struct pci_dev *pdev, u32 flags) +{ + if (!(flags & OSC_PCI_EXPRESS_NATIVE_HP_CONTROL)) + return 0; + + /* + * Some HP PCIe host bridges have defects in hotplug support. Firmware + * should decline to grant control, but it is also defective. + */ + while (pdev) { + if (pdev->vendor == PCI_VENDOR_ID_HP && + pdev->device == 0x403b) { + dev_info(&pdev->dev, "slot doesn't support PCIe native hotplug\n"); + return -ENODEV; + } + pdev = pdev->bus->parent->self; + } + return 0; +} + /** * acpi_get_hp_hw_control_from_firmware * @dev: the pci_dev of the bridge that has a hotplug controller @@ -360,7 +380,7 @@ int acpi_get_hp_hw_control_from_firmware(struct pci_dev *pdev, u32 flags) dbg("Trying to get hotplug control for %s\n", (char *)string.pointer); status = acpi_pci_osc_control_set(handle, flags); - if (ACPI_SUCCESS(status)) + if (ACPI_SUCCESS(status) && !pciehp_quirk(pdev, flags)) goto got_one; kfree(string.pointer); string = (struct acpi_buffer){ ACPI_ALLOCATE_BUFFER, NULL };