From: Rajesh Shah <rajesh.shah@intel.com>
To: linux-ia64@vger.kernel.org
Subject: Re: [Pcihpd-discuss] [PATCH] Convert acpiphp to use generic resource code
Date: Fri, 21 Jan 2005 02:54:09 +0000 [thread overview]
Message-ID: <20050120185409.A24471@unix-os.sc.intel.com> (raw)
In-Reply-To: <20050119183853.C12618@unix-os.sc.intel.com>
On Wed, Jan 19, 2005 at 06:51:20PM +0000, Matthew Wilcox wrote:
>
> static void remove_bridge(acpi_handle handle)
> {
> - /* No-op for now .. */
> + struct list_head *list, *tmp;
> + struct acpiphp_bridge *bridge;
> + struct acpiphp_slot *slot;
> + acpi_status status;
> +
> + bridge = acpiphp_handle_to_bridge(handle);
> + if (!bridge) {
> + err("Could not find bridge for handle %p\n", handle);
> + return;
> + }
A root bridge may not have directly attached hotpluggable
slots under it. Instead, it may have p2p bridges with slots
under it. In this case, we need to clean up the p2p bridges
and slots properly too. Patch below applies on top of the
original patch, and fixes this problem. Without this, acpiphp
leaves behind notify handlers on module unload, and subsequent
module load attempts don't work properly too. Patch was tested
on an ia64 Tiger4 box.
Signed-off-by: Rajesh Shah <rajesh.shah@intel.com>
---
linux-2.6.11-rc1-mm2-t2-rshah1/drivers/pci/hotplug/acpiphp_glue.c | 34 +++++++---
1 files changed, 26 insertions(+), 8 deletions(-)
diff -puN drivers/pci/hotplug/acpiphp_glue.c~unload_cleanup drivers/pci/hotplug/acpiphp_glue.c
--- linux-2.6.11-rc1-mm2-t2/drivers/pci/hotplug/acpiphp_glue.c~unload_cleanup 2005-01-20 17:18:19.839605127 -0800
+++ linux-2.6.11-rc1-mm2-t2-rshah1/drivers/pci/hotplug/acpiphp_glue.c 2005-01-20 17:57:35.978248139 -0800
@@ -486,18 +486,12 @@ static struct acpiphp_bridge *acpiphp_ha
return NULL;
}
-static void remove_bridge(acpi_handle handle)
+static void cleanup_bridge(struct acpiphp_bridge *bridge)
{
struct list_head *list, *tmp;
- struct acpiphp_bridge *bridge;
struct acpiphp_slot *slot;
acpi_status status;
-
- bridge = acpiphp_handle_to_bridge(handle);
- if (!bridge) {
- err("Could not find bridge for handle %p\n", handle);
- return;
- }
+ acpi_handle handle = bridge->handle;
status = acpi_remove_notify_handler(handle, ACPI_SYSTEM_NOTIFY,
handle_hotplug_event_bridge);
@@ -528,6 +522,30 @@ static void remove_bridge(acpi_handle ha
kfree(bridge);
}
+static acpi_status
+cleanup_p2p_bridge(acpi_handle handle, u32 lvl, void *context, void **rv)
+{
+ struct acpiphp_bridge *bridge;
+
+ if (!(bridge = acpiphp_handle_to_bridge(handle)))
+ return AE_OK;
+ cleanup_bridge(bridge);
+ return AE_OK;
+}
+
+static void remove_bridge(acpi_handle handle)
+{
+ struct acpiphp_bridge *bridge;
+
+ bridge = acpiphp_handle_to_bridge(handle);
+ if (bridge) {
+ cleanup_bridge(bridge);
+ } else {
+ /* clean-up p2p bridges under this host bridge */
+ acpi_walk_namespace(ACPI_TYPE_DEVICE, handle,
+ (u32)1, cleanup_p2p_bridge, NULL, NULL);
+ }
+}
static int power_on_slot(struct acpiphp_slot *slot)
{
_
next prev parent reply other threads:[~2005-01-21 2:54 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-01-20 2:38 [Pcihpd-discuss] [PATCH] Convert acpiphp to use generic resource code Rajesh Shah
2005-01-20 2:53 ` Li, Shaohua
2005-01-21 2:54 ` Rajesh Shah [this message]
2005-02-03 19:31 ` Rajesh Shah
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=20050120185409.A24471@unix-os.sc.intel.com \
--to=rajesh.shah@intel.com \
--cc=linux-ia64@vger.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