From patchwork Fri Apr 12 15:44:29 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiang Liu X-Patchwork-Id: 2436751 Return-Path: X-Original-To: patchwork-linux-acpi@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 B070DDFE82 for ; Fri, 12 Apr 2013 15:48:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757747Ab3DLPsI (ORCPT ); Fri, 12 Apr 2013 11:48:08 -0400 Received: from mail-pb0-f53.google.com ([209.85.160.53]:43719 "EHLO mail-pb0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757675Ab3DLPsE (ORCPT ); Fri, 12 Apr 2013 11:48:04 -0400 Received: by mail-pb0-f53.google.com with SMTP id un15so1484402pbc.12 for ; Fri, 12 Apr 2013 08:48:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=RG5dRBBv6yjBItSXtpQs7I9Lxlkv8eZvz8fd2522g6k=; b=sYvCCzXsXnPYlXiF5AEStXGuouxABmKLXWA5ekpjb6KhTWXWSQ6cZbFlEuoJwJwSIb 6kxyjN/KNDEU2t0BaA8bquk810rFTORlhxNLaZwNsqqJJguMSU2Tt0t2w09N5ZK1sHn4 o3LIPMLZEEqQEH6l0iYLzhLvbvrCbSd/9Kew3xHP07VJo3fLqvEyLqXQvZ8NAnKLAspo UsFcT7Fd9N7MNicE31bzxSTfPtOnF4B2S4YgRXi4WmIpgiqYZ3jmGmDnETex5rAcvbtz mwJujE8NynmsZ+4SCQskJ/gsbeiojQqoMRRBdhlz7M+9jWToRTBP7q0gA45kP66hMJIs 3tbg== X-Received: by 10.68.223.167 with SMTP id qv7mr4154451pbc.68.1365781683438; Fri, 12 Apr 2013 08:48:03 -0700 (PDT) Received: from localhost.localdomain ([114.250.74.212]) by mx.google.com with ESMTPS id wz9sm9048741pbc.5.2013.04.12.08.47.56 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 12 Apr 2013 08:48:02 -0700 (PDT) From: Jiang Liu To: Bjorn Helgaas , "Rafael J . Wysocki" Cc: Jiang Liu , Yinghai Lu , Yijing Wang , Jiang Liu , linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, Greg Kroah-Hartman , ACPI Devel Maling List , Toshi Kani , Myron Stowe Subject: [PATCH v9 15/16] PCI/acpiphp: introduce a kernel option to disable the acpiphp driver Date: Fri, 12 Apr 2013 23:44:29 +0800 Message-Id: <1365781470-32379-16-git-send-email-jiang.liu@huawei.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1365781470-32379-1-git-send-email-jiang.liu@huawei.com> References: <1365781470-32379-1-git-send-email-jiang.liu@huawei.com> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org Now the acpiphp driver has been converted as builtin, so introduce a kernel boot option "acpiphp.disable" to disable the acpiphp driver on boot. Signed-off-by: Jiang Liu --- Documentation/kernel-parameters.txt | 3 +++ drivers/pci/hotplug/acpiphp.h | 1 + drivers/pci/hotplug/acpiphp_core.c | 6 +++++- drivers/pci/hotplug/acpiphp_glue.c | 6 ++++++ 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index 4609e81..38baa0d 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt @@ -290,6 +290,9 @@ bytes respectively. Such letter suffixes can also be entirely omitted. no: ACPI OperationRegions are not marked as reserved, no further checks are performed. + acpiphp.disable + Disable the PCI acpiphp hotplug driver. + add_efi_memmap [EFI; X86] Include EFI memory map in kernel's map of available physical RAM. diff --git a/drivers/pci/hotplug/acpiphp.h b/drivers/pci/hotplug/acpiphp.h index 7577bb3..6a319f4 100644 --- a/drivers/pci/hotplug/acpiphp.h +++ b/drivers/pci/hotplug/acpiphp.h @@ -188,5 +188,6 @@ extern u8 acpiphp_get_adapter_status (struct acpiphp_slot *slot); /* variables */ extern bool acpiphp_debug; +extern bool acpiphp_disabled; #endif /* _ACPIPHP_H */ diff --git a/drivers/pci/hotplug/acpiphp_core.c b/drivers/pci/hotplug/acpiphp_core.c index 80d777c..cdbd983 100644 --- a/drivers/pci/hotplug/acpiphp_core.c +++ b/drivers/pci/hotplug/acpiphp_core.c @@ -49,6 +49,7 @@ #define SLOT_NAME_SIZE 21 /* {_SUN} */ bool acpiphp_debug; +bool acpiphp_disabled; /* local variables */ static struct acpiphp_attention_info *attention_info; @@ -61,7 +62,9 @@ MODULE_AUTHOR(DRIVER_AUTHOR); MODULE_DESCRIPTION(DRIVER_DESC); MODULE_LICENSE("GPL"); MODULE_PARM_DESC(debug, "Debugging mode enabled or not"); +MODULE_PARM_DESC(disable, "disable acpiphp driver"); module_param_named(debug, acpiphp_debug, bool, 0644); +module_param_named(disable, acpiphp_disabled, bool, 0444); /* export the attention callback registration methods */ EXPORT_SYMBOL_GPL(acpiphp_register_attention); @@ -354,5 +357,6 @@ void acpiphp_unregister_hotplug_slot(struct acpiphp_slot *acpiphp_slot) void __init acpiphp_init(void) { - info(DRIVER_DESC " version: " DRIVER_VERSION "\n"); + info(DRIVER_DESC " version: " DRIVER_VERSION "%s\n", + acpiphp_disabled ? ", disabled by user" : ""); } diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c index 896d680..96fed19 100644 --- a/drivers/pci/hotplug/acpiphp_glue.c +++ b/drivers/pci/hotplug/acpiphp_glue.c @@ -1139,6 +1139,9 @@ void acpiphp_enumerate_slots(struct pci_bus *bus, acpi_handle handle) acpi_handle dummy_handle; struct acpiphp_bridge *bridge; + if (acpiphp_disabled) + return; + if (detect_ejectable_slots(handle) <= 0) return; @@ -1177,6 +1180,9 @@ void acpiphp_remove_slots(struct pci_bus *bus) { struct acpiphp_bridge *bridge, *tmp; + if (acpiphp_disabled) + return; + list_for_each_entry_safe(bridge, tmp, &bridge_list, list) if (bridge->pci_bus == bus) { cleanup_bridge(bridge);