linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [Patch v1 1/3] ACPI: add callback prepare() into acpi_hotplug_handler
@ 2014-01-18  2:48 Jiang Liu
  2014-01-18  2:48 ` [Patch v1 2/3] ACPI, PCI: reuse ACPI hotplug framework to support PCI host bridge hotplug Jiang Liu
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Jiang Liu @ 2014-01-18  2:48 UTC (permalink / raw)
  To: Rafael J . Wysocki, Bjorn Helgaas, Toshi Kani, Yinghai Lu,
	Yijing Wang, Len Brown, Rafael J. Wysocki, Robert Moore, Lv Zheng
  Cc: Jiang Liu, linux-acpi, linux-pci, linux-kernel, devel

Add callback prepare() into acpi_hotplug_handler, which will get called
at the very beginning of ACPI hotplug event handler. The ACPI core will
ignore the event if prepare() returns NOTIFY_STOP.

Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com>
---
 drivers/acpi/scan.c     |    4 ++++
 include/acpi/acpi_bus.h |    1 +
 2 files changed, 5 insertions(+)

diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index fd39459..6b0f419 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -392,6 +392,10 @@ static void acpi_hotplug_notify_cb(acpi_handle handle, u32 type, void *data)
 	struct acpi_device *adev;
 	acpi_status status;
 
+	if (handler->prepare &&
+	    handler->prepare(handle, type, data) == NOTIFY_STOP)
+		return;
+
 	if (!handler->hotplug.enabled)
 		return acpi_hotplug_unsupported(handle, type);
 
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
index ddabed1..09a73bd 100644
--- a/include/acpi/acpi_bus.h
+++ b/include/acpi/acpi_bus.h
@@ -113,6 +113,7 @@ static inline struct acpi_hotplug_profile *to_acpi_hotplug_profile(
 struct acpi_scan_handler {
 	const struct acpi_device_id *ids;
 	struct list_head list_node;
+	int (*prepare)(acpi_handle handle, u32 type, void *context);
 	int (*attach)(struct acpi_device *dev, const struct acpi_device_id *id);
 	void (*detach)(struct acpi_device *dev);
 	struct acpi_hotplug_profile hotplug;
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-01-21 23:06 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-18  2:48 [Patch v1 1/3] ACPI: add callback prepare() into acpi_hotplug_handler Jiang Liu
2014-01-18  2:48 ` [Patch v1 2/3] ACPI, PCI: reuse ACPI hotplug framework to support PCI host bridge hotplug Jiang Liu
2014-01-18  3:23   ` Yinghai Lu
2014-01-18  3:48     ` Jiang Liu
2014-01-18  2:48 ` [Patch v1 3/3] ACPI: kill field 'ignore' in acpi_hotplug_profile Jiang Liu
2014-01-21 21:14 ` [Patch v1 1/3] ACPI: add callback prepare() into acpi_hotplug_handler Toshi Kani
2014-01-21 23:17   ` Rafael J. Wysocki
2014-01-21 23:06     ` Toshi Kani

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).