From patchwork Thu May 14 19:33:58 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jarod Wilson X-Patchwork-Id: 6409571 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 8F62E9F318 for ; Thu, 14 May 2015 19:34:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AE76920461 for ; Thu, 14 May 2015 19:34:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B9D5A20452 for ; Thu, 14 May 2015 19:34:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965168AbbENTeW (ORCPT ); Thu, 14 May 2015 15:34:22 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39456 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964998AbbENTeV (ORCPT ); Thu, 14 May 2015 15:34:21 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 299228E684; Thu, 14 May 2015 19:34:21 +0000 (UTC) Received: from hp-dl360pgen8-07.khw.lab.eng.bos.redhat.com (hp-dl360pgen8-07.khw.lab.eng.bos.redhat.com [10.16.184.47]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t4EJYKxC008972; Thu, 14 May 2015 15:34:20 -0400 From: Jarod Wilson To: linux-kernel@vger.kernel.org Cc: Jarod Wilson , Len Brown , "Rafael J. Wysocki" , Bjorn Helgaas , linux-acpi@vger.kernel.org, linux-pci@vger.kernel.org Subject: [PATCH] pci/hotplug: work-around for missing _RMV on HP ZBook G2 Date: Thu, 14 May 2015 15:33:58 -0400 Message-Id: <1431632038-39917-1-git-send-email-jarod@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The HP ZBook 15 and 17 Mobile Workstations, generation 2, up to and including at least BIOS revision 01.07, do not have an ACPI _RMV object associated with their expresscard slots, so acpi-based hotplug-capable slot detection fails. If we fall back to pcie-based detection, the systems work just fine, so this uses dmi matching to do that. With luck, a future BIOS will remedy this (I've let someone at HP know about the problem), but for now, just use this for all existing versions. Note: they *do* have a proper _RMV object for what I believe is their thunderbolt ports. Tested successfully on an HP ZBook 17 G2 and HP ZBook 15 G2. CC: Len Brown CC: "Rafael J. Wysocki" CC: Bjorn Helgaas CC: linux-acpi@vger.kernel.org CC: linux-pci@vger.kernel.org Signed-off-by: Jarod Wilson --- drivers/pci/hotplug/pciehp_acpi.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/drivers/pci/hotplug/pciehp_acpi.c b/drivers/pci/hotplug/pciehp_acpi.c index 93cc926..db38fb5 100644 --- a/drivers/pci/hotplug/pciehp_acpi.c +++ b/drivers/pci/hotplug/pciehp_acpi.c @@ -28,6 +28,7 @@ #include #include #include +#include #include "pciehp.h" #define PCIEHP_DETECT_PCIE (0) @@ -109,10 +110,40 @@ static struct pcie_port_service_driver __initdata dummy_driver = { .probe = dummy_probe, }; +static int __init set_slot_detection_mode_pcie(const struct dmi_system_id *d) +{ + info("%s lacks ACPI _RMV object for expresscard\n", d->ident); + return 1; +} + +static struct dmi_system_id __initdata missing_acpi_rmv[] = { + /* ZBook 17 through at least bios v01.07 */ + { + .callback = set_slot_detection_mode_pcie, + .ident = "HP ZBook 17 G2 Mobile Workstation", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), + DMI_MATCH(DMI_PRODUCT_NAME, "HP ZBook 17 G2"), + }, + }, + /* ZBook 15 through at least bios v01.07 */ + { + .callback = set_slot_detection_mode_pcie, + .ident = "HP ZBook 15 G2 Mobile Workstation", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), + DMI_MATCH(DMI_PRODUCT_NAME, "HP ZBook 15 G2"), + }, + }, + { .ident = NULL } +}; + static int __init select_detection_mode(void) { struct dummy_slot *slot, *tmp; + if (dmi_check_system(missing_acpi_rmv)) + return PCIEHP_DETECT_PCIE; if (pcie_port_service_register(&dummy_driver)) return PCIEHP_DETECT_ACPI; pcie_port_service_unregister(&dummy_driver); @@ -134,4 +165,6 @@ void __init pciehp_acpi_slot_detection_init(void) out: if (slot_detection_mode == PCIEHP_DETECT_ACPI) info("Using ACPI for slot detection.\n"); + else if (slot_detection_mode == PCIEHP_DETECT_PCIE) + info("Using PCIE-based slot detection.\n"); }