From patchwork Thu Dec 13 15:31:46 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kirill A . Shutemov" X-Patchwork-Id: 1875291 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 3FA43DF2EE for ; Thu, 13 Dec 2012 15:31:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753707Ab2LMPbR (ORCPT ); Thu, 13 Dec 2012 10:31:17 -0500 Received: from mga02.intel.com ([134.134.136.20]:15922 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753597Ab2LMPbQ (ORCPT ); Thu, 13 Dec 2012 10:31:16 -0500 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 13 Dec 2012 07:31:15 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.84,274,1355126400"; d="scan'208";a="233501350" Received: from blue.fi.intel.com ([10.237.72.156]) by orsmga001.jf.intel.com with ESMTP; 13 Dec 2012 07:31:12 -0800 Received: by blue.fi.intel.com (Postfix, from userid 1000) id 1B86AE0080; Thu, 13 Dec 2012 17:31:52 +0200 (EET) From: "Kirill A. Shutemov" To: Greg KH Cc: Miles J Penner , John Ronciak , Mika Westerberg , Tushar N Dave , "Kirill A. Shutemov" , "Kirill A. Shutemov" , Bjorn Helgaas , Rusty Russell , Mauro Carvalho Chehab , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/3] PCI Hotplug: workaround for Thunderbolt on Acer Aspire S5 Date: Thu, 13 Dec 2012 17:31:46 +0200 Message-Id: <1355412708-20046-2-git-send-email-kirill.shutemov@linux.intel.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1355412708-20046-1-git-send-email-kirill.shutemov@linux.intel.com> References: <1355412708-20046-1-git-send-email-kirill.shutemov@linux.intel.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org From: "Kirill A. Shutemov" Correct ACPI PCI hotplug imeplementation should have _RMV method in a PCI slot (device under pci bridge). In Acer Aspire S5 case we have it deeper in hierarchy: Device (RP05) { // ... Device (HRUP) { // ... Device (HRDN) { // ... Device (EPUP) { // ... Method (_RMV, 0, NotSerialized) // _RMV: Removal Status { Return (One) } } } } } Signed-off-by: Kirill A. Shutemov --- drivers/pci/hotplug/acpi_pcihp.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/pci/hotplug/acpi_pcihp.c b/drivers/pci/hotplug/acpi_pcihp.c index 2a47e82..d92ebfb 100644 --- a/drivers/pci/hotplug/acpi_pcihp.c +++ b/drivers/pci/hotplug/acpi_pcihp.c @@ -422,6 +422,19 @@ static int pcihp_is_ejectable(acpi_handle handle) status = acpi_evaluate_integer(handle, "_RMV", NULL, &removable); if (ACPI_SUCCESS(status) && removable) return 1; + + /* + * Workaround for Thunderbolt implementation on Acer Aspire S5. + * + * Correct ACPI PCI hotplug imeplementation has _RMV method in a PCI + * slot (device under pci bridge). In Acer Aspire S5 case we have it + * deeper in hierarchy. + */ + status = acpi_evaluate_integer(handle, "HRDN.EPUP._RMV", NULL, + &removable); + if (ACPI_SUCCESS(status) && removable) + return 1; + return 0; }