Re: [PATCH 2/3] ACPI,PCI: Notify acpi_pci_drivers when hot-plugging PCI root bridges

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2012-3-22 1:04, Yinghai Lu wrote:
On Wed, Mar 21, 2012 at 9:22 AM, Jiang Liu<liuj97@xxxxxxxxx>  wrote:
From: Jiang Liu<liuj97@xxxxxxxxx>

When hot-plugging PCI root bridge, acpi_pci_drivers' add()/remove()
methods should be invoked to notify registered drivers.

Signed-off-by: Jiang Liu<jiang.liu@xxxxxxxxxx>
---
  drivers/acpi/pci_root.c |   10 ++++++++++
  1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c
index c2d2b7b..ff73357 100644
--- a/drivers/acpi/pci_root.c
+++ b/drivers/acpi/pci_root.c
@@ -445,6 +445,7 @@ static int __devinit acpi_pci_root_add(struct acpi_device *device)
        acpi_status status;
        int result;
        struct acpi_pci_root *root;
+       struct acpi_pci_driver *driver;
        acpi_handle handle;
        struct acpi_device *child;
        u32 flags, base_flags;
@@ -612,6 +613,10 @@ static int __devinit acpi_pci_root_add(struct acpi_device *device)
        if (device->wakeup.flags.run_wake)
                device_set_run_wake(root->bus->bridge, true);

+       list_for_each_entry(driver,&acpi_pci_drivers, node)
+               if (driver->add)
+                       driver->add(device->handle);
+
        return 0;

if those calling is with acpi_pci_root_start() instead of acpi_pci_root_add()

Do you still need patches 3?
I think it's still needed. If driver->add is called by
acpi_pci_root_add(), then acpi_pci_root_add() needs to
acquire the lock too.


Yinghai

.



--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux