linux-stable/drivers/of
Geert Uytterhoeven 48ab6d5d1f dma-mapping: fix 32-bit overflow with CONFIG_ARM_LPAE=n
On r8a7791/koelsch and shmobile_defconfig, PCIe probing fails with:

    rcar-pcie fe000000.pcie: Adjusted size 0x0 invalid
    rcar-pcie: probe of fe000000.pcie failed with error -22

of_dma_get_range() returns the following map:

    cpu_start 0x40000000 dma_start 0x40000000 size 0x080000000 offset 0
    cpu_start 0x00000000 dma_start 0x00000000 size 0x100000000 offset 0

If CONFIG_ARM_LPAE=n, dma_addr_t is 32-bit.  Hence when assigning
r->dma_start + r->size to dma_end, this value will be truncated to
32-bit, yielding zero when processing the second table entry.
Consequently, both dma_start and dma_end will be zero, leading to a zero
size.

Fix this by changing the dma_start and dma_end variables from dma_addr_t
to u64.

Fixes: e0d072782c ("dma-mapping: introduce DMA range map, supplanting dma_pfn_offset")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2020-10-29 16:59:34 +01:00
..
unittest-data of: unittest: Use bigger address cells to catch parser regressions 2020-08-03 16:24:49 -06:00
address.c dma-mapping: introduce DMA range map, supplanting dma_pfn_offset 2020-09-17 18:43:56 +02:00
base.c of: Export of_remove_property() to modules 2020-09-05 13:09:03 -07:00
device.c dma-mapping: fix 32-bit overflow with CONFIG_ARM_LPAE=n 2020-10-29 16:59:34 +01:00
dynamic.c of: of_detach_node() remove unneeded local return variable 2020-04-14 07:59:54 -05:00
fdt.c of/fdt: Remove redundant kbasename function call 2020-05-28 20:57:17 -06:00
fdt_address.c
irq.c of/irq: Make of_msi_map_rid() PCI bus agnostic 2020-07-28 15:51:32 +01:00
Kconfig net: phy: Move of_mdio from drivers/of to drivers/net/mdio 2020-10-10 10:55:05 -07:00
kobj.c of: Fix a refcounting bug in __of_attach_node_sysfs() 2020-05-27 19:30:25 -06:00
Makefile net: phy: Move of_mdio from drivers/of to drivers/net/mdio 2020-10-10 10:55:05 -07:00
of_net.c
of_numa.c
of_private.h dma-mapping: introduce DMA range map, supplanting dma_pfn_offset 2020-09-17 18:43:56 +02:00
of_reserved_mem.c of: Fix reserved-memory overlap detection 2020-10-25 20:37:55 -05:00
overlay.c of: overlay: kmemleak in dup_and_fixup_symbol_prop() 2020-04-17 08:31:34 -05:00
pdt.c
platform.c of: platform: Destroy child devices symmetrically 2020-08-17 20:19:35 -06:00
property.c drm next for 5.9-rc1 2020-08-05 19:50:06 -07:00
resolver.c
unittest.c dma-mapping: introduce DMA range map, supplanting dma_pfn_offset 2020-09-17 18:43:56 +02:00