android_kernel_xiaomi_sm8450/drivers/of
Mark Brown edaf5c7183 of/address: Return an error when no valid dma-ranges are found
commit f6933c01e42d2fc83b9133ed755609e4aac6eadd upstream.

Commit 7a8b64d17e ("of/address: use range parser for of_dma_get_range")
converted the parsing of dma-range properties to use code shared with the
PCI range parser. The intent was to introduce no functional changes however
in the case where we fail to translate the first resource instead of
returning -EINVAL the new code we return 0. Restore the previous behaviour
by returning an error if we find no valid ranges, the original code only
handled the first range but subsequently support for parsing all supplied
ranges was added.

This avoids confusing code using the parsed ranges which doesn't expect to
successfully parse ranges but have only a list terminator returned, this
fixes breakage with so far as I can tell all DMA for on SoC devices on the
Socionext Synquacer platform which has a firmware supplied DT. A bisect
identified the original conversion as triggering the issues there.

Fixes: 7a8b64d17e ("of/address: use range parser for of_dma_get_range")
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: Luca Di Stefano <luca.distefano@linaro.org>
Cc: 993612@bugs.debian.org
Cc: stable@kernel.org
Link: https://lore.kernel.org/r/20230126-synquacer-boot-v2-1-cb80fd23c4e2@kernel.org
Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-02-15 17:22:22 +01:00
..
unittest-data of: unittest: Use bigger address cells to catch parser regressions 2020-08-03 16:24:49 -06:00
address.c of/address: Return an error when no valid dma-ranges are found 2023-02-15 17:22:22 +01:00
base.c of: base: Improve argument length mismatch error 2022-01-27 10:54:28 +01:00
device.c of/device: Update dma_range_map only when dev has valid dma-ranges 2021-02-03 23:28:50 +01:00
dynamic.c of: of_detach_node() remove unneeded local return variable 2020-04-14 07:59:54 -05:00
fdt_address.c of: Use SPDX license tag for DT files 2018-01-08 08:22:45 -06:00
fdt.c of: fdt: fix off-by-one error in unflatten_dt_nodes() 2022-09-23 14:16:57 +02:00
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: Don't allow __of_attached_node_sysfs() without CONFIG_SYSFS 2021-09-18 13:40:31 +02: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 net: of_get_phy_mode: Change API to solve int/unit warnings 2019-11-04 11:21:25 -08:00
of_numa.c of, numa: Validate some distance map rules 2018-11-08 12:44:34 -06:00
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 truncation of memory sizes on 32-bit platforms 2021-07-14 16:56:46 +02:00
overlay.c of: overlay: fix null pointer dereferencing in find_dup_cset_node_entry() and find_dup_cset_prop() 2023-01-14 10:15:42 +01:00
pdt.c of: Remove struct device_node.type pointer 2019-01-10 16:24:44 -06:00
platform.c of: platform: Destroy child devices symmetrically 2020-08-17 20:19:35 -06:00
property.c of: property: decrement node refcount in of_fwnode_get_reference_args() 2022-12-08 11:23:55 +01:00
resolver.c of: overlay: log the error cause on resolver failure 2020-03-02 11:32:44 -06:00
unittest.c of: unittest: 64 bit dma address test requires arch support 2022-01-27 10:54:07 +01:00