From patchwork Sat Jun 24 01:50:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Palmer Dabbelt X-Patchwork-Id: 780322 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3wvdqh4gGcz9s8N for ; Sat, 24 Jun 2017 12:02:22 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Pak0/wAX"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=dabbelt-com.20150623.gappssmtp.com header.i=@dabbelt-com.20150623.gappssmtp.com header.b="lpWEkkkq"; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=Msbff+/3Vv6rXstJvJqq9pxsDoxryHIk6sM83TzLqQU=; b=Pak0/wAXP7xKSM3ayQ2IkfFbHm geyp+5loUOmUNwpk4W1d0ySyYyE93F/AqDA8aKWBrxm6j0Whm8uGmf3Y2rAuNg6jJR3hN7uLOruka es3+5ilWUcSZbr8CpiQ1ix6/RJuWjb72KLv5ClIk+oMUlHDGnDTkYSLRbedLSUprHGZ+zhuCm9+HK z9BlceZTB52CJVymma4Zu4qny/+MKDdbHqGhfm0bNJo8t+yOHS5isZQ4nVaFYvM7XPUoh57i7J/kG bBQXJYWh6zSLy50AZ0xtA6px73Ik+wW3WDHLMOI3TXpEtljJNwCZeGR0FJj60YR7QRXtz+MOO2v3J Nr6Tq8Lw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dOaOz-0001UO-KJ; Sat, 24 Jun 2017 02:02:21 +0000 Received: from mail-pf0-x244.google.com ([2607:f8b0:400e:c00::244]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dOaOv-0001Pc-F3 for linux-snps-arc@lists.infradead.org; Sat, 24 Jun 2017 02:02:20 +0000 Received: by mail-pf0-x244.google.com with SMTP id d5so9747120pfe.1 for ; Fri, 23 Jun 2017 19:01:57 -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=I3UYDDds7/xTrvFg6acGYEUpm5vBrTzgePgcqScComc=; b=lpWEkkkqIcfkr6QMRPVwSShMMB+p8FmylJL9x32gUZ4fQFKL4qta/1b/vPvBqOl36s PhXaYGvfUovfXTtwRKI4MfcREhHAdMWyLmJ06Y9m7GHsAorRyMBuG2uMzBoC7jk8JWqT CS+F9WXizI1DvL1UEHecWQPn/8GMb/LHMDw2HzqdbjIiJicFYXTNDFFyeUW6jRkgI3LS G13e/bm1l4YvdlxngtVW9/itc7PS2lY8D/XSVyGoVGGMbFy/VUnHoDR5s1PqWtfg+4lb 7MRwcZGS1MQUgtRNMM3esklBN3bGo3LdyAVhm8CKTeqz4ty3khpgRAjxSM6dEhHkmNm9 +iRg== 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=I3UYDDds7/xTrvFg6acGYEUpm5vBrTzgePgcqScComc=; b=OSm45rpbVG1AJ+p/8SsPDjxKWD0EdsSC3DvPb20C75tQnM13yTb0O0Xn+efNSkTFql J19YJ1y32BKGWG/OFhlvp2K4Pmeri5xF0T/ayBMlDTL5lduPhhNFgW1N3wfc8Ti7tykN wjOjkYdTA7+mlxoiM9YvTMlY8c2g1/N2ZOIoHFw6irFDS2n3uwGj1lZGYy0X0abiBv2P PbL+p6NyCsGlbWmbx2V8FhRFw0+TvJASR24+iiRXZXL+93u+iBRR6iyI8Ly83jpRFnoK dpz+3qFCddHR1Xs+tshccY/v3XHmWcBPahXD7P6EDxAhtdGbgCBVoBxOI3g7k7rjZO9U lhQw== X-Gm-Message-State: AKS2vOxYueR63o/HjjANonhGHcLF+NmoWpPavkL84fdmTKLUpIk2aMZf 4WKIqUL4mRWXY9qy X-Received: by 10.101.90.141 with SMTP id c13mr3193081pgt.275.1498269716489; Fri, 23 Jun 2017 19:01:56 -0700 (PDT) Received: from localhost ([216.38.154.21]) by smtp.gmail.com with ESMTPSA id d2sm9567827pfb.49.2017.06.23.19.01.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Jun 2017 19:01:55 -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 Subject: [PATCH 2/3] pci: Add a generic, weakly-linked pcibios_align_resource Date: Fri, 23 Jun 2017 18:50:43 -0700 Message-Id: <20170624015044.16746-3-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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170623_190217_544946_BE614F82 X-CRM114-Status: GOOD ( 13.53 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2607:f8b0:400e:c00:0:0:0:244 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 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 X-BeenThere: linux-snps-arc@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux on Synopsys ARC Processors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-s390@vger.kernel.org, linux-ia64@vger.kernel.org, linux-cris-kernel@axis.com, linux-sh@vger.kernel.org, Palmer Dabbelt , sparclinux@vger.kernel.org, linux-snps-arc@lists.infradead.org MIME-Version: 1.0 Sender: "linux-snps-arc" Errors-To: linux-snps-arc-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Multiple architectures define this as trivial function, and I'm adding another one as part of the RISC-V port. This adds a __weak version of pcibios_align_resource and deletes the now obselete ones in a handful of ports. The only functional change should be that a handful of ports used to export pcibios_fixup_bus. Only some architectures export this, so I just dropped it. Signed-off-by: Palmer Dabbelt --- arch/arc/kernel/pcibios.c | 9 --------- arch/arm64/kernel/pci.c | 9 --------- arch/ia64/pci/pci.c | 7 ------- arch/microblaze/pci/pci-common.c | 7 ------- arch/sparc/kernel/leon_pci.c | 6 ------ arch/sparc/kernel/pci.c | 6 ------ arch/sparc/kernel/pcic.c | 6 ------ arch/tile/kernel/pci.c | 10 ---------- arch/tile/kernel/pci_gx.c | 9 --------- drivers/pci/setup-res.c | 12 ++++++++++++ 10 files changed, 12 insertions(+), 69 deletions(-) diff --git a/arch/arc/kernel/pcibios.c b/arch/arc/kernel/pcibios.c index 1c8df8fd5fed..05aba5a7b5d2 100644 --- a/arch/arc/kernel/pcibios.c +++ b/arch/arc/kernel/pcibios.c @@ -7,12 +7,3 @@ */ #include - -/* - * 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, - resource_size_t size, resource_size_t align) -{ - return res->start; -} diff --git a/arch/arm64/kernel/pci.c b/arch/arm64/kernel/pci.c index 4c7f451aca05..9753ca23cfa1 100644 --- a/arch/arm64/kernel/pci.c +++ b/arch/arm64/kernel/pci.c @@ -23,15 +23,6 @@ #include /* - * 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, - resource_size_t size, resource_size_t align) -{ - return res->start; -} - -/* * Try to assign the IRQ number when probing a new device */ int pcibios_alloc_irq(struct pci_dev *dev) diff --git a/arch/ia64/pci/pci.c b/arch/ia64/pci/pci.c index 4068bde623dc..f5ec736100ee 100644 --- a/arch/ia64/pci/pci.c +++ b/arch/ia64/pci/pci.c @@ -411,13 +411,6 @@ pcibios_disable_device (struct pci_dev *dev) acpi_pci_irq_disable(dev); } -resource_size_t -pcibios_align_resource (void *data, const struct resource *res, - resource_size_t size, resource_size_t align) -{ - return res->start; -} - /** * ia64_pci_get_legacy_mem - generic legacy mem routine * @bus: bus to get legacy memory base address for diff --git a/arch/microblaze/pci/pci-common.c b/arch/microblaze/pci/pci-common.c index 940f266e5d5c..5835c09c6e26 100644 --- a/arch/microblaze/pci/pci-common.c +++ b/arch/microblaze/pci/pci-common.c @@ -823,13 +823,6 @@ void pcibios_setup_bus_devices(struct pci_bus *bus) * but we want to try to avoid allocating at 0x2900-0x2bff * which might have be mirrored at 0x0100-0x03ff.. */ -resource_size_t pcibios_align_resource(void *data, const struct resource *res, - resource_size_t size, resource_size_t align) -{ - return res->start; -} -EXPORT_SYMBOL(pcibios_align_resource); - int pcibios_add_device(struct pci_dev *dev) { dev->irq = of_irq_parse_and_map_pci(dev, 0, 0); diff --git a/arch/sparc/kernel/leon_pci.c b/arch/sparc/kernel/leon_pci.c index 4371f72ff025..0eafdf3d036d 100644 --- a/arch/sparc/kernel/leon_pci.c +++ b/arch/sparc/kernel/leon_pci.c @@ -94,9 +94,3 @@ 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) -{ - return res->start; -} diff --git a/arch/sparc/kernel/pci.c b/arch/sparc/kernel/pci.c index 78d3dc25e126..3f8670c92951 100644 --- a/arch/sparc/kernel/pci.c +++ b/arch/sparc/kernel/pci.c @@ -690,12 +690,6 @@ struct pci_bus *pci_scan_one_pbm(struct pci_pbm_info *pbm, return bus; } -resource_size_t pcibios_align_resource(void *data, const struct resource *res, - resource_size_t size, resource_size_t align) -{ - return res->start; -} - int pcibios_enable_device(struct pci_dev *dev, int mask) { u16 cmd, oldcmd; diff --git a/arch/sparc/kernel/pcic.c b/arch/sparc/kernel/pcic.c index a38787b84322..e038e343f2c1 100644 --- a/arch/sparc/kernel/pcic.c +++ b/arch/sparc/kernel/pcic.c @@ -746,12 +746,6 @@ static void watchdog_reset() { } #endif -resource_size_t pcibios_align_resource(void *data, const struct resource *res, - resource_size_t size, resource_size_t align) -{ - return res->start; -} - int pcibios_enable_device(struct pci_dev *pdev, int mask) { return 0; diff --git a/arch/tile/kernel/pci.c b/arch/tile/kernel/pci.c index 3113d4d5c329..8999a20ed9d1 100644 --- a/arch/tile/kernel/pci.c +++ b/arch/tile/kernel/pci.c @@ -67,16 +67,6 @@ static struct pci_ops tile_cfg_ops; /* - * We don't need to worry about the alignment of resources. - */ -resource_size_t pcibios_align_resource(void *data, const struct resource *res, - resource_size_t size, resource_size_t align) -{ - return res->start; -} -EXPORT_SYMBOL(pcibios_align_resource); - -/* * Open a FD to the hypervisor PCI device. * * controller_id is the controller number, config type is 0 or 1 for diff --git a/arch/tile/kernel/pci_gx.c b/arch/tile/kernel/pci_gx.c index b89172b592cc..0a7642184a9a 100644 --- a/arch/tile/kernel/pci_gx.c +++ b/arch/tile/kernel/pci_gx.c @@ -108,15 +108,6 @@ static struct pci_ops tile_cfg_ops; /* Mask of CPUs that should receive PCIe interrupts. */ static struct cpumask intr_cpus_map; -/* We don't need to worry about the alignment of resources. */ -resource_size_t pcibios_align_resource(void *data, const struct resource *res, - resource_size_t size, - resource_size_t align) -{ - return res->start; -} -EXPORT_SYMBOL(pcibios_align_resource); - /* * Pick a CPU to receive and handle the PCIe interrupts, based on the IRQ #. * For now, we simply send interrupts to non-dataplane CPUs. diff --git a/drivers/pci/setup-res.c b/drivers/pci/setup-res.c index 85774b7a316a..597ed1f8b15c 100644 --- a/drivers/pci/setup-res.c +++ b/drivers/pci/setup-res.c @@ -234,6 +234,18 @@ static int pci_revert_fw_address(struct resource *res, struct pci_dev *dev, return 0; } +/* + * We don't have to worry about legacy ISA devices, so nothing to do here. + * This is marked as __weak because multiple architectures define it, it should + * eventually go away. + */ +__attribute__ ((weak)) +resource_size_t pcibios_align_resource(void *data, const struct resource *res, + resource_size_t size, resource_size_t align) +{ + return res->start; +} + static int __pci_assign_resource(struct pci_bus *bus, struct pci_dev *dev, int resno, resource_size_t size, resource_size_t align) {