From patchwork Sat Jun 24 01:50:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Palmer Dabbelt X-Patchwork-Id: 9807539 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5BFAB6032A for ; Sat, 24 Jun 2017 02:03:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 49A5C28804 for ; Sat, 24 Jun 2017 02:03:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3D4E028806; Sat, 24 Jun 2017 02:03:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A27C128804 for ; Sat, 24 Jun 2017 02:03:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755149AbdFXCDD (ORCPT ); Fri, 23 Jun 2017 22:03:03 -0400 Received: from mail-pg0-f68.google.com ([74.125.83.68]:35918 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754812AbdFXCB4 (ORCPT ); Fri, 23 Jun 2017 22:01:56 -0400 Received: by mail-pg0-f68.google.com with SMTP id e187so8069097pgc.3 for ; Fri, 23 Jun 2017 19:01:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dabbelt-com.20150623.gappssmtp.com; s=20150623; h=from:to:to:to:to:to:cc:cc:cc:cc:cc:cc:cc:subject:date:message-id :in-reply-to:references; bh=2JYXKY2J7ArobP2AYP+Udjxk681TPcTDEJY2aPcGkBY=; b=B/PtFAOvcTih27+6YXbbV45uzANeq8wNiH2qxJ6jgm8m/9JMGhYdD5d2Z6KDygVQDj sTFwkJD4J9Ows+d1eoM2xW+cH4dy5ZJzi7Qs8T+TIiXcdzrtOrKGUcWfrQChwhOqhh2z j8JEAAU32L9Dp4oHie1AR394qCgMU3B1zTnMWtbVB7Gci1EW62ubjIB2Wj5YwyG5ZHkp NNiLfTwN067qFOVCkhqGGs2jb2u97H/B6YBNM31UO1JOrPEbBsjnaWsNJueRX5A1uC75 g6E8FcTe7iNttvPuV8ffYPsVzgn/bHf6DR5I6hAYtcZUaYkAT7tSCSFaT4F5SAPOB7eG OhEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:to:to:to:to:cc:cc:cc:cc:cc:cc:cc:subject :date:message-id:in-reply-to:references; bh=2JYXKY2J7ArobP2AYP+Udjxk681TPcTDEJY2aPcGkBY=; b=XAqBVSgC0JbeXj5CJJDJojY1CK0DDQ+czYrcG3IRUIfQ1SAv2EWkGbJ/oxx/17nSWK ExvUbxtoPg+AYyBmHKYeCsGfOcEKUdpHn74F/XXfKeW6irk0BzZjtXmZBL0mzYBHRoZZ ZMGS50pRc2VaP1h5qQdaCQlJmsYHNM3ynVOlU99ebxCM6EaICFU7ADtPkuL9XBySbXCs T4HM0EKRxexiCEZk/FQpOQ+q6iAifFWkBDfigGYKbxnq1xg95q6zZH8zT4JWytic8Oje geLRsNfXeuuoLuZzuJeofLBtAReJObhZV58NLa7HmzJlGMi33p/T1A+c/zKYmUh5l9+R 0dKA== X-Gm-Message-State: AKS2vOxSWtdGMSUu5WrzwtvUaU6+oAazLkmNYyiWSbQgSMPOKTL6hk/e pZMnJme6Ef3nYGnm X-Received: by 10.99.64.197 with SMTP id n188mr3714458pga.281.1498269715447; Fri, 23 Jun 2017 19:01:55 -0700 (PDT) Received: from localhost ([216.38.154.21]) by smtp.gmail.com with ESMTPSA id a29sm5990331pfg.30.2017.06.23.19.01.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Jun 2017 19:01:54 -0700 (PDT) From: Palmer Dabbelt To: linux-pci@vger.kernel.org To: linux-kernel@vger.kernel.org To: bhelgaas@google.com To: hch@infradead.org To: Arnd Bergmann Cc: linux-snps-arc@lists.infradead.org Cc: linux-cris-kernel@axis.com Cc: linux-ia64@vger.kernel.org Cc: linux-s390@vger.kernel.org Cc: linux-sh@vger.kernel.org Cc: sparclinux@vger.kernel.org Cc: Palmer Dabbelt Subject: [PATCH 1/3] pci: Add a generic, weakly-linked pcibios_fixup_bus Date: Fri, 23 Jun 2017 18:50:42 -0700 Message-Id: <20170624015044.16746-2-palmer@dabbelt.com> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170624015044.16746-1-palmer@dabbelt.com> References: <20170624015044.16746-1-palmer@dabbelt.com> Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Multiple architectures define this as an empty function, and I'm adding another one as part of the RISC-V port. This adds a __weak version of pci_fixup_bios and deletes the now obselete ones in a handful of ports. The only functional change should be that microblaze used to export pcibios_fixup_bus. None of the other architectures export this, so I just dropped it. Signed-off-by: Palmer Dabbelt --- arch/arc/kernel/pcibios.c | 4 ---- arch/arm64/kernel/pci.c | 8 -------- arch/cris/arch-v32/drivers/pci/bios.c | 4 ---- arch/microblaze/pci/pci-common.c | 6 ------ arch/s390/pci/pci.c | 4 ---- arch/sh/drivers/pci/pci.c | 8 -------- arch/sparc/kernel/pci.c | 4 ---- arch/tile/kernel/pci.c | 8 -------- arch/tile/kernel/pci_gx.c | 5 ----- drivers/pci/probe.c | 10 ++++++++++ 10 files changed, 10 insertions(+), 51 deletions(-) diff --git a/arch/arc/kernel/pcibios.c b/arch/arc/kernel/pcibios.c index 72e1d73d0bd6..1c8df8fd5fed 100644 --- a/arch/arc/kernel/pcibios.c +++ b/arch/arc/kernel/pcibios.c @@ -16,7 +16,3 @@ resource_size_t pcibios_align_resource(void *data, const struct resource *res, { return res->start; } - -void pcibios_fixup_bus(struct pci_bus *bus) -{ -} diff --git a/arch/arm64/kernel/pci.c b/arch/arm64/kernel/pci.c index c7e3e6387a49..4c7f451aca05 100644 --- a/arch/arm64/kernel/pci.c +++ b/arch/arm64/kernel/pci.c @@ -23,14 +23,6 @@ #include /* - * Called after each bus is probed, but before its children are examined - */ -void pcibios_fixup_bus(struct pci_bus *bus) -{ - /* nothing to do, expected to be removed in the future */ -} - -/* * We don't have to worry about legacy ISA devices, so nothing to do here */ resource_size_t pcibios_align_resource(void *data, const struct resource *res, diff --git a/arch/cris/arch-v32/drivers/pci/bios.c b/arch/cris/arch-v32/drivers/pci/bios.c index 394c2a73d5e2..5cc622c0225e 100644 --- a/arch/cris/arch-v32/drivers/pci/bios.c +++ b/arch/cris/arch-v32/drivers/pci/bios.c @@ -2,10 +2,6 @@ #include #include -void pcibios_fixup_bus(struct pci_bus *b) -{ -} - void pcibios_set_master(struct pci_dev *dev) { u8 lat; diff --git a/arch/microblaze/pci/pci-common.c b/arch/microblaze/pci/pci-common.c index 404fb38d06b7..940f266e5d5c 100644 --- a/arch/microblaze/pci/pci-common.c +++ b/arch/microblaze/pci/pci-common.c @@ -810,12 +810,6 @@ void pcibios_setup_bus_devices(struct pci_bus *bus) } } -void pcibios_fixup_bus(struct pci_bus *bus) -{ - /* nothing to do */ -} -EXPORT_SYMBOL(pcibios_fixup_bus); - /* * We need to avoid collisions with `mirrored' VGA ports * and other strange ISA hardware, so we always want the diff --git a/arch/s390/pci/pci.c b/arch/s390/pci/pci.c index 8051df109db3..98a54dd63483 100644 --- a/arch/s390/pci/pci.c +++ b/arch/s390/pci/pci.c @@ -234,10 +234,6 @@ static int zpci_cfg_store(struct zpci_dev *zdev, int offset, u32 val, u8 len) return rc; } -void pcibios_fixup_bus(struct pci_bus *bus) -{ -} - resource_size_t pcibios_align_resource(void *data, const struct resource *res, resource_size_t size, resource_size_t align) diff --git a/arch/sh/drivers/pci/pci.c b/arch/sh/drivers/pci/pci.c index c99ee286b69f..749642e1272e 100644 --- a/arch/sh/drivers/pci/pci.c +++ b/arch/sh/drivers/pci/pci.c @@ -155,14 +155,6 @@ static int __init pcibios_init(void) subsys_initcall(pcibios_init); /* - * Called after each bus is probed, but before its children - * are examined. - */ -void pcibios_fixup_bus(struct pci_bus *bus) -{ -} - -/* * We need to avoid collisions with `mirrored' VGA ports * and other strange ISA hardware, so we always want the * addresses to be allocated in the 0x000-0x0ff region diff --git a/arch/sparc/kernel/pci.c b/arch/sparc/kernel/pci.c index 7eceaa10836f..78d3dc25e126 100644 --- a/arch/sparc/kernel/pci.c +++ b/arch/sparc/kernel/pci.c @@ -690,10 +690,6 @@ struct pci_bus *pci_scan_one_pbm(struct pci_pbm_info *pbm, return bus; } -void pcibios_fixup_bus(struct pci_bus *pbus) -{ -} - resource_size_t pcibios_align_resource(void *data, const struct resource *res, resource_size_t size, resource_size_t align) { diff --git a/arch/tile/kernel/pci.c b/arch/tile/kernel/pci.c index bc6656b5708b..3113d4d5c329 100644 --- a/arch/tile/kernel/pci.c +++ b/arch/tile/kernel/pci.c @@ -369,14 +369,6 @@ int __init pcibios_init(void) } subsys_initcall(pcibios_init); -/* - * No bus fixups needed. - */ -void pcibios_fixup_bus(struct pci_bus *bus) -{ - /* Nothing needs to be done. */ -} - void pcibios_set_master(struct pci_dev *dev) { /* No special bus mastering setup handling. */ diff --git a/arch/tile/kernel/pci_gx.c b/arch/tile/kernel/pci_gx.c index b554a68eea1b..b89172b592cc 100644 --- a/arch/tile/kernel/pci_gx.c +++ b/arch/tile/kernel/pci_gx.c @@ -1038,11 +1038,6 @@ int __init pcibios_init(void) } subsys_initcall(pcibios_init); -/* No bus fixups needed. */ -void pcibios_fixup_bus(struct pci_bus *bus) -{ -} - /* Process any "pci=" kernel boot arguments. */ char *__init pcibios_setup(char *str) { diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index 19c8950c6c38..1ff44dde7164 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -2227,6 +2227,16 @@ void pcie_bus_configure_settings(struct pci_bus *bus) } EXPORT_SYMBOL_GPL(pcie_bus_configure_settings); +/* + * Called after each bus is probed, but before its children are examined. This + * is marked as __weak because multiple architectures define it + */ +__attribute__ ((weak)) +void pcibios_fixup_bus(struct pci_bus *bus) +{ + /* nothing to do, expected to be removed in the future */ +} + unsigned int pci_scan_child_bus(struct pci_bus *bus) { unsigned int devfn, pass, max = bus->busn_res.start;