From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: ACPI Devel Maling List <linux-acpi@vger.kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
"Luck, Tony" <tony.luck@intel.com>,
Toshi Kani <toshi.kani@hp.com>, Aaron Lu <aaron.lu@intel.com>
Subject: [PATCH 4/5] ACPI / scan: Use container hotplug profile for matching device objects
Date: Thu, 13 Jun 2013 01:26:08 +0200 [thread overview]
Message-ID: <2271890.fO4Egl60hq@vostro.rjw.lan> (raw)
In-Reply-To: <1417592.vuSG0cUIGo@vostro.rjw.lan>
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
On some systems (ia64 HP rx2600 in particular) the ACPI namespace
contains device objects with container compatibility IDs in addition
to some other hardware IDs. This means that those devices are
containers and if an ACPI scan handler without a hotplug profile is
attached to one of them, the container hotplug profile should be used
for that device.
Moreover, the container hotplug profile should be used for handling
bus check and device check notifications targeted at device handles
with matching scan handlers that don't provide hotplug profiles.
Modify the ACPI namespace scan code to ensure that the above will
happen.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
drivers/acpi/scan.c | 33 ++++++++++++++++++++++++++++-----
1 file changed, 28 insertions(+), 5 deletions(-)
Index: linux-pm/drivers/acpi/scan.c
===================================================================
--- linux-pm.orig/drivers/acpi/scan.c
+++ linux-pm/drivers/acpi/scan.c
@@ -1855,11 +1855,26 @@ void acpi_scan_hotplug_enabled(struct ac
mutex_unlock(&acpi_scan_lock);
}
+static struct acpi_hotplug_profile *acpi_container_hotplug(
+ struct acpi_device_pnp *pnp)
+{
+ if (acpi_container_scan_handler()) {
+ struct acpi_scan_handler *handler;
+ struct acpi_hardware_id *hwid;
+
+ handler = acpi_container_scan_handler();
+ list_for_each_entry(hwid, &pnp->ids, list)
+ if (acpi_scan_handler_matching(handler, hwid->id, NULL))
+ return handler->hotplug;
+ }
+ return NULL;
+}
+
static void acpi_scan_init_hotplug(acpi_handle handle, int type)
{
struct acpi_device_pnp pnp = {};
struct acpi_hardware_id *hwid;
- struct acpi_scan_handler *handler;
+ struct acpi_hotplug_profile *hotplug = NULL;
INIT_LIST_HEAD(&pnp.ids);
acpi_set_pnp_ids(handle, &pnp, type);
@@ -1872,14 +1887,20 @@ static void acpi_scan_init_hotplug(acpi_
* install the same notify handler routine twice for the same handle.
*/
list_for_each_entry(hwid, &pnp.ids, list) {
+ struct acpi_scan_handler *handler;
+
handler = acpi_scan_match_handler(hwid->id, NULL);
if (handler && handler->hotplug) {
- acpi_install_notify_handler(handle, ACPI_SYSTEM_NOTIFY,
- acpi_hotplug_notify_cb,
- handler->hotplug);
+ hotplug = handler->hotplug;
break;
}
}
+ if (!hotplug)
+ hotplug = acpi_container_hotplug(&pnp);
+
+ if (hotplug)
+ acpi_install_notify_handler(handle, ACPI_SYSTEM_NOTIFY,
+ acpi_hotplug_notify_cb, hotplug);
out:
acpi_free_pnp_ids(&pnp);
@@ -1948,7 +1969,9 @@ static int acpi_scan_attach_handler(stru
ret = handler->attach(device, devid);
if (ret > 0) {
device->handler = handler;
- device->hotplug = handler->hotplug;
+ device->hotplug = handler->hotplug ?
+ handler->hotplug :
+ acpi_container_hotplug(&device->pnp);
break;
} else if (ret < 0) {
break;
next prev parent reply other threads:[~2013-06-12 23:19 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-12 23:23 [PATCH 0/5] ACPI / scan: Make it possible to use the container hotplug with other scan handlers Rafael J. Wysocki
2013-06-12 23:23 ` [PATCH 1/5] ACPI / scan: Do not bind ACPI drivers to objects with " Rafael J. Wysocki
2013-06-12 23:24 ` [PATCH 2/5] ACPI / scan: Separate hotplug profiles from " Rafael J. Wysocki
2013-06-12 23:25 ` [PATCH 3/5] ACPI / scan: Add hotplug profile pointer to struct acpi_device Rafael J. Wysocki
2013-06-12 23:26 ` Rafael J. Wysocki [this message]
2013-06-12 23:26 ` [PATCH 5/5] ACPI / ia64 / sba_iommu: Use ACPI scan handler for discovery Rafael J. Wysocki
2013-06-13 21:28 ` [PATCH 0/5] ACPI / scan: Make it possible to use the container hotplug with other scan handlers Toshi Kani
2013-06-13 22:13 ` Rafael J. Wysocki
2013-06-13 22:23 ` Toshi Kani
2013-06-14 18:01 ` Luck, Tony
2013-06-14 22:23 ` Rafael J. Wysocki
2013-06-14 22:32 ` Tony Luck
2013-06-14 23:20 ` Rafael J. Wysocki
2013-06-19 17:37 ` Tony Luck
2013-06-19 22:24 ` Rafael J. Wysocki
2013-06-19 22:40 ` Tony Luck
2013-06-19 22:51 ` Rafael J. Wysocki
2013-06-19 23:22 ` Toshi Kani
2013-06-19 23:35 ` Rafael J. Wysocki
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=2271890.fO4Egl60hq@vostro.rjw.lan \
--to=rjw@sisk.pl \
--cc=aaron.lu@intel.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tony.luck@intel.com \
--cc=toshi.kani@hp.com \
/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
all inboxes | Powered by JetHome®