Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1246110
| From | Ray Jui <rjui@broadcom.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] PCI: iproc: fix 32-bit build error |
| Date | 2015-10-13 22:20 +0200 |
| Message-ID | <qjedc-o2-11@gated-at.bofh.it> (permalink) |
| References | <q98Vs-5ap-13@gated-at.bofh.it> <q9958-5lJ-5@gated-at.bofh.it> <qjc1I-5sd-33@gated-at.bofh.it> <qje3w-cv-33@gated-at.bofh.it> <qje3w-cv-31@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On 10/13/2015 1:06 PM, Hauke Mehrtens wrote:
> On 10/13/2015 10:02 PM, Arnd Bergmann wrote:
>> The iproc PCI driver tries to figure out whether the MMIO window has
>> a valid size, but does this using a 64-bit modulo operation, which
>> is not allowed on 32-bit kernels and leads to a link error:
>>
>> drivers/built-in.o: In function `iproc_pcie_setup':
>> :(.text+0x4b798): undefined reference to `__aeabi_uldivmod'
>>
>> This works around that error by using the div64_u64() function
>> provided by the kernel. While this is an expensive operation,
>> it is harmless because we only call it during the probing
>> of the driver.
>>
Thanks, Arnd. Guess I did not see this issue when running on ARM32 based
platforms like Cygnus, because LAPE was not enabled by default for
multi_v7_defconfig. When LAPE is enabled, resource_size_t becomes 64-bit.
>> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>> Fixes: 0ab99ca8eb6c ("PCI: iproc: Fix compile warnings")
>>
>> diff --git a/drivers/pci/host/pcie-iproc.c b/drivers/pci/host/pcie-iproc.c
>> index f3481ddff344..abcb4be2ee19 100644
>> --- a/drivers/pci/host/pcie-iproc.c
>> +++ b/drivers/pci/host/pcie-iproc.c
>> @@ -235,12 +235,13 @@ static void iproc_pcie_enable(struct iproc_pcie *pcie)
>> *
>> * axi_addr -> iproc_pcie_address -> OARR -> OMAP -> pci_address
>> */
>> -static int iproc_pcie_setup_ob(struct iproc_pcie *pcie, u64 axi_addr,
>> +int iproc_pcie_setup_ob(struct iproc_pcie *pcie, u64 axi_addr,
>
> Why are you removing the static here?
>
Yeah we should keep this function as static. The rest of this change
looks good!
>> u64 pci_addr, resource_size_t size)
>> {
>> struct iproc_pcie_ob *ob = &pcie->ob;
>> unsigned i;
>> u64 max_size = (u64)ob->window_size * MAX_NUM_OB_WINDOWS;
>> + u64 remainder;
>>
>> if (size > max_size) {
>> dev_err(pcie->dev,
>> @@ -249,7 +250,8 @@ static int iproc_pcie_setup_ob(struct iproc_pcie *pcie, u64 axi_addr,
>> return -EINVAL;
>> }
>>
>> - if (size % ob->window_size) {
>> + div64_u64_rem(size, ob->window_size, &remainder);
>> + if (remainder) {
>> dev_err(pcie->dev,
>> "res size %pap needs to be multiple of window size %pap\n",
>> &size, &ob->window_size);
>>
>
Thanks,
Ray
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: [PATCH 7/8] PCI: iproc: Add outbound mapping support Kevin Hilman <khilman@kernel.org> - 2015-10-13 20:00 +0200
Re: [PATCH] PCI: iproc: fix 32-bit build error Hauke Mehrtens <hauke@hauke-m.de> - 2015-10-13 22:10 +0200
Re: [PATCH] PCI: iproc: fix 32-bit build error Ray Jui <rjui@broadcom.com> - 2015-10-13 22:20 +0200
Re: [PATCH] PCI: iproc: fix 32-bit build error Arnd Bergmann <arnd@arndb.de> - 2015-10-13 23:10 +0200
Re: [PATCH] PCI: iproc: fix 32-bit build error Bjorn Helgaas <helgaas@kernel.org> - 2015-10-15 18:10 +0200
Re: [PATCH] PCI: iproc: fix 32-bit build error Ray Jui <rjui@broadcom.com> - 2015-10-15 18:20 +0200
[PATCH v2] PCI: iproc: fix 32-bit build error Arnd Bergmann <arnd@arndb.de> - 2015-10-15 21:50 +0200
Re: [PATCH v2] PCI: iproc: fix 32-bit build error Hauke Mehrtens <hauke@hauke-m.de> - 2015-10-15 23:00 +0200
Re: [PATCH v2] PCI: iproc: fix 32-bit build error Bjorn Helgaas <helgaas@kernel.org> - 2015-10-15 23:10 +0200
Re: [PATCH v2] PCI: iproc: fix 32-bit build error Arnd Bergmann <arnd@arndb.de> - 2015-10-16 11:50 +0200
Re: [PATCH v2] PCI: iproc: fix 32-bit build error Bjorn Helgaas <helgaas@kernel.org> - 2015-10-16 15:30 +0200
[PATCH] PCI: iproc: fix 32-bit build error Arnd Bergmann <arnd@arndb.de> - 2015-10-13 22:10 +0200
Re: [PATCH] PCI: iproc: fix 32-bit build error Kevin Hilman <khilman@kernel.org> - 2015-10-13 23:30 +0200
csiph-web