diff options
author | Palmer Dabbelt <palmer@dabbelt.com> | 2017-08-02 15:44:50 -0400 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2017-08-02 15:53:16 -0400 |
commit | ecf677c8dcaa7bf13eee31b4d9e4639d559984ad (patch) | |
tree | f831c3251c69bd7b0cb49fecc549ab56846927fd | |
parent | bccf90d6e063d278b9ddc78dd266d0adef29886c (diff) |
PCI: Add a generic weak pcibios_align_resource()
Multiple architectures define this as a trivial function, and I'm adding
another one as part of the RISC-V port. Add a __weak version of
pcibios_align_resource() and delete 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>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
-rw-r--r-- | arch/arc/kernel/pcibios.c | 9 | ||||
-rw-r--r-- | arch/arm64/kernel/pci.c | 9 | ||||
-rw-r--r-- | arch/ia64/pci/pci.c | 7 | ||||
-rw-r--r-- | arch/microblaze/pci/pci-common.c | 7 | ||||
-rw-r--r-- | arch/sparc/kernel/leon_pci.c | 6 | ||||
-rw-r--r-- | arch/sparc/kernel/pci.c | 6 | ||||
-rw-r--r-- | arch/sparc/kernel/pcic.c | 6 | ||||
-rw-r--r-- | arch/tile/kernel/pci.c | 10 | ||||
-rw-r--r-- | arch/tile/kernel/pci_gx.c | 9 | ||||
-rw-r--r-- | drivers/pci/setup-res.c | 13 |
10 files changed, 13 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 @@ | |||
7 | */ | 7 | */ |
8 | 8 | ||
9 | #include <linux/pci.h> | 9 | #include <linux/pci.h> |
10 | |||
11 | /* | ||
12 | * We don't have to worry about legacy ISA devices, so nothing to do here | ||
13 | */ | ||
14 | resource_size_t pcibios_align_resource(void *data, const struct resource *res, | ||
15 | resource_size_t size, resource_size_t align) | ||
16 | { | ||
17 | return res->start; | ||
18 | } | ||
diff --git a/arch/arm64/kernel/pci.c b/arch/arm64/kernel/pci.c index d91051259bb2..0e2ea1c78542 100644 --- a/arch/arm64/kernel/pci.c +++ b/arch/arm64/kernel/pci.c | |||
@@ -22,15 +22,6 @@ | |||
22 | #include <linux/pci-ecam.h> | 22 | #include <linux/pci-ecam.h> |
23 | #include <linux/slab.h> | 23 | #include <linux/slab.h> |
24 | 24 | ||
25 | /* | ||
26 | * We don't have to worry about legacy ISA devices, so nothing to do here | ||
27 | */ | ||
28 | resource_size_t pcibios_align_resource(void *data, const struct resource *res, | ||
29 | resource_size_t size, resource_size_t align) | ||
30 | { | ||
31 | return res->start; | ||
32 | } | ||
33 | |||
34 | #ifdef CONFIG_ACPI | 25 | #ifdef CONFIG_ACPI |
35 | /* | 26 | /* |
36 | * Try to assign the IRQ number when probing a new device | 27 | * 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) | |||
411 | acpi_pci_irq_disable(dev); | 411 | acpi_pci_irq_disable(dev); |
412 | } | 412 | } |
413 | 413 | ||
414 | resource_size_t | ||
415 | pcibios_align_resource (void *data, const struct resource *res, | ||
416 | resource_size_t size, resource_size_t align) | ||
417 | { | ||
418 | return res->start; | ||
419 | } | ||
420 | |||
421 | /** | 414 | /** |
422 | * ia64_pci_get_legacy_mem - generic legacy mem routine | 415 | * ia64_pci_get_legacy_mem - generic legacy mem routine |
423 | * @bus: bus to get legacy memory base address for | 416 | * @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) | |||
823 | * but we want to try to avoid allocating at 0x2900-0x2bff | 823 | * but we want to try to avoid allocating at 0x2900-0x2bff |
824 | * which might have be mirrored at 0x0100-0x03ff.. | 824 | * which might have be mirrored at 0x0100-0x03ff.. |
825 | */ | 825 | */ |
826 | resource_size_t pcibios_align_resource(void *data, const struct resource *res, | ||
827 | resource_size_t size, resource_size_t align) | ||
828 | { | ||
829 | return res->start; | ||
830 | } | ||
831 | EXPORT_SYMBOL(pcibios_align_resource); | ||
832 | |||
833 | int pcibios_add_device(struct pci_dev *dev) | 826 | int pcibios_add_device(struct pci_dev *dev) |
834 | { | 827 | { |
835 | dev->irq = of_irq_parse_and_map_pci(dev, 0, 0); | 828 | 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) | |||
94 | } | 94 | } |
95 | } | 95 | } |
96 | } | 96 | } |
97 | |||
98 | resource_size_t pcibios_align_resource(void *data, const struct resource *res, | ||
99 | resource_size_t size, resource_size_t align) | ||
100 | { | ||
101 | return res->start; | ||
102 | } | ||
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, | |||
690 | return bus; | 690 | return bus; |
691 | } | 691 | } |
692 | 692 | ||
693 | resource_size_t pcibios_align_resource(void *data, const struct resource *res, | ||
694 | resource_size_t size, resource_size_t align) | ||
695 | { | ||
696 | return res->start; | ||
697 | } | ||
698 | |||
699 | int pcibios_enable_device(struct pci_dev *dev, int mask) | 693 | int pcibios_enable_device(struct pci_dev *dev, int mask) |
700 | { | 694 | { |
701 | u16 cmd, oldcmd; | 695 | 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() { | |||
746 | } | 746 | } |
747 | #endif | 747 | #endif |
748 | 748 | ||
749 | resource_size_t pcibios_align_resource(void *data, const struct resource *res, | ||
750 | resource_size_t size, resource_size_t align) | ||
751 | { | ||
752 | return res->start; | ||
753 | } | ||
754 | |||
755 | int pcibios_enable_device(struct pci_dev *pdev, int mask) | 749 | int pcibios_enable_device(struct pci_dev *pdev, int mask) |
756 | { | 750 | { |
757 | return 0; | 751 | 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; | |||
67 | 67 | ||
68 | 68 | ||
69 | /* | 69 | /* |
70 | * We don't need to worry about the alignment of resources. | ||
71 | */ | ||
72 | resource_size_t pcibios_align_resource(void *data, const struct resource *res, | ||
73 | resource_size_t size, resource_size_t align) | ||
74 | { | ||
75 | return res->start; | ||
76 | } | ||
77 | EXPORT_SYMBOL(pcibios_align_resource); | ||
78 | |||
79 | /* | ||
80 | * Open a FD to the hypervisor PCI device. | 70 | * Open a FD to the hypervisor PCI device. |
81 | * | 71 | * |
82 | * controller_id is the controller number, config type is 0 or 1 for | 72 | * 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; | |||
108 | /* Mask of CPUs that should receive PCIe interrupts. */ | 108 | /* Mask of CPUs that should receive PCIe interrupts. */ |
109 | static struct cpumask intr_cpus_map; | 109 | static struct cpumask intr_cpus_map; |
110 | 110 | ||
111 | /* We don't need to worry about the alignment of resources. */ | ||
112 | resource_size_t pcibios_align_resource(void *data, const struct resource *res, | ||
113 | resource_size_t size, | ||
114 | resource_size_t align) | ||
115 | { | ||
116 | return res->start; | ||
117 | } | ||
118 | EXPORT_SYMBOL(pcibios_align_resource); | ||
119 | |||
120 | /* | 111 | /* |
121 | * Pick a CPU to receive and handle the PCIe interrupts, based on the IRQ #. | 112 | * Pick a CPU to receive and handle the PCIe interrupts, based on the IRQ #. |
122 | * For now, we simply send interrupts to non-dataplane CPUs. | 113 | * 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..e576e1a8d978 100644 --- a/drivers/pci/setup-res.c +++ b/drivers/pci/setup-res.c | |||
@@ -234,6 +234,19 @@ static int pci_revert_fw_address(struct resource *res, struct pci_dev *dev, | |||
234 | return 0; | 234 | return 0; |
235 | } | 235 | } |
236 | 236 | ||
237 | /* | ||
238 | * We don't have to worry about legacy ISA devices, so nothing to do here. | ||
239 | * This is marked as __weak because multiple architectures define it; it should | ||
240 | * eventually go away. | ||
241 | */ | ||
242 | resource_size_t __weak pcibios_align_resource(void *data, | ||
243 | const struct resource *res, | ||
244 | resource_size_t size, | ||
245 | resource_size_t align) | ||
246 | { | ||
247 | return res->start; | ||
248 | } | ||
249 | |||
237 | static int __pci_assign_resource(struct pci_bus *bus, struct pci_dev *dev, | 250 | static int __pci_assign_resource(struct pci_bus *bus, struct pci_dev *dev, |
238 | int resno, resource_size_t size, resource_size_t align) | 251 | int resno, resource_size_t size, resource_size_t align) |
239 | { | 252 | { |