linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiang Liu <liuj97@gmail.com>
To: Bjorn Helgaas <bhelgaas@google.com>, "Rafael J . Wysocki" <rjw@sisk.pl>
Cc: Jiang Liu <jiang.liu@huawei.com>, Yinghai Lu <yinghai@kernel.org>,
	Yijing Wang <wangyijing@huawei.com>, Jiang Liu <liuj97@gmail.com>,
	linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	ACPI Devel Maling List <linux-acpi@vger.kernel.org>,
	Toshi Kani <toshi.kani@hp.com>,
	Myron Stowe <myron.stowe@redhat.com>
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	[thread overview]
Message-ID: <1365781470-32379-16-git-send-email-jiang.liu@huawei.com> (raw)
In-Reply-To: <1365781470-32379-1-git-send-email-jiang.liu@huawei.com>

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 <jiang.liu@huawei.com>
---
 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);
-- 
1.7.9.5


  parent reply	other threads:[~2013-04-12 15:44 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-12 15:44 [PATCH v9 00/16] Get rid of the ACPI PCI subdriver mechanism Jiang Liu
2013-04-12 15:44 ` [PATCH v9 01/16] PCI: do not check is_added flag in pci_remove_bus() Jiang Liu
2013-04-12 15:44 ` [PATCH v9 02/16] pci: clean up usages of pci_bus->is_added Jiang Liu
2013-04-12 15:44 ` [PATCH v9 03/16] PCI/acpiphp: use list_for_each_entry_safe() in acpiphp_sanitize_bus() Jiang Liu
2013-04-12 15:44 ` [PATCH v9 04/16] PCI/acpiphp: don't rely on function 0 in disable_device() Jiang Liu
2013-04-12 15:44 ` [PATCH v9 05/16] ACPI/acpiphp: replace local macros with standard ACPI macros Jiang Liu
2013-04-12 15:44 ` [PATCH v9 06/16] PCI: introduce platform dependent hooks for creating/destroying PCI busses Jiang Liu
2013-04-12 15:44 ` [PATCH v9 07/16] PCI, ACPI: prepare stub functions to handle ACPI PCI (hotplug) slots Jiang Liu
2013-04-12 15:44 ` [PATCH v9 08/16] PCI, IA64: implement pcibios_{add|remove}_bus() hooks Jiang Liu
2013-04-12 15:44 ` [PATCH v9 09/16] PCI, x86: " Jiang Liu
2013-04-16 20:27   ` David Rientjes
2013-04-16 22:35     ` Bjorn Helgaas
2013-04-17 20:49       ` David Rientjes
2013-04-17  0:00     ` Jiang Liu
2013-04-12 15:44 ` [PATCH v9 10/16] PCI, ACPI: handle PCI slot devices when creating/destroying PCI busses Jiang Liu
2013-04-12 15:44 ` [PATCH v9 11/16] PCI/acpiphp: convert acpiphp as a builtin driver Jiang Liu
2013-04-12 15:44 ` [PATCH v9 12/16] PCI/acpiphp: do not use ACPI PCI subdriver mechanism Jiang Liu
2013-04-12 15:44 ` [PATCH v9 13/16] PCI/acpiphp: use normal list to simplify implementation Jiang Liu
2013-04-12 15:44 ` [PATCH v9 14/16] PCI/acpiphp: protect acpiphp data structures from concurrent updating Jiang Liu
2013-04-12 15:44 ` Jiang Liu [this message]
2013-04-12 15:44 ` [PATCH v9 16/16] PCI, ACPI: remove support of ACPI PCI subdrivers Jiang Liu
2013-04-12 22:17 ` [PATCH v9 00/16] Get rid of the ACPI PCI subdriver mechanism Bjorn Helgaas
2013-04-13  4:03   ` Jiang Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1365781470-32379-16-git-send-email-jiang.liu@huawei.com \
    --to=liuj97@gmail.com \
    --cc=bhelgaas@google.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jiang.liu@huawei.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=myron.stowe@redhat.com \
    --cc=rjw@sisk.pl \
    --cc=toshi.kani@hp.com \
    --cc=wangyijing@huawei.com \
    --cc=yinghai@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).