From patchwork Wed Jul 4 08:08:49 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Taku Izumi X-Patchwork-Id: 1154851 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 2FBEC40ABE for ; Wed, 4 Jul 2012 08:09:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756450Ab2GDIJC (ORCPT ); Wed, 4 Jul 2012 04:09:02 -0400 Received: from fgwmail5.fujitsu.co.jp ([192.51.44.35]:43196 "EHLO fgwmail5.fujitsu.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933773Ab2GDII5 (ORCPT ); Wed, 4 Jul 2012 04:08:57 -0400 Received: from m3.gw.fujitsu.co.jp (unknown [10.0.50.73]) by fgwmail5.fujitsu.co.jp (Postfix) with ESMTP id 032743EE0AE for ; Wed, 4 Jul 2012 17:08:57 +0900 (JST) Received: from smail (m3 [127.0.0.1]) by outgoing.m3.gw.fujitsu.co.jp (Postfix) with ESMTP id D7EC545DEB3 for ; Wed, 4 Jul 2012 17:08:56 +0900 (JST) Received: from s3.gw.fujitsu.co.jp (s3.gw.fujitsu.co.jp [10.0.50.93]) by m3.gw.fujitsu.co.jp (Postfix) with ESMTP id BE1D145DEAD for ; Wed, 4 Jul 2012 17:08:56 +0900 (JST) Received: from s3.gw.fujitsu.co.jp (localhost.localdomain [127.0.0.1]) by s3.gw.fujitsu.co.jp (Postfix) with ESMTP id B03D71DB8041 for ; Wed, 4 Jul 2012 17:08:56 +0900 (JST) Received: from m005.s.css.fujitsu.com (m005.s.css.fujitsu.com [10.23.4.35]) by s3.gw.fujitsu.co.jp (Postfix) with ESMTP id 63FDF1DB803C for ; Wed, 4 Jul 2012 17:08:56 +0900 (JST) Received: from m005.css.fujitsu.com (m005 [127.0.0.1]) by m005.s.css.fujitsu.com (Postfix) with ESMTP id 4BB852E0756; Wed, 4 Jul 2012 17:08:56 +0900 (JST) Received: from DEUCALION (unknown [10.124.101.32]) by m005.s.css.fujitsu.com (Postfix) with SMTP id 1C5B72E075B; Wed, 4 Jul 2012 17:08:56 +0900 (JST) X-SecurityPolicyCheck: OK by SHieldMailChecker v1.7.4 Date: Wed, 4 Jul 2012 17:08:49 +0900 From: Taku Izumi To: Taku Izumi Cc: linux-pci@vger.kernel.org, Bjorn Helgaas , Kenji Kaneshige , Yinghai Lu , Jiang Liu Subject: [PATCH 4/7] ACPI, PCI: Notify acpi_pci_drivers when hot-plugging PCI root bridges Message-Id: <20120704170849.d7cbeb76.izumi.taku@jp.fujitsu.com> In-Reply-To: <20120704170345.07cd0ad7.izumi.taku@jp.fujitsu.com> References: <20120704170345.07cd0ad7.izumi.taku@jp.fujitsu.com> X-Mailer: Sylpheed 3.1.1 (GTK+ 2.10.14; i686-pc-mingw32) Mime-Version: 1.0 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org From: Jiang Liu ACPI, PCI: Notify acpi_pci_drivers when hot-plugging PCI root bridges When hot-plugging PCI root bridge, acpi_pci_drivers' add()/remove() methods should be invoked to notify registered drivers. -v2: Move add calling to acpi_pci_root_start by Yinghai Signed-off-by: Jiang Liu Signed-off-by: Yinghai Lu --- drivers/acpi/pci_root.c | 11 +++++++++++ 1 file changed, 11 insertions(+) -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: linux/drivers/acpi/pci_root.c =================================================================== --- linux.orig/drivers/acpi/pci_root.c 2012-07-04 09:55:45.697815965 +0900 +++ linux/drivers/acpi/pci_root.c 2012-07-04 09:55:49.169772504 +0900 @@ -626,14 +626,25 @@ end: static int acpi_pci_root_start(struct acpi_device *device) { struct acpi_pci_root *root = acpi_driver_data(device); + struct acpi_pci_driver *driver; + + list_for_each_entry(driver, &acpi_pci_drivers, node) + if (driver->add) + driver->add(device->handle); pci_bus_add_devices(root->bus); + return 0; } static int acpi_pci_root_remove(struct acpi_device *device, int type) { struct acpi_pci_root *root = acpi_driver_data(device); + struct acpi_pci_driver *driver; + + list_for_each_entry(driver, &acpi_pci_drivers, node) + if (driver->remove) + driver->remove(root->device->handle); device_set_run_wake(root->bus->bridge, false); pci_acpi_remove_bus_pm_notifier(device);