From: Palmer Dabbelt <palmer@dabbelt.com>
To: Olof Johansson <olof@lixom.net>, Arnd Bergmann <arnd@arndb.de>,
akpm@linux-foundation.org
Cc: albert@sifive.com, yamada.masahiro@socionext.com,
mmarek@suse.com, will.deacon@arm.com, peterz@infradead.org,
boqun.feng@gmail.com, mingo@redhat.com,
daniel.lezcano@linaro.org, tglx@linutronix.de,
jason@lakedaemon.net, marc.zyngier@arm.com,
gregkh@linuxfoundation.org, jslaby@suse.com, davem@davemloft.net,
mchehab@kernel.org, sfr@canb.auug.org.au, fweisbec@gmail.com,
viro@zeniv.linux.org.uk, mcgrof@kernel.org, dledford@redhat.com,
bart.vanassche@sandisk.com, sstabellini@kernel.org,
daniel.vetter@ffwll.ch, mpe@ellerman.id.au, msalter@redhat.com,
nicolas.dichtel@6wind.com, james.hogan@imgtec.com,
paul.gortmaker@windriver.com, linux@roeck-us.net,
heiko.carstens@de.ibm.com, schwidefsky@de.ibm.com,
linux-kernel@vger.kernel.org, patches@groups.riscv.org,
Palmer Dabbelt <palmer@dabbelt.com>
Subject: [PATCH 02/17] pci: Add a generic, weakly-linked pcibios_align_resource
Date: Tue, 11 Jul 2017 18:31:15 -0700 [thread overview]
Message-ID: <20170712013130.14792-3-palmer@dabbelt.com> (raw)
In-Reply-To: <20170712013130.14792-1-palmer@dabbelt.com>
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 <palmer@dabbelt.com>
---
arch/arc/kernel/pcibios.c | 13 -------------
arch/arm64/kernel/pci.c | 17 -----------------
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 | 10 ----------
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(+), 85 deletions(-)
diff --git a/arch/arc/kernel/pcibios.c b/arch/arc/kernel/pcibios.c
index 72e1d73d0bd6..05aba5a7b5d2 100644
--- a/arch/arc/kernel/pcibios.c
+++ b/arch/arc/kernel/pcibios.c
@@ -7,16 +7,3 @@
*/
#include <linux/pci.h>
-
-/*
- * 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;
-}
-
-void pcibios_fixup_bus(struct pci_bus *bus)
-{
-}
diff --git a/arch/arm64/kernel/pci.c b/arch/arm64/kernel/pci.c
index e2b7e4f9cc31..0e2ea1c78542 100644
--- a/arch/arm64/kernel/pci.c
+++ b/arch/arm64/kernel/pci.c
@@ -22,23 +22,6 @@
#include <linux/pci-ecam.h>
#include <linux/slab.h>
-/*
- * 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,
- resource_size_t size, resource_size_t align)
-{
- return res->start;
-}
-
#ifdef CONFIG_ACPI
/*
* Try to assign the IRQ number when probing a new device
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 404fb38d06b7..7a332e9f1de0 100644
--- a/arch/microblaze/pci/pci-common.c
+++ b/arch/microblaze/pci/pci-common.c
@@ -829,13 +829,6 @@ EXPORT_SYMBOL(pcibios_fixup_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 7eceaa10836f..3f8670c92951 100644
--- a/arch/sparc/kernel/pci.c
+++ b/arch/sparc/kernel/pci.c
@@ -690,16 +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)
-{
- 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 bc6656b5708b..284ed23b3914 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 b554a68eea1b..bdc623b91f7a 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)
{
--
2.13.0
next prev parent reply other threads:[~2017-07-12 1:32 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-12 1:31 RISC-V Linux Port v6 Palmer Dabbelt
2017-07-12 1:31 ` [PATCH 01/17] lib: Add shared copies of some GCC library routines Palmer Dabbelt
2017-07-12 1:31 ` Palmer Dabbelt [this message]
2017-07-12 13:41 ` [PATCH 02/17] pci: Add a generic, weakly-linked pcibios_align_resource Luis R. Rodriguez
2017-07-12 22:50 ` Bjorn Helgaas
2017-07-13 18:30 ` Palmer Dabbelt
2017-07-14 3:19 ` kbuild test robot
2017-07-12 1:31 ` [PATCH 03/17] pci: Add a generic, weakly-linked pcibios_fixup_bus Palmer Dabbelt
2017-07-12 1:31 ` [PATCH 04/17] MAINTAINERS: Add RISC-V Palmer Dabbelt
2017-07-12 11:16 ` James Hogan
2017-07-12 11:31 ` Arnd Bergmann
2017-07-12 14:51 ` [patches] " Jonathan Neuschäfer
2017-07-12 1:31 ` [PATCH 05/17] clocksource: New RISC-V SBI timer driver Palmer Dabbelt
2017-07-12 1:31 ` [PATCH 06/17] irqchip: RISC-V Local Interrupt Controller Driver Palmer Dabbelt
2017-07-12 1:31 ` [PATCH 07/17] irqchip: New RISC-V PLIC Driver Palmer Dabbelt
2017-07-12 1:31 ` [PATCH 08/17] tty: New RISC-V SBI console driver Palmer Dabbelt
2017-07-12 1:31 ` [PATCH 09/17] RISC-V: Init and Halt Code Palmer Dabbelt
2017-07-12 1:31 ` [PATCH 10/17] RISC-V: Atomic and Locking Code Palmer Dabbelt
2017-07-12 12:40 ` Boqun Feng
2017-07-12 12:44 ` Boqun Feng
2017-07-12 12:49 ` Peter Zijlstra
2017-07-12 17:17 ` Palmer Dabbelt
2017-07-12 13:13 ` Arnd Bergmann
2017-07-12 1:31 ` [PATCH 11/17] RISC-V: Generic library routines and assembly Palmer Dabbelt
2017-07-12 1:31 ` [PATCH 12/17] RISC-V: ELF and module implementation Palmer Dabbelt
2017-07-12 1:31 ` [PATCH 13/17] RISC-V: Task implementation Palmer Dabbelt
2017-07-12 1:31 ` [PATCH 14/17] RISC-V: Device, timer, IRQs, and the SBI Palmer Dabbelt
2017-07-12 1:31 ` [PATCH 15/17] RISC-V: Paging and MMU Palmer Dabbelt
2017-07-12 1:31 ` [PATCH 16/17] RISC-V: User-facing API Palmer Dabbelt
2017-07-12 11:07 ` James Hogan
2017-07-12 16:24 ` Palmer Dabbelt
2017-07-12 17:09 ` James Hogan
2017-07-13 21:50 ` Palmer Dabbelt
2017-07-12 1:31 ` [PATCH 17/17] RISC-V: Build Infastructure Palmer Dabbelt
2017-07-26 2:57 ` [patches] " Jonathan Neuschäfer
2017-07-26 5:20 ` Palmer Dabbelt
2017-07-26 6:52 ` Arnd Bergmann
2017-07-26 18:37 ` Jonathan Neuschäfer
2017-07-12 7:58 ` RISC-V Linux Port v6 Arnd Bergmann
2017-07-12 13:53 ` Luis R. Rodriguez
2017-07-12 17:55 ` Will Deacon
2017-07-12 19:34 ` Arnd Bergmann
-- strict thread matches above, loose matches on Subject: below --
2017-07-11 1:39 RISC-V Linux Port v5 Palmer Dabbelt
2017-07-11 1:39 ` [PATCH 02/17] pci: Add a generic, weakly-linked pcibios_align_resource Palmer Dabbelt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170712013130.14792-3-palmer@dabbelt.com \
--to=palmer@dabbelt.com \
--cc=akpm@linux-foundation.org \
--cc=albert@sifive.com \
--cc=arnd@arndb.de \
--cc=bart.vanassche@sandisk.com \
--cc=boqun.feng@gmail.com \
--cc=daniel.lezcano@linaro.org \
--cc=daniel.vetter@ffwll.ch \
--cc=davem@davemloft.net \
--cc=dledford@redhat.com \
--cc=fweisbec@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=heiko.carstens@de.ibm.com \
--cc=james.hogan@imgtec.com \
--cc=jason@lakedaemon.net \
--cc=jslaby@suse.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=marc.zyngier@arm.com \
--cc=mcgrof@kernel.org \
--cc=mchehab@kernel.org \
--cc=mingo@redhat.com \
--cc=mmarek@suse.com \
--cc=mpe@ellerman.id.au \
--cc=msalter@redhat.com \
--cc=nicolas.dichtel@6wind.com \
--cc=olof@lixom.net \
--cc=patches@groups.riscv.org \
--cc=paul.gortmaker@windriver.com \
--cc=peterz@infradead.org \
--cc=schwidefsky@de.ibm.com \
--cc=sfr@canb.auug.org.au \
--cc=sstabellini@kernel.org \
--cc=tglx@linutronix.de \
--cc=viro@zeniv.linux.org.uk \
--cc=will.deacon@arm.com \
--cc=yamada.masahiro@socionext.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®