From: Aleksander Jan Bajkowski olek2@wp.pl
[ Upstream commit d66949a1875352d2ddd52b144333288952a9e36f ]
This fixes the following warning: arch/mips/boot/dts/lantiq/danube_easy50712.dtb: pci@e105400 (lantiq,pci-xway): 'device_type' is a required property from schema $id: http://devicetree.org/schemas/pci/pci-bus-common.yaml#
Signed-off-by: Aleksander Jan Bajkowski olek2@wp.pl Signed-off-by: Thomas Bogendoerfer tsbogend@alpha.franken.de Signed-off-by: Sasha Levin sashal@kernel.org ---
LLM Generated explanations, may be completely bogus:
YES
- What changed: The patch adds `device_type = "pci";` to the PCI host bridge node `pci@e105400` in `arch/mips/boot/dts/lantiq/danube.dtsi:108`. The node already had proper `#address-cells = <3>`, `#size-cells = <2>`, `#interrupt-cells = <1>`, `compatible = "lantiq,pci-xway"`, `bus-range`, `ranges` (with both memory and IO windows), and `reg` (see arch/mips/boot/dts/lantiq/danube.dtsi:97-106). The only missing piece was the `device_type` property.
- Why it matters (binding/spec): The PCI bus binding requires `device_type = "pci"` on PCI bus nodes (commit message cites the DT schema error), so this is a correctness fix to match devicetree bindings.
- Why it matters (runtime): Linux uses the `device_type` property to recognize PCI bus nodes and select the PCI bus translator in the OF address translation code. Specifically: - The bus matcher for PCI requires `device_type = "pci"` (or `pciex`, or a node name “pcie”) to identify the node as a PCI bus (drivers/of/address.c: of_bus_pci_match). - If `device_type` is missing on a node named “pci@…”, the generic “default-flags” bus is selected instead of the PCI bus. That leads to incorrect parsing of the `ranges` flags. - MIPS PCI host setup for Lantiq calls `pci_load_of_ranges(&pci_controller, pdev->dev.of_node)` (arch/mips/pci/pci-lantiq.c:219), which iterates `for_each_of_pci_range` and switches on `range.flags & IORESOURCE_TYPE_BITS` to configure the I/O and MEM windows (arch/mips/pci/pci-legacy.c:145-177). Without the PCI bus translator, those flags are not decoded as `IORESOURCE_IO`/`IORESOURCE_MEM`, so ranges may be skipped or misclassified, breaking I/O space mapping and potentially PCI host initialization.
- Scope and risk: The change is a single-line DTS fix, confined to the Lantiq Danube SoC. It does not introduce new features or architectural changes. It aligns with many other MIPS PCI DTs that already set `device_type = "pci"`, and it brings the node into compliance with the binding and the kernel’s OF bus matching logic. Regression risk is minimal; the intended behavior is precisely to have this node recognized as a PCI bus.
- Stable criteria: - Fixes a real defect (schema error and likely functional mis-parsing of PCI ranges on this platform). - Small and self-contained (one DTS line). - No architectural churn; no cross-subsystem impact. - Touches a platform DTS; DT ABI impact is corrective and consistent with binding requirements.
Given the above, backporting this fix will eliminate binding violations and prevent incorrect PCI resource setup on Lantiq Danube systems.
arch/mips/boot/dts/lantiq/danube.dtsi | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/arch/mips/boot/dts/lantiq/danube.dtsi b/arch/mips/boot/dts/lantiq/danube.dtsi index 0a942bc091436..650400bd5725f 100644 --- a/arch/mips/boot/dts/lantiq/danube.dtsi +++ b/arch/mips/boot/dts/lantiq/danube.dtsi @@ -104,6 +104,8 @@ pci0: pci@e105400 { 0x1000000 0 0x00000000 0xae00000 0 0x200000>; /* io space */ reg = <0x7000000 0x8000 /* config space */ 0xe105400 0x400>; /* pci bridge */ + + device_type = "pci"; }; }; };