From patchwork Fri Aug 10 06:13:44 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Taku Izumi X-Patchwork-Id: 1304181 Return-Path: X-Original-To: patchwork-linux-acpi@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 CAB313FCF2 for ; Fri, 10 Aug 2012 06:13:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754436Ab2HJGNu (ORCPT ); Fri, 10 Aug 2012 02:13:50 -0400 Received: from fgwmail5.fujitsu.co.jp ([192.51.44.35]:40382 "EHLO fgwmail5.fujitsu.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754347Ab2HJGNt (ORCPT ); Fri, 10 Aug 2012 02:13:49 -0400 Received: from m1.gw.fujitsu.co.jp (unknown [10.0.50.71]) by fgwmail5.fujitsu.co.jp (Postfix) with ESMTP id 1468F3EE081; Fri, 10 Aug 2012 15:13:49 +0900 (JST) Received: from smail (m1 [127.0.0.1]) by outgoing.m1.gw.fujitsu.co.jp (Postfix) with ESMTP id F128D45DE58; Fri, 10 Aug 2012 15:13:48 +0900 (JST) Received: from s1.gw.fujitsu.co.jp (s1.gw.fujitsu.co.jp [10.0.50.91]) by m1.gw.fujitsu.co.jp (Postfix) with ESMTP id DA45D45DE55; Fri, 10 Aug 2012 15:13:48 +0900 (JST) Received: from s1.gw.fujitsu.co.jp (localhost.localdomain [127.0.0.1]) by s1.gw.fujitsu.co.jp (Postfix) with ESMTP id CCBD31DB804F; Fri, 10 Aug 2012 15:13:48 +0900 (JST) Received: from m0001.s.css.fujitsu.com (m0001.s.css.fujitsu.com [10.23.4.186]) by s1.gw.fujitsu.co.jp (Postfix) with ESMTP id 8A5371DB8048; Fri, 10 Aug 2012 15:13:48 +0900 (JST) Received: from m0001.css.fujitsu.com (m0001 [127.0.0.1]) by m0001.s.css.fujitsu.com (Postfix) with ESMTP id 7331510149F; Fri, 10 Aug 2012 15:13:48 +0900 (JST) Received: from DEUCALION (unknown [10.124.101.32]) by m0001.s.css.fujitsu.com (Postfix) with SMTP id 4F992101902; Fri, 10 Aug 2012 15:13:48 +0900 (JST) X-SecurityPolicyCheck: OK by SHieldMailChecker v1.7.4 Date: Fri, 10 Aug 2012 15:13:44 +0900 From: Taku Izumi To: Taku Izumi Cc: linux-pci@vger.kernel.org, bhelgaas@google.com, linux-acpi@vger.kernel.org, kaneshige.kenji@jp.fujitsu.com, yinghai@kernel.org, jiang.liu@huawei.com Subject: [PATCH 4/7][RESEND] ACPI, PCI: Notify acpi_pci_drivers when hot-plugging PCI root bridges Message-Id: <20120810151344.23304526.izumi.taku@jp.fujitsu.com> In-Reply-To: <20120810150955.e4ab3c7f.izumi.taku@jp.fujitsu.com> References: <20120810150955.e4ab3c7f.izumi.taku@jp.fujitsu.com> X-Mailer: Sylpheed 3.1.1 (GTK+ 2.10.14; i686-pc-mingw32) Mime-Version: 1.0 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@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 Signed-off-by: Taku Izumi --- drivers/acpi/pci_root.c | 11 +++++++++++ 1 file changed, 11 insertions(+) -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: Bjorn-next-0808/drivers/acpi/pci_root.c =================================================================== --- Bjorn-next-0808.orig/drivers/acpi/pci_root.c +++ Bjorn-next-0808/drivers/acpi/pci_root.c @@ -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);