linux/drivers/of
Marc Zyngier e7985f4360 of: property: Fix fw_devlink handling of interrupt-map
Commit d976c6f4b3 ("of: property: Add fw_devlink support for
interrupt-map property") tried to do what it says on the tin,
but failed on a couple of points:

- it confuses bytes and cells. Not a huge deal, except when it
  comes to pointer arithmetic

- it doesn't really handle anything but interrupt-maps that have
  their parent #address-cells set to 0

The combinations of the two leads to some serious fun on my M1
box, with plenty of WARN-ON() firing all over the shop, and
amusing values being generated for interrupt specifiers.

Having 2 versions of parsing code for "interrupt-map" was a bad
idea. Now that the common parsing parts have been refactored
into of_irq_parse_imap_parent(), rework the code here to use it
instead and fix the pointer arithmetic.

Note that the dependency will be a bit different than the original code
when the interrupt-map points to another interrupt-map. In this case,
the original code would resolve to the final interrupt controller. Now
the dependency is the parent interrupt-map (which itself should have a
dependency to the parent). It is possible that a node with an
interrupt-map has no driver.

Fixes: d976c6f4b3 ("of: property: Add fw_devlink support for interrupt-map property")
Signed-off-by: Marc Zyngier <maz@kernel.org>
Co-developed-by: Rob Herring (Arm) <robh@kernel.org>
Cc: Saravana Kannan <saravanak@google.com>
Tested-by: Marc Zyngier <maz@kernel.org>
Tested-by: Anup Patel <apatel@ventanamicro.com>
Link: https://lore.kernel.org/r/20240529-dt-interrupt-map-fix-v2-2-ef86dc5bcd2a@kernel.org
Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
2024-05-30 19:43:47 -05:00
..
unittest-data of: Fix double free in of_parse_phandle_with_args_map 2024-01-09 12:54:02 -06:00
.kunitconfig of: Add KUnit test to confirm DTB is loaded 2024-03-08 12:50:39 -06:00
address.c of: Use scope based of_node_put() cleanups 2024-04-15 08:40:40 -05:00
base.c of: Use scope based kfree() cleanups 2024-04-15 08:40:40 -05:00
cpu.c of: Move CPU node related functions to their own file 2023-04-13 17:46:34 -05:00
device.c dma-mapping: Simplify arch_setup_dma_ops() 2024-04-26 12:07:28 +02:00
dynamic.c Devicetree for v6.10: 2024-05-17 17:27:49 -07:00
empty_root.dts of: Create of_root if no dtb provided by firmware 2024-03-08 12:50:39 -06:00
fdt.c of: Move all FDT reserved-memory handling into of_reserved_mem.c 2024-03-12 09:23:26 -06:00
fdt_address.c
irq.c of/irq: Factor out parsing of interrupt-map parent phandle+args from of_irq_parse_raw() 2024-05-30 19:43:19 -05:00
Kconfig of: Add KUnit test to confirm DTB is loaded 2024-03-08 12:50:39 -06:00
kexec.c arm64, crash: wrap crash dumping code into crash related ifdefs 2024-02-23 17:48:23 -08:00
kobj.c of: make of_node_ktype constant 2023-02-06 11:03:00 -06:00
Makefile of: Add KUnit test to confirm DTB is loaded 2024-03-08 12:50:39 -06:00
module.c Devicetree for v6.10: 2024-05-17 17:27:49 -07:00
of_numa.c of, numa: Fetch empty NUMA node ID from distance map 2021-10-04 13:13:44 -05:00
of_private.h of/irq: Factor out parsing of interrupt-map parent phandle+args from of_irq_parse_raw() 2024-05-30 19:43:19 -05:00
of_reserved_mem.c of: reserved_mem: Remove the use of phandle from the reserved_mem APIs 2024-05-03 07:49:13 -05:00
of_test.c of: of_test: add MODULE_DESCRIPTION() 2024-05-28 12:10:00 -05:00
overlay.c of: Add a helper to free property struct 2024-04-15 08:40:40 -05:00
pdt.c
platform.c of: Create of_root if no dtb provided by firmware 2024-03-08 12:50:39 -06:00
property.c of: property: Fix fw_devlink handling of interrupt-map 2024-05-30 19:43:47 -05:00
resolver.c of: Use scope based kfree() cleanups 2024-04-15 08:40:40 -05:00
unittest.c I2C core removes an argument from the i2c_mux_add_adapter() call to 2024-05-20 08:55:18 -07:00