From patchwork Thu Apr 2 07:01:22 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yuji Shimada X-Patchwork-Id: 15870 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n3271VjH011355 for ; Thu, 2 Apr 2009 07:01:32 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751804AbZDBHBc (ORCPT ); Thu, 2 Apr 2009 03:01:32 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751539AbZDBHBc (ORCPT ); Thu, 2 Apr 2009 03:01:32 -0400 Received: from TYO202.gate.nec.co.jp ([202.32.8.206]:47683 "EHLO tyo202.gate.nec.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751240AbZDBHBb (ORCPT ); Thu, 2 Apr 2009 03:01:31 -0400 Received: from mailgate3.nec.co.jp ([10.7.69.195]) by tyo202.gate.nec.co.jp (8.13.8/8.13.4) with ESMTP id n3271O5B000999; Thu, 2 Apr 2009 16:01:24 +0900 (JST) Received: (from root@localhost) by mailgate3.nec.co.jp (8.11.7/3.7W-MAILGATE-NEC) id n3271Np12035; Thu, 2 Apr 2009 16:01:23 +0900 (JST) Received: from mail02.kamome.nec.co.jp (mail02.kamome.nec.co.jp [10.25.43.5]) by mailsv3.nec.co.jp (8.13.8/8.13.4) with ESMTP id n3271M3D015099; Thu, 2 Apr 2009 16:01:23 +0900 (JST) Received: from togyo.jp.nec.com ([10.26.220.4] [10.26.220.4]) by mail02.kamome.nec.co.jp with ESMTP id BT-MMP-297410; Thu, 2 Apr 2009 16:01:22 +0900 Received: from [10.58.40.47] ([10.58.40.47] [10.58.40.47]) by mail.jp.nec.com with ESMTP; Thu, 2 Apr 2009 16:01:22 +0900 Date: Thu, 02 Apr 2009 16:01:22 +0900 From: Yuji Shimada To: Alex Chiang , jbarnes@virtuousgeek.org, linux-pci@vger.kernel.org Subject: [PATCH] Setup disabled bridges even if buses are added. In-Reply-To: <20090320205615.12275.97971.stgit@bob.kio> References: <20090320204327.12275.43010.stgit@bob.kio> <20090320205615.12275.97971.stgit@bob.kio> Message-Id: <20090402155812.5C9A.27C06F64@necst.nec.co.jp> MIME-Version: 1.0 X-Mailer: Becky! ver. 2.50 [ja] Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org This patch setups disabled bridges even if buses have already been added. pci_assign_unassigned_resources is called after buses are added. pci_assign_unassigned_resources calls pci_bus_assign_resources. pci_bus_assign_resources calls pci_setup_bridge to configure BARs of bridges. Currently pci_setup_bridge returns immediately if the bus have already been added. So pci_assign_unassigned_resources can't configure BARs of bridge. The patch fixes the issue. On logical hot-add, we need to prevent the kernel from re-initializing bridges that have already been initialized. To achieve this, pci_setup_bridge returns immediately if the bridge have already been enabled. Thanks, --- Yuji Shimada Signed-off-by: Yuji Shimada -- 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 diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c index 334285a..ab27831 100644 --- a/drivers/pci/setup-bus.c +++ b/drivers/pci/setup-bus.c @@ -144,7 +144,7 @@ static void pci_setup_bridge(struct pci_bus *bus) struct pci_bus_region region; u32 l, bu, lu, io_upper16; - if (!pci_is_root_bus(bus) && bus->is_added) + if (bus->self == NULL || atomic_read(&bus->self->enable_cnt) != 0) return; dev_info(&bridge->dev, "PCI bridge, secondary bus %04x:%02x\n",