Commit bcde95ce authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'devicetree-fixes-for-6.13-1' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux

Pull devicetree fixes from Rob Herring:

 - Disable #address-cells/#size-cells warning on coreboot (Chromebooks)
   platforms

 - Add missing root #address-cells/#size-cells in default empty DT

 - Fix uninitialized variable in of_irq_parse_one()

 - Fix interrupt-map cell length check in of_irq_parse_imap_parent()

 - Fix refcount handling in __of_get_dma_parent()

 - Fix error path in of_parse_phandle_with_args_map()

 - Fix dma-ranges handling with flags cells

 - Drop explicit fw_devlink handling of 'interrupt-parent'

 - Fix "compression" typo in fixed-partitions binding

 - Unify "fsl,liodn" property type definitions

* tag 'devicetree-fixes-for-6.13-1' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux:
  of: Add coreboot firmware to excluded default cells list
  of/irq: Fix using uninitialized variable @addr_len in API of_irq_parse_one()
  of/irq: Fix interrupt-map cell length check in of_irq_parse_imap_parent()
  of: Fix refcount leakage for OF node returned by __of_get_dma_parent()
  of: Fix error path in of_parse_phandle_with_args_map()
  dt-bindings: mtd: fixed-partitions: Fix "compression" typo
  of: Add #address-cells/#size-cells in the device-tree root empty node
  dt-bindings: Unify "fsl,liodn" type definitions
  of: address: Preserve the flags portion on 1:1 dma-ranges mapping
  of/unittest: Add empty dma-ranges address translation tests
  of: property: fw_devlink: Do not use interrupt-parent directly
parents 48f506ad 8600058b
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -114,8 +114,9 @@ patternProperties:
          table that specifies the PPID to LIODN mapping. Needed if the PAMU is
          used.  Value is a 12 bit value where value is a LIODN ID for this JR.
          This property is normally set by boot firmware.
        $ref: /schemas/types.yaml#/definitions/uint32
        maximum: 0xfff
        $ref: /schemas/types.yaml#/definitions/uint32-array
        items:
          - maximum: 0xfff

  '^rtic@[0-9a-f]+$':
    type: object
@@ -186,8 +187,9 @@ patternProperties:
              Needed if the PAMU is used.  Value is a 12 bit value where value
              is a LIODN ID for this JR. This property is normally set by boot
              firmware.
            $ref: /schemas/types.yaml#/definitions/uint32
            maximum: 0xfff
            $ref: /schemas/types.yaml#/definitions/uint32-array
            items:
              - maximum: 0xfff

          fsl,rtic-region:
            description:
+1 −1
Original line number Diff line number Diff line
@@ -82,7 +82,7 @@ examples:

        uimage@100000 {
            reg = <0x0100000 0x200000>;
            compress = "lzma";
            compression = "lzma";
        };
    };

+2 −0
Original line number Diff line number Diff line
@@ -35,6 +35,7 @@ properties:

  fsl,liodn:
    $ref: /schemas/types.yaml#/definitions/uint32-array
    maxItems: 2
    description: See pamu.txt. Two LIODN(s). DQRR LIODN (DLIODN) and Frame LIODN
      (FLIODN)

@@ -69,6 +70,7 @@ patternProperties:
    type: object
    properties:
      fsl,liodn:
        $ref: /schemas/types.yaml#/definitions/uint32-array
        description: See pamu.txt, PAMU property used for static LIODN assignment

      fsl,iommu-parent:
+3 −2
Original line number Diff line number Diff line
@@ -459,7 +459,8 @@ static int of_translate_one(const struct device_node *parent, const struct of_bu
	}
	if (ranges == NULL || rlen == 0) {
		offset = of_read_number(addr, na);
		memset(addr, 0, pna * 4);
		/* set address to zero, pass flags through */
		memset(addr + pbus->flag_cells, 0, (pna - pbus->flag_cells) * 4);
		pr_debug("empty ranges; 1:1 translation\n");
		goto finish;
	}
@@ -619,7 +620,7 @@ struct device_node *__of_get_dma_parent(const struct device_node *np)
	if (ret < 0)
		return of_get_parent(np);

	return of_node_get(args.np);
	return args.np;
}
#endif

+12 −6
Original line number Diff line number Diff line
@@ -88,7 +88,8 @@ static bool __of_node_is_type(const struct device_node *np, const char *type)
}

#define EXCLUDED_DEFAULT_CELLS_PLATFORMS ( \
	IS_ENABLED(CONFIG_SPARC) \
	IS_ENABLED(CONFIG_SPARC) || \
	of_find_compatible_node(NULL, NULL, "coreboot") \
)

int of_bus_n_addr_cells(struct device_node *np)
@@ -1507,8 +1508,10 @@ int of_parse_phandle_with_args_map(const struct device_node *np,
			map_len--;

			/* Check if not found */
			if (!new)
			if (!new) {
				ret = -EINVAL;
				goto put;
			}

			if (!of_device_is_available(new))
				match = 0;
@@ -1518,17 +1521,20 @@ int of_parse_phandle_with_args_map(const struct device_node *np,
				goto put;

			/* Check for malformed properties */
			if (WARN_ON(new_size > MAX_PHANDLE_ARGS))
				goto put;
			if (map_len < new_size)
			if (WARN_ON(new_size > MAX_PHANDLE_ARGS) ||
			    map_len < new_size) {
				ret = -EINVAL;
				goto put;
			}

			/* Move forward by new node's #<list>-cells amount */
			map += new_size;
			map_len -= new_size;
		}
		if (!match)
		if (!match) {
			ret = -ENOENT;
			goto put;
		}

		/* Get the <list>-map-pass-thru property (optional) */
		pass = of_get_property(cur, pass_name, NULL);
Loading