Message ID | 20161122141844.1655574-1-arnd@arndb.de (mailing list archive) |
---|---|
State | New, archived |
Delegated to: | Bjorn Helgaas |
Headers | show |
On 11/22/2016 6:17 AM, Arnd Bergmann wrote: > The newly added code to setup the inbound ranges causes a link error > on 32-bit machines from a 32-bit division: > > drivers/pci/host/pcie-iproc.o: In function `iproc_pcie_setup_ib': > pcie-iproc.c:(.text.iproc_pcie_setup_ib+0x14c): undefined reference to `__aeabi_uldivmod' > > As both sides of the division are always power-of-two numbers and > we already rely on that, we can use a shift instead. > > Fixes: 87c240b19bba ("PCI: iproc: Add inbound DMA mapping support") > Signed-off-by: Arnd Bergmann <arnd@arndb.de> > --- > drivers/pci/host/pcie-iproc.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/pci/host/pcie-iproc.c b/drivers/pci/host/pcie-iproc.c > index d10e6aa32e0d..857ff5198317 100644 > --- a/drivers/pci/host/pcie-iproc.c > +++ b/drivers/pci/host/pcie-iproc.c > @@ -865,7 +865,7 @@ static int iproc_pcie_ib_write(struct iproc_pcie *pcie, int region_idx, > * Now program the IMAP registers. Each IARR region may have one or > * more IMAP windows. > */ > - size /= nr_windows; > + size >>= ilog2(nr_windows); > for (window_idx = 0; window_idx < nr_windows; window_idx++) { > val = readl(pcie->base + imap_offset); > val |= lower_32_bits(axi_addr) | IMAP_VALID; > Hmmm, somehow we've never seen this link error for the ARM32 based platforms that we build for. Does it behave differently between different versions of compilers? Nevertheless, this is a good change to take, thanks! Acked-by: Ray Jui <ray.jui@broadcom.com> -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Tuesday, November 22, 2016 9:42:05 AM CET Ray Jui wrote: > > Hmmm, somehow we've never seen this link error for the ARM32 based > platforms that we build for. Does it behave differently between > different versions of compilers? > > Nevertheless, this is a good change to take, thanks! I looked at it again, and see now that it only happens with a 64-bit RESOURCE_SIZE_T, which is only used on 32-bit platforms with more than 4GB of memory addresses. It would however show up in a multiplatform distro build for ARMv7VE, so the fix is still clearly needed. Arnd -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On 11/22/2016 1:13 PM, Arnd Bergmann wrote: > On Tuesday, November 22, 2016 9:42:05 AM CET Ray Jui wrote: >> >> Hmmm, somehow we've never seen this link error for the ARM32 based >> platforms that we build for. Does it behave differently between >> different versions of compilers? >> >> Nevertheless, this is a good change to take, thanks! > > I looked at it again, and see now that it only happens with > a 64-bit RESOURCE_SIZE_T, which is only used on 32-bit > platforms with more than 4GB of memory addresses. It would > however show up in a multiplatform distro build for ARMv7VE, > so the fix is still clearly needed. > > Arnd > Yes, got it for how it showed up in your environment, :) This change stands good as it has been. Thanks, Ray -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Tue, Nov 22, 2016 at 03:17:51PM +0100, Arnd Bergmann wrote: > The newly added code to setup the inbound ranges causes a link error > on 32-bit machines from a 32-bit division: > > drivers/pci/host/pcie-iproc.o: In function `iproc_pcie_setup_ib': > pcie-iproc.c:(.text.iproc_pcie_setup_ib+0x14c): undefined reference to `__aeabi_uldivmod' > > As both sides of the division are always power-of-two numbers and > we already rely on that, we can use a shift instead. > > Fixes: 87c240b19bba ("PCI: iproc: Add inbound DMA mapping support") > Signed-off-by: Arnd Bergmann <arnd@arndb.de> I folded these fixes into the pci/host-iproc branch for v4.10, thanks! For some reason, I don't see Ray's responses on the list. Maybe still some email problem? > --- > drivers/pci/host/pcie-iproc.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/pci/host/pcie-iproc.c b/drivers/pci/host/pcie-iproc.c > index d10e6aa32e0d..857ff5198317 100644 > --- a/drivers/pci/host/pcie-iproc.c > +++ b/drivers/pci/host/pcie-iproc.c > @@ -865,7 +865,7 @@ static int iproc_pcie_ib_write(struct iproc_pcie *pcie, int region_idx, > * Now program the IMAP registers. Each IARR region may have one or > * more IMAP windows. > */ > - size /= nr_windows; > + size >>= ilog2(nr_windows); > for (window_idx = 0; window_idx < nr_windows; window_idx++) { > val = readl(pcie->base + imap_offset); > val |= lower_32_bits(axi_addr) | IMAP_VALID; > -- > 2.9.0 > > > _______________________________________________ > linux-arm-kernel mailing list > linux-arm-kernel@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/drivers/pci/host/pcie-iproc.c b/drivers/pci/host/pcie-iproc.c index d10e6aa32e0d..857ff5198317 100644 --- a/drivers/pci/host/pcie-iproc.c +++ b/drivers/pci/host/pcie-iproc.c @@ -865,7 +865,7 @@ static int iproc_pcie_ib_write(struct iproc_pcie *pcie, int region_idx, * Now program the IMAP registers. Each IARR region may have one or * more IMAP windows. */ - size /= nr_windows; + size >>= ilog2(nr_windows); for (window_idx = 0; window_idx < nr_windows; window_idx++) { val = readl(pcie->base + imap_offset); val |= lower_32_bits(axi_addr) | IMAP_VALID;
The newly added code to setup the inbound ranges causes a link error on 32-bit machines from a 32-bit division: drivers/pci/host/pcie-iproc.o: In function `iproc_pcie_setup_ib': pcie-iproc.c:(.text.iproc_pcie_setup_ib+0x14c): undefined reference to `__aeabi_uldivmod' As both sides of the division are always power-of-two numbers and we already rely on that, we can use a shift instead. Fixes: 87c240b19bba ("PCI: iproc: Add inbound DMA mapping support") Signed-off-by: Arnd Bergmann <arnd@arndb.de> --- drivers/pci/host/pcie-iproc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)