[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAE9FiQVFc9VVfWZpEfjPeGvo5pby3BQNzDei3VTXdoR048_SPg@mail.gmail.com>
Date: Tue, 16 Oct 2012 22:18:31 -0700
From: Yinghai Lu <yinghai@...nel.org>
To: Tang Chen <tangchen@...fujitsu.com>
Cc: jiang.liu@...wei.com, bhelgaas@...gle.com, lenb@...nel.org,
izumi.taku@...fujitsu.com, isimatu.yasuaki@...fujitsu.com,
linux-acpi@...r.kernel.org, linux-pci@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/1] Update acpi_root_bridge_list in container hotplug path.
On Tue, Oct 16, 2012 at 8:25 PM, Tang Chen <tangchen@...fujitsu.com> wrote:
> Hi Yinghai,
>
> List acpi_root_bridge_list is only updated when kernel is booting,
> or in _handle_hotplug_event_root() when handling ACPI_NOTIFY_DEVICE_CHECK
> event on a pci root bridge device. But when we hotplug a container, which
> contains one or more pci root bridges, container_notify_cb() will be
> called but not _handle_hotplug_event_root(). As a result,
> acpi_root_bridge_list won't be updated.
>
> This patch makes the following api and struct public in pci_root_hp.h,
> struct acpi_root_bridge;
> add_acpi_root_bridge()
> remove_acpi_root_bridge()
> acpi_root_handle_to_bridge()
> and call add_acpi_root_bridge() in acpi_bus_check_add() and call
> remove_acpi_root_bridge() in acpi_bus_remove().
>
> This patch is based on Lu Yinghai's git tree branch for-pci-split-pci-root-hp-2.
>
> Signed-off-by: Tang Chen <tangchen@...fujitsu.com>
> ---
> diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
> index 6ca2eaf..c258064 100644
> --- a/drivers/acpi/scan.c
> +++ b/drivers/acpi/scan.c
> @@ -12,6 +12,7 @@
> #include <linux/dmi.h>
>
> #include <acpi/acpi_drivers.h>
> +#include <acpi/pci_root_hp.h>
>
> #include "internal.h"
>
> @@ -1265,8 +1266,17 @@ int acpi_bus_remove(struct acpi_device *dev, int rmdevice)
> dev->removal_type = ACPI_BUS_REMOVAL_EJECT;
> device_release_driver(&dev->dev);
>
> - if (rmdevice)
> + if (rmdevice) {
> + if (acpi_is_root_bridge(dev->handle)) {
> + struct acpi_root_bridge *bridge;
> +
> + bridge = acpi_root_handle_to_bridge(dev->handle);
> + if (bridge)
> + remove_acpi_root_bridge(bridge);
> + }
> +
> acpi_device_unregister(dev, ACPI_BUS_REMOVAL_EJECT);
> + }
no, we don't need that.
after closely looking, it seems we can dump acpi_root_bridge.
please check if attached patch could work with container path.
Thanks
Yinghai
Download attachment "kill_remove_acpi_root_bridge.patch" of type "application/octet-stream" (5666 bytes)
Powered by blists - more mailing lists