From patchwork Tue Aug 7 16:11:00 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiang Liu X-Patchwork-Id: 175702 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 844E32C00A3 for ; Wed, 8 Aug 2012 02:21:48 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755781Ab2HGQVc (ORCPT ); Tue, 7 Aug 2012 12:21:32 -0400 Received: from mail-pb0-f46.google.com ([209.85.160.46]:51364 "EHLO mail-pb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755777Ab2HGQVa (ORCPT ); Tue, 7 Aug 2012 12:21:30 -0400 Received: by mail-pb0-f46.google.com with SMTP id rr13so4529963pbb.19 for ; Tue, 07 Aug 2012 09:21:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=ctkzQ4HuqaZ5OrLzzuy9bTy35nl5wif24gIRkOARd6A=; b=LaELJSQKv3dDurQR7AmQzrEBvrl9rnb/b0WjjHMHdsD9yBNfbLGydtCyfv7xNX2uvI mxNBGCOqPadX290p338W8SGx3KZDO2LFldv9atOgplvLVs765/D+3Z6mP3LNL9ybcL5E mbwKRn6pBSghZPlYCN29Ea79jB0N+AsHGNodNe/S4iGAFU6SM7Px8/TmIFqsy5iY0+Jv LHruuJvcEv6hbyzrARwTnT2wRXuiflYEIc8/L8siKjEX/LuULK1xQVT17lrqSdd235cx xcxbWhgvruEt+JQK02iFlM7V3tpa6JBbkZk4B3+OYt4K+OyynAozkFM4L7RsJ1WMrFc0 0/sw== Received: by 10.68.241.228 with SMTP id wl4mr28857318pbc.51.1344356490207; Tue, 07 Aug 2012 09:21:30 -0700 (PDT) Received: from localhost.localdomain ([58.250.81.2]) by mx.google.com with ESMTPS id pt2sm11429362pbb.58.2012.08.07.09.21.22 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 07 Aug 2012 09:21:29 -0700 (PDT) From: Jiang Liu To: Bjorn Helgaas , Don Dutile , Yinghai Lu , Greg KH , Kenji Kaneshige Cc: Jiang Liu , Taku Izumi , "Rafael J . Wysocki" , Yijing Wang , Xinwei Hu , linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org Subject: [RFC PATCH v1 20/22] PCI/IA64: enable PCI bus lock mechanism for IA64 platforms Date: Wed, 8 Aug 2012 00:11:00 +0800 Message-Id: <1344355862-2726-21-git-send-email-jiang.liu@huawei.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1344355862-2726-1-git-send-email-jiang.liu@huawei.com> References: <1344355862-2726-1-git-send-email-jiang.liu@huawei.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org From: Jiang Liu This patch turns on PCI bus lock mechanism for IA64 platforms. Signed-off-by: Jiang Liu --- arch/ia64/pci/pci.c | 2 ++ arch/ia64/sn/kernel/io_init.c | 1 + arch/ia64/sn/pci/tioca_provider.c | 4 +++- drivers/pci/Kconfig | 2 +- 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/arch/ia64/pci/pci.c b/arch/ia64/pci/pci.c index d173a88..259a2e1 100644 --- a/arch/ia64/pci/pci.c +++ b/arch/ia64/pci/pci.c @@ -387,6 +387,8 @@ pci_acpi_scan_root(struct acpi_pci_root *root) } pci_scan_child_bus(pbus); + pci_bus_unlock(pbus); + return pbus; out3: diff --git a/arch/ia64/sn/kernel/io_init.c b/arch/ia64/sn/kernel/io_init.c index 238e2c5..67e8ce9 100644 --- a/arch/ia64/sn/kernel/io_init.c +++ b/arch/ia64/sn/kernel/io_init.c @@ -329,6 +329,7 @@ sn_pci_controller_fixup(int segment, int busnum, struct pci_bus *bus) goto error_return; /* error, or bus already scanned */ bus->sysdata = controller; + pci_bus_unlock(bus); return; diff --git a/arch/ia64/sn/pci/tioca_provider.c b/arch/ia64/sn/pci/tioca_provider.c index a70b11f..79f8226 100644 --- a/arch/ia64/sn/pci/tioca_provider.c +++ b/arch/ia64/sn/pci/tioca_provider.c @@ -624,7 +624,7 @@ tioca_bus_fixup(struct pcibus_bussoft *prom_bussoft, struct pci_controller *cont nasid_to_cnodeid(tioca_common->ca_closest_nasid); tioca_common->ca_kernel_private = (u64) tioca_kern; - bus = pci_find_bus(tioca_common->ca_common.bs_persist_segment, + bus = pci_get_bus(tioca_common->ca_common.bs_persist_segment, tioca_common->ca_common.bs_persist_busnum); BUG_ON(!bus); tioca_kern->ca_devices = &bus->devices; @@ -634,6 +634,7 @@ tioca_bus_fixup(struct pcibus_bussoft *prom_bussoft, struct pci_controller *cont if (tioca_gart_init(tioca_kern) < 0) { kfree(tioca_kern); kfree(tioca_common); + pci_bus_put(bus); return NULL; } @@ -654,6 +655,7 @@ tioca_bus_fixup(struct pcibus_bussoft *prom_bussoft, struct pci_controller *cont /* Setup locality information */ controller->node = tioca_kern->ca_closest_node; + pci_bus_put(bus); return tioca_common; } diff --git a/drivers/pci/Kconfig b/drivers/pci/Kconfig index 1bbe924..5a796c0 100644 --- a/drivers/pci/Kconfig +++ b/drivers/pci/Kconfig @@ -122,4 +122,4 @@ config PCI_LABEL select NLS config PCI_BUS_LOCK - def_bool y if X86 + def_bool y if (X86 || IA64)