Re: [PATCH 02/17] pci: Add a generic, weakly-linked pcibios_align_resource

2017-07-13 Thread kbuild test robot
Hi Palmer,

[auto build test ERROR on linus/master]
[also build test ERROR on next-20170713]
[cannot apply to v4.12]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]

url:
https://github.com/0day-ci/linux/commits/Palmer-Dabbelt/lib-Add-shared-copies-of-some-GCC-library-routines/20170713-012253
config: arm64-defconfig (attached as .config)
compiler: aarch64-linux-gnu-gcc (Debian 6.1.1-9) 6.1.1 20160705
reproduce:
wget 
https://raw.githubusercontent.com/01org/lkp-tests/master/sbin/make.cross -O 
~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=arm64 

Note: the 
linux-review/Palmer-Dabbelt/lib-Add-shared-copies-of-some-GCC-library-routines/20170713-012253
 HEAD ce846a13375e664242eedad789cb6e1c46d5ddd6 builds fine.
  It only hurts bisectibility.

All errors (new ones prefixed by >>):

   drivers/pci/probe.o: In function `pci_scan_child_bus':
>> drivers/pci/probe.c:2311: undefined reference to `pcibios_fixup_bus'
   drivers/pci/probe.c:2311:(.text+0x2ffc): relocation truncated to fit: 
R_AARCH64_CALL26 against undefined symbol `pcibios_fixup_bus'

vim +2311 drivers/pci/probe.c

b03e7495a Jon Mason  2011-07-20  2290  
15856ad50 Bill Pemberton 2012-11-21  2291  unsigned int 
pci_scan_child_bus(struct pci_bus *bus)
^1da177e4 Linus Torvalds 2005-04-16  2292  {
b918c62e0 Yinghai Lu 2012-05-17  2293   unsigned int devfn, pass, max = 
bus->busn_res.start;
^1da177e4 Linus Torvalds 2005-04-16  2294   struct pci_dev *dev;
^1da177e4 Linus Torvalds 2005-04-16  2295  
0207c356e Bjorn Helgaas  2009-11-04  2296   dev_dbg(&bus->dev, "scanning 
bus\n");
^1da177e4 Linus Torvalds 2005-04-16  2297  
^1da177e4 Linus Torvalds 2005-04-16  2298   /* Go find them, Rover! */
^1da177e4 Linus Torvalds 2005-04-16  2299   for (devfn = 0; devfn < 0x100; 
devfn += 8)
^1da177e4 Linus Torvalds 2005-04-16  2300   pci_scan_slot(bus, 
devfn);
^1da177e4 Linus Torvalds 2005-04-16  2301  
a28724b0f Yu Zhao2009-03-20  2302   /* Reserve buses for SR-IOV 
capability. */
a28724b0f Yu Zhao2009-03-20  2303   max += pci_iov_bus_range(bus);
a28724b0f Yu Zhao2009-03-20  2304  
^1da177e4 Linus Torvalds 2005-04-16  2305   /*
^1da177e4 Linus Torvalds 2005-04-16  2306* After performing 
arch-dependent fixup of the bus, look behind
^1da177e4 Linus Torvalds 2005-04-16  2307* all PCI-to-PCI bridges on 
this bus.
^1da177e4 Linus Torvalds 2005-04-16  2308*/
74710ded8 Alex Chiang2009-03-20  2309   if (!bus->is_added) {
0207c356e Bjorn Helgaas  2009-11-04  2310   dev_dbg(&bus->dev, 
"fixups for bus\n");
^1da177e4 Linus Torvalds 2005-04-16 @2311   pcibios_fixup_bus(bus);
74710ded8 Alex Chiang2009-03-20  2312   bus->is_added = 1;
74710ded8 Alex Chiang2009-03-20  2313   }
74710ded8 Alex Chiang2009-03-20  2314  
^1da177e4 Linus Torvalds 2005-04-16  2315   for (pass = 0; pass < 2; pass++)
^1da177e4 Linus Torvalds 2005-04-16  2316   
list_for_each_entry(dev, &bus->devices, bus_list) {
6788a51fe Yijing Wang2014-05-04  2317   if 
(pci_is_bridge(dev))
^1da177e4 Linus Torvalds 2005-04-16  2318   max = 
pci_scan_bridge(bus, dev, max, pass);
^1da177e4 Linus Torvalds 2005-04-16  2319   }
^1da177e4 Linus Torvalds 2005-04-16  2320  
^1da177e4 Linus Torvalds 2005-04-16  2321   /*
e16b46605 Keith Busch2016-07-21  2322* Make sure a hotplug bridge 
has at least the minimum requested
e16b46605 Keith Busch2016-07-21  2323* number of buses.
e16b46605 Keith Busch2016-07-21  2324*/
e16b46605 Keith Busch2016-07-21  2325   if (bus->self && 
bus->self->is_hotplug_bridge && pci_hotplug_bus_size) {
e16b46605 Keith Busch2016-07-21  2326   if (max - 
bus->busn_res.start < pci_hotplug_bus_size - 1)
e16b46605 Keith Busch2016-07-21  2327   max = 
bus->busn_res.start + pci_hotplug_bus_size - 1;
e16b46605 Keith Busch2016-07-21  2328   }
e16b46605 Keith Busch2016-07-21  2329  
e16b46605 Keith Busch2016-07-21  2330   /*
^1da177e4 Linus Torvalds 2005-04-16  2331* We've scanned the bus and so 
we know all about what's on
^1da177e4 Linus Torvalds 2005-04-16  2332* the other side of any 
bridges that may be on this bus plus
^1da177e4 Linus Torvalds 2005-04-16  2333* any devices.
^1da177e4 Linus Torvalds 2005-04-16  2334*
^1da177e4 Linus Torvalds 2005-04-16  2335* Return how far we've got 
finding sub-buses.
^1da177e4 Linus Torvalds 2005-04-16  2336*/
0207c356e Bjorn Helgaas  2009-11-04  2337   dev_dbg(&bus->dev, "bus scan 
returning with max=%02x\n", max);
^1da177e4 Linus Torvalds 2005-04-16  2338   return max;
^1da177e4 Linus Torvalds 2005-04-16  2339  }
b7fe94342 Ry

Re: [PATCH 02/17] pci: Add a generic, weakly-linked pcibios_align_resource

2017-07-13 Thread Palmer Dabbelt
On Wed, 12 Jul 2017 15:50:42 PDT (-0700), helg...@kernel.org wrote:
> On Tue, Jul 11, 2017 at 06:31:15PM -0700, Palmer Dabbelt wrote:
>> 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| 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(-)
>
> I think you're making your life harder by including these cleanup
> patches in your RISC-V support.  This patch makes sense (after sorting
> out the issues Luis pointed out), but I think the simplest thing to
> expedite merging is to add the empty stubs for RISC-V like everybody
> else does, then come back after RISC-V gets merged and do the cleanup.
> Then the cleanup clearly goes via the PCI tree and isn't entangled
> with anything else.

Works for me.


Re: [PATCH 02/17] pci: Add a generic, weakly-linked pcibios_align_resource

2017-07-12 Thread Bjorn Helgaas
On Tue, Jul 11, 2017 at 06:31:15PM -0700, Palmer Dabbelt wrote:
> 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| 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(-)

I think you're making your life harder by including these cleanup
patches in your RISC-V support.  This patch makes sense (after sorting
out the issues Luis pointed out), but I think the simplest thing to
expedite merging is to add the empty stubs for RISC-V like everybody
else does, then come back after RISC-V gets merged and do the cleanup.
Then the cleanup clearly goes via the PCI tree and isn't entangled
with anything else.

Bjorn

> 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 
> -
> -/*
> - * 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 
>  #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,
> - 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,
>   

Re: [PATCH 02/17] pci: Add a generic, weakly-linked pcibios_align_resource

2017-07-12 Thread Luis R. Rodriguez
On Tue, Jul 11, 2017 at 06:31:15PM -0700, Palmer Dabbelt wrote:
> 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.

And for architectures that do use the routine in drivers they provide
the export. This is the case for x86 and the intel i915 driver.

> Signed-off-by: Palmer Dabbelt 

As I noted with the other PCI patch, these should have addressed
Bjorn Helgaas  and linux-...@vger.kernel.org.
You seem to have forgotten to do that this time again.

Provided you address the minor issues below here's a:

Reviewed-by: Luis R. Rodriguez 

Also, FWIW the 2 PCI patches you have are independent and could
be split off and merged, but it obviously would make sense to
keep them in a series if this is going in for this merge window.
If your tree is not being merged in this merge window then at least
you could try to get these 2 patches merged into Bjorn or Andrew's
tree if its not too late.

This patch however still needs refactoring, and since you will also
touch the next PCI patch that as well. Notes below.

> ---
>  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 
> -
> -/*
> - * 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)
> -{
> -}

You've mixed removing pcibios_fixup_bus() in this patch whereas you have another
patch which does this removal for you after this. Please split these removals 
out
into that patch.

> 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 
>  #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
> - */

Here is another one.

> -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/

[PATCH 02/17] pci: Add a generic, weakly-linked pcibios_align_resource

2017-07-11 Thread Palmer Dabbelt
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| 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 
-
-/*
- * 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 
 #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,
-   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)
-{
-  

[PATCH 02/17] pci: Add a generic, weakly-linked pcibios_align_resource

2017-07-10 Thread Palmer Dabbelt
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| 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 
-
-/*
- * 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 
 #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,
-   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)
-{
-