From patchwork Sun May 26 15:53:17 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiang Liu X-Patchwork-Id: 2616481 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by patchwork2.kernel.org (Postfix) with ESMTP id CE80CDFB79 for ; Sun, 26 May 2013 16:00:05 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UgdMX-0003Ef-Iw; Sun, 26 May 2013 16:00:01 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UgdMU-0007XA-By; Sun, 26 May 2013 15:59:58 +0000 Received: from mail-pd0-f182.google.com ([209.85.192.182]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UgdMR-0007Vd-5D for linux-arm-kernel@lists.infradead.org; Sun, 26 May 2013 15:59:56 +0000 Received: by mail-pd0-f182.google.com with SMTP id g10so5778929pdj.27 for ; Sun, 26 May 2013 08:59:33 -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=1xbtp26G8kV3Hnp9C6kO2jXvrZSFBoo3qTqL5E7XC5c=; b=cvHL4VwkkCY2apJjVdJpOENAznYDD3Amf/hSKDKddgsQG01m6kF9SNlvwLBegTBFrT e+cc2bdu5kB/GykXe+uIjLZVwscXVTdrSGlokla4wdJG1B2zcXtMY73PBXJZNGspaJIr zmoLx9iynYfK0dY8rUCn7+J+EfbIJ3EHGfWV5TqBJLfND95kBl3PAg8SSpNmU5cUW3NF 3M0deQ2rOFrO1vWEoZAv2Ozi+SjXXbqph6GOVoU9VZV9PFKmu/l7cQzD+/7EseklA4VH mMXplK+wXRSFuN1Xg+nytJf4i0VhbmKyG5V4ZIqblxe382N5vOnYweRa1trDcAB5TkaF cnIQ== X-Received: by 10.68.232.42 with SMTP id tl10mr25835447pbc.72.1369583973218; Sun, 26 May 2013 08:59:33 -0700 (PDT) Received: from localhost.localdomain ([111.196.197.202]) by mx.google.com with ESMTPSA id ze11sm26603189pab.22.2013.05.26.08.59.26 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 26 May 2013 08:59:32 -0700 (PDT) From: Jiang Liu To: Bjorn Helgaas , Yinghai Lu Subject: [PATCH v3, part2 20/20] PCI, ARM: use hotplug-safe PCI bus iterators to walk PCI buses Date: Sun, 26 May 2013 23:53:17 +0800 Message-Id: <1369583597-3801-21-git-send-email-jiang.liu@huawei.com> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1369583597-3801-1-git-send-email-jiang.liu@huawei.com> References: <1369583597-3801-1-git-send-email-jiang.liu@huawei.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130526_115955_299189_191074AD X-CRM114-Status: GOOD ( 14.13 ) X-Spam-Score: -1.8 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.8 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [209.85.192.182 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (liuj97[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (liuj97[at]gmail.com) -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: Toshi Kani , Jiang Liu , Greg Kroah-Hartman , Thierry Reding , linux-kernel@vger.kernel.org, Rob Herring , "Rafael J . Wysocki" , Yijing Wang , linux-pci@vger.kernel.org, Gu Zheng , Russell King , Myron Stowe , linux-arm-kernel@lists.infradead.org, Jiang Liu X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Enhance ARM architecture specific code to use new hotplug-safe PCI bus iterators to walk PCI buses. Change pcibios_report_status implementation so that it doesn't access pci_root_buses global list. The pci_root_buses list will be scheduled to be removed. Signed-off-by: Jiang Liu Cc: Russell King Cc: Thierry Reding Cc: Bjorn Helgaas Cc: Greg Kroah-Hartman Cc: Rob Herring Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org --- arch/arm/kernel/bios32.c | 13 +------------ arch/arm/mach-footbridge/dc21285.c | 12 +++++++++++- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/arch/arm/kernel/bios32.c b/arch/arm/kernel/bios32.c index b2ed73c..50ebbe8 100644 --- a/arch/arm/kernel/bios32.c +++ b/arch/arm/kernel/bios32.c @@ -22,7 +22,7 @@ static int debug_pci; * We can't use pci_find_device() here since we are * called from interrupt context. */ -static void pcibios_bus_report_status(struct pci_bus *bus, u_int status_mask, int warn) +void pcibios_bus_report_status(struct pci_bus *bus, u_int status_mask, int warn) { struct pci_dev *dev; @@ -55,17 +55,6 @@ static void pcibios_bus_report_status(struct pci_bus *bus, u_int status_mask, in pcibios_bus_report_status(dev->subordinate, status_mask, warn); } -void pcibios_report_status(u_int status_mask, int warn) -{ - struct list_head *l; - - list_for_each(l, &pci_root_buses) { - struct pci_bus *bus = pci_bus_b(l); - - pcibios_bus_report_status(bus, status_mask, warn); - } -} - /* * We don't use this to fix the device, but initialisation of it. * It's not the correct use for this, but it works. diff --git a/arch/arm/mach-footbridge/dc21285.c b/arch/arm/mach-footbridge/dc21285.c index a7cd2cf..a0f1d01 100644 --- a/arch/arm/mach-footbridge/dc21285.c +++ b/arch/arm/mach-footbridge/dc21285.c @@ -35,7 +35,16 @@ PCI_STATUS_PARITY) << 16) extern int setup_arm_irq(int, struct irqaction *); -extern void pcibios_report_status(u_int status_mask, int warn); +extern void pcibios_report_bus_status(struct pci_bus *bus, u_int status_mask, + int warn); + +static struct pci_bus *dc21285_root_bus; + +static void pcibios_report_status(u_int status_mask, int warn) +{ + if (dc21285_root_bus) + pcibios_report_bus_status(dc21285_root_bus, status_mask, warn); +} static unsigned long dc21285_base_address(struct pci_bus *bus, unsigned int devfn) @@ -376,5 +385,6 @@ void __init dc21285_preinit(void) void __init dc21285_postinit(void) { + dc21285_root_bus = pci_get_next_root_bus(NULL); register_isa_ports(DC21285_PCI_MEM, DC21285_PCI_IO, 0); }