History

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

Pull devicetree fixes from Rob Herring: - Improve devlink dependency parsing for DT graphs - Fix devlink handling of io-channels dependencies - Fix PCI addressing in marvell,prestera example - A few schema fixes for property constraints - Improve performance of DT unprobed devices kselftest - Fix regression in DT_SCHEMA_FILES handling - Fix compile error in unittest for !OF_DYNAMIC * tag 'devicetree-fixes-for-6.8-1' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: dt-bindings: ufs: samsung,exynos-ufs: Add size constraints on "samsung,sysreg" of: property: Add in-ports/out-ports support to of_graph_get_port_parent() of: property: Improve finding the supplier of a remote-endpoint property of: property: Improve finding the consumer of a remote-endpoint property net: marvell,prestera: Fix example PCI bus addressing of: unittest: Fix compile in the non-dynamic case of: property: fix typo in io-channels dt-bindings: tpm: Drop type from "resets" dt-bindings: display: nxp,tda998x: Fix 'audio-ports' constraints dt-bindings: xilinx: replace Piyush Mehta maintainership kselftest: dt: Stop relying on dirname to improve performance dt-bindings: don't anchor DT_SCHEMA_FILES to bindings directory

Linus Torvalds committed 2 years ago

Commit 339e2fc2 parents a00cf19 4e06ec014 files · +71 −64Browse files

Unified · Split

14 files
  1. Documentation/devicetree/bindings/Makefile +4 −1
  2. Documentation/devicetree/bindings/ata/ceva,ahci-1v84.yaml +2 −1
  3. Documentation/devicetree/bindings/display/bridge/nxp,tda998x.yaml +5 −2
  4. Documentation/devicetree/bindings/gpio/xlnx,zynqmp-gpio-modepin.yaml +2 −1
  5. Documentation/devicetree/bindings/net/marvell,prestera.yaml +2 −2
  6. Documentation/devicetree/bindings/reset/xlnx,zynqmp-reset.yaml +2 −1
  7. Documentation/devicetree/bindings/tpm/tpm-common.yaml +1 −1
  8. Documentation/devicetree/bindings/ufs/samsung,exynos-ufs.yaml +6 −3
  9. Documentation/devicetree/bindings/usb/dwc3-xilinx.yaml +2 −1
  10. Documentation/devicetree/bindings/usb/microchip,usb5744.yaml +2 −1
  11. Documentation/devicetree/bindings/usb/xlnx,usb2.yaml +2 −1
  12. drivers/of/property.c +25 −40
  13. drivers/of/unittest.c +9 −3
  14. tools/testing/selftests/dt/test_unprobed_devices.sh +7 −6
Documentation/devicetree/bindings/Makefile+4−1
@@ -28,7 +28,10 @@ $(obj)/%.example.dts: $(src)/%.yaml check_dtschema_version FORCE · 27 unmodified lines
2828 find_all_cmd = find $(srctree)/$(src) \( -name '*.yaml' ! \
2929 -name 'processed-schema*' \)
3030
31−find_cmd = $(find_all_cmd) | sed 's|^$(srctree)/$(src)/||' | grep -F -e "$(subst :," -e ",$(DT_SCHEMA_FILES))" | sed 's|^|$(srctree)/$(src)/|'
31+find_cmd = $(find_all_cmd) | \
32+ sed 's|^$(srctree)/||' | \
33+ grep -F -e "$(subst :," -e ",$(DT_SCHEMA_FILES))" | \
34+ sed 's|^|$(srctree)/|'
3235 CHK_DT_DOCS := $(shell $(find_cmd))
3336
3437 quiet_cmd_yamllint = LINT $(src)
Documentation/devicetree/bindings/ata/ceva,ahci-1v84.yaml+2−1
@@ -7,7 +7,8 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# · 6 unmodified lines
77 title: Ceva AHCI SATA Controller
88
99 maintainers:
10− - Piyush Mehta <piyush.mehta@amd.com>
10+ - Mubin Sayyed <mubin.sayyed@amd.com>
11+ - Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
1112
1213 description: |
1314 The Ceva SATA controller mostly conforms to the AHCI interface with some
Documentation/devicetree/bindings/display/bridge/nxp,tda998x.yaml+5−2
@@ -29,19 +29,22 @@ properties: · 28 unmodified lines
2929
3030 audio-ports:
3131 description:
32− Array of 8-bit values, 2 values per DAI (Documentation/sound/soc/dai.rst).
32+ Array of 2 values per DAI (Documentation/sound/soc/dai.rst).
3333 The implementation allows one or two DAIs.
3434 If two DAIs are defined, they must be of different type.
3535 $ref: /schemas/types.yaml#/definitions/uint32-matrix
36+ minItems: 1
37+ maxItems: 2
3638 items:
37− minItems: 1
3839 items:
3940 - description: |
4041 The first value defines the DAI type: TDA998x_SPDIF or TDA998x_I2S
4142 (see include/dt-bindings/display/tda998x.h).
43+ enum: [ 1, 2 ]
4244 - description:
4345 The second value defines the tda998x AP_ENA reg content when the
4446 DAI in question is used.
47+ maximum: 0xff
4548
4649 '#sound-dai-cells':
4750 enum: [ 0, 1 ]
Documentation/devicetree/bindings/gpio/xlnx,zynqmp-gpio-modepin.yaml+2−1
@@ -12,7 +12,8 @@ description: · 11 unmodified lines
1212 PS_MODE). Every pin can be configured as input/output.
1313
1414 maintainers:
15− - Piyush Mehta <piyush.mehta@amd.com>
15+ - Mubin Sayyed <mubin.sayyed@amd.com>
16+ - Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
1617
1718 properties:
1819 compatible:
Documentation/devicetree/bindings/net/marvell,prestera.yaml+2−2
@@ -78,8 +78,8 @@ examples: · 77 unmodified lines
7878 pcie@0 {
7979 #address-cells = <3>;
8080 #size-cells = <2>;
81− ranges = <0x0 0x0 0x0 0x0 0x0 0x0>;
82− reg = <0x0 0x0 0x0 0x0 0x0 0x0>;
81+ ranges = <0x02000000 0x0 0x100000 0x10000000 0x0 0x0>;
82+ reg = <0x0 0x1000>;
8383 device_type = "pci";
8484
8585 switch@0,0 {
Documentation/devicetree/bindings/reset/xlnx,zynqmp-reset.yaml+2−1
@@ -7,7 +7,8 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# · 6 unmodified lines
77 title: Zynq UltraScale+ MPSoC and Versal reset
88
99 maintainers:
10− - Piyush Mehta <piyush.mehta@amd.com>
10+ - Mubin Sayyed <mubin.sayyed@amd.com>
11+ - Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
1112
1213 description: |
1314 The Zynq UltraScale+ MPSoC and Versal has several different resets.
Documentation/devicetree/bindings/tpm/tpm-common.yaml+1−1
@@ -42,7 +42,7 @@ properties: · 41 unmodified lines
4242
4343 resets:
4444 description: Reset controller to reset the TPM
45− $ref: /schemas/types.yaml#/definitions/phandle
45+ maxItems: 1
4646
4747 reset-gpios:
4848 description: Output GPIO pin to reset the TPM
Documentation/devicetree/bindings/ufs/samsung,exynos-ufs.yaml+6−3
@@ -55,9 +55,12 @@ properties: · 54 unmodified lines
5555
5656 samsung,sysreg:
5757 $ref: /schemas/types.yaml#/definitions/phandle-array
58− description: Should be phandle/offset pair. The phandle to the syscon node
59− which indicates the FSYSx sysreg interface and the offset of
60− the control register for UFS io coherency setting.
58+ items:
59+ - items:
60+ - description: phandle to FSYSx sysreg node
61+ - description: offset of the control register for UFS io coherency setting
62+ description:
63+ Phandle and offset to the FSYSx sysreg for UFS io coherency setting.
6164
6265 dma-coherent: true
6366
Documentation/devicetree/bindings/usb/dwc3-xilinx.yaml+2−1
@@ -7,7 +7,8 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# · 6 unmodified lines
77 title: Xilinx SuperSpeed DWC3 USB SoC controller
88
99 maintainers:
10− - Piyush Mehta <piyush.mehta@amd.com>
10+ - Mubin Sayyed <mubin.sayyed@amd.com>
11+ - Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
1112
1213 properties:
1314 compatible:
Documentation/devicetree/bindings/usb/microchip,usb5744.yaml+2−1
@@ -16,8 +16,9 @@ description: · 15 unmodified lines
1616 USB 2.0 traffic.
1717
1818 maintainers:
19− - Piyush Mehta <piyush.mehta@amd.com>
2019 - Michal Simek <michal.simek@amd.com>
20+ - Mubin Sayyed <mubin.sayyed@amd.com>
21+ - Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
2122
2223 properties:
2324 compatible:
Documentation/devicetree/bindings/usb/xlnx,usb2.yaml+2−1
@@ -7,7 +7,8 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# · 6 unmodified lines
77 title: Xilinx udc controller
88
99 maintainers:
10− - Piyush Mehta <piyush.mehta@amd.com>
10+ - Mubin Sayyed <mubin.sayyed@amd.com>
11+ - Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
1112
1213 properties:
1314 compatible:
drivers/of/property.c+25−40
@@ -763,7 +763,9 @@ struct device_node *of_graph_get_port_parent(struct device_node *node) · 762 unmodified lines
763763 /* Walk 3 levels up only if there is 'ports' node. */
764764 for (depth = 3; depth && node; depth--) {
765765 node = of_get_next_parent(node);
766− if (depth == 2 && !of_node_name_eq(node, "ports"))
766+ if (depth == 2 && !of_node_name_eq(node, "ports") &&
767+ !of_node_name_eq(node, "in-ports") &&
768+ !of_node_name_eq(node, "out-ports"))
767769 break;
768770 }
769771 return node;
@@ -1063,36 +1065,6 @@ of_fwnode_device_get_match_data(const struct fwnode_handle *fwnode, · 293 unmodified lines
10631065 return of_device_get_match_data(dev);
10641066 }
10651067
1066−static struct device_node *of_get_compat_node(struct device_node *np)
1067−{
1068− of_node_get(np);
1069−
1070− while (np) {
1071− if (!of_device_is_available(np)) {
1072− of_node_put(np);
1073− np = NULL;
1074− }
1075−
1076− if (of_property_present(np, "compatible"))
1077− break;
1078−
1079− np = of_get_next_parent(np);
1080− }
1081−
1082− return np;
1083−}
1084−
1085−static struct device_node *of_get_compat_node_parent(struct device_node *np)
1086−{
1087− struct device_node *parent, *node;
1088−
1089− parent = of_get_parent(np);
1090− node = of_get_compat_node(parent);
1091− of_node_put(parent);
1092−
1093− return node;
1094−}
1095−
10961068 static void of_link_to_phandle(struct device_node *con_np,
10971069 struct device_node *sup_np)
10981070 {
@@ -1222,10 +1194,10 @@ static struct device_node *parse_##fname(struct device_node *np, \ · 123 unmodified lines
12221194 * parse_prop.prop_name: Name of property holding a phandle value
12231195 * parse_prop.index: For properties holding a list of phandles, this is the
12241196 * index into the list
1197+ * @get_con_dev: If the consumer node containing the property is never converted
1198+ * to a struct device, implement this ops so fw_devlink can use it
1199+ * to find the true consumer.
12251200 * @optional: Describes whether a supplier is mandatory or not
1226− * @node_not_dev: The consumer node containing the property is never converted
1227− * to a struct device. Instead, parse ancestor nodes for the
1228− * compatible property to find a node corresponding to a device.
12291201 *
12301202 * Returns:
12311203 * parse_prop() return values are
@@ -1236,15 +1208,15 @@ static struct device_node *parse_##fname(struct device_node *np, \ · 4 unmodified lines
12361208 struct supplier_bindings {
12371209 struct device_node *(*parse_prop)(struct device_node *np,
12381210 const char *prop_name, int index);
1211+ struct device_node *(*get_con_dev)(struct device_node *np);
12391212 bool optional;
1240− bool node_not_dev;
12411213 };
12421214
12431215 DEFINE_SIMPLE_PROP(clocks, "clocks", "#clock-cells")
12441216 DEFINE_SIMPLE_PROP(interconnects, "interconnects", "#interconnect-cells")
12451217 DEFINE_SIMPLE_PROP(iommus, "iommus", "#iommu-cells")
12461218 DEFINE_SIMPLE_PROP(mboxes, "mboxes", "#mbox-cells")
1247−DEFINE_SIMPLE_PROP(io_channels, "io-channel", "#io-channel-cells")
1219+DEFINE_SIMPLE_PROP(io_channels, "io-channels", "#io-channel-cells")
12481220 DEFINE_SIMPLE_PROP(interrupt_parent, "interrupt-parent", NULL)
12491221 DEFINE_SIMPLE_PROP(dmas, "dmas", "#dma-cells")
12501222 DEFINE_SIMPLE_PROP(power_domains, "power-domains", "#power-domain-cells")
@@ -1262,7 +1234,6 @@ DEFINE_SIMPLE_PROP(pinctrl5, "pinctrl-5", NULL) · 11 unmodified lines
12621234 DEFINE_SIMPLE_PROP(pinctrl6, "pinctrl-6", NULL)
12631235 DEFINE_SIMPLE_PROP(pinctrl7, "pinctrl-7", NULL)
12641236 DEFINE_SIMPLE_PROP(pinctrl8, "pinctrl-8", NULL)
1265−DEFINE_SIMPLE_PROP(remote_endpoint, "remote-endpoint", NULL)
12661237 DEFINE_SIMPLE_PROP(pwms, "pwms", "#pwm-cells")
12671238 DEFINE_SIMPLE_PROP(resets, "resets", "#reset-cells")
12681239 DEFINE_SIMPLE_PROP(leds, "leds", NULL)
@@ -1328,6 +1299,17 @@ static struct device_node *parse_interrupts(struct device_node *np, · 59 unmodified lines
13281299 return of_irq_parse_one(np, index, &sup_args) ? NULL : sup_args.np;
13291300 }
13301301
1302+static struct device_node *parse_remote_endpoint(struct device_node *np,
1303+ const char *prop_name,
1304+ int index)
1305+{
1306+ /* Return NULL for index > 0 to signify end of remote-endpoints. */
1307+ if (!index || strcmp(prop_name, "remote-endpoint"))
1308+ return NULL;
1309+
1310+ return of_graph_get_remote_port_parent(np);
1311+}
1312+
13311313 static const struct supplier_bindings of_supplier_bindings[] = {
13321314 { .parse_prop = parse_clocks, },
13331315 { .parse_prop = parse_interconnects, },
@@ -1352,7 +1334,10 @@ static const struct supplier_bindings of_supplier_bindings[] = { · 18 unmodified lines
13521334 { .parse_prop = parse_pinctrl6, },
13531335 { .parse_prop = parse_pinctrl7, },
13541336 { .parse_prop = parse_pinctrl8, },
1355− { .parse_prop = parse_remote_endpoint, .node_not_dev = true, },
1337+ {
1338+ .parse_prop = parse_remote_endpoint,
1339+ .get_con_dev = of_graph_get_port_parent,
1340+ },
13561341 { .parse_prop = parse_pwms, },
13571342 { .parse_prop = parse_resets, },
13581343 { .parse_prop = parse_leds, },
@@ -1403,8 +1388,8 @@ static int of_link_property(struct device_node *con_np, const char *prop_name) · 44 unmodified lines
14031388 while ((phandle = s->parse_prop(con_np, prop_name, i))) {
14041389 struct device_node *con_dev_np;
14051390
1406− con_dev_np = s->node_not_dev
1407− ? of_get_compat_node_parent(con_np)
1391+ con_dev_np = s->get_con_dev
1392+ ? s->get_con_dev(con_np)
14081393 : of_node_get(con_np);
14091394 matched = true;
14101395 i++;
drivers/of/unittest.c+9−3
@@ -50,6 +50,12 @@ static struct unittest_results { · 49 unmodified lines
5050 failed; \
5151 })
5252
53+#ifdef CONFIG_OF_KOBJ
54+#define OF_KREF_READ(NODE) kref_read(&(NODE)->kobj.kref)
55+#else
56+#define OF_KREF_READ(NODE) 1
57+#endif
58+
5359 /*
5460 * Expected message may have a message level other than KERN_INFO.
5561 * Print the expected message only if the current loglevel will allow
@@ -570,7 +576,7 @@ static void __init of_unittest_parse_phandle_with_args_map(void) · 514 unmodified lines
570576 pr_err("missing testcase data\n");
571577 return;
572578 }
573− prefs[i] = kref_read(&p[i]->kobj.kref);
579+ prefs[i] = OF_KREF_READ(p[i]);
574580 }
575581
576582 rc = of_count_phandle_with_args(np, "phandle-list", "#phandle-cells");
@@ -693,9 +699,9 @@ static void __init of_unittest_parse_phandle_with_args_map(void) · 116 unmodified lines
693699 unittest(rc == -EINVAL, "expected:%i got:%i\n", -EINVAL, rc);
694700
695701 for (i = 0; i < ARRAY_SIZE(p); ++i) {
696− unittest(prefs[i] == kref_read(&p[i]->kobj.kref),
702+ unittest(prefs[i] == OF_KREF_READ(p[i]),
697703 "provider%d: expected:%d got:%d\n",
698− i, prefs[i], kref_read(&p[i]->kobj.kref));
704+ i, prefs[i], OF_KREF_READ(p[i]));
699705 of_node_put(p[i]);
700706 }
701707 }
tools/testing/selftests/dt/test_unprobed_devices.sh+7−6
@@ -33,8 +33,8 @@ if [[ ! -d "${PDT}" ]]; then · 32 unmodified lines
3333 fi
3434
3535 nodes_compatible=$(
36− for node_compat in $(find ${PDT} -name compatible); do
37− node=$(dirname "${node_compat}")
36+ for node in $(find ${PDT} -type d); do
37+ [ ! -f "${node}"/compatible ] && continue
3838 # Check if node is available
3939 if [[ -e "${node}"/status ]]; then
4040 status=$(tr -d '\000' < "${node}"/status)
@@ -46,10 +46,11 @@ nodes_compatible=$( · 5 unmodified lines
4646
4747 nodes_dev_bound=$(
4848 IFS=$'\n'
49− for uevent in $(find /sys/devices -name uevent); do
50− if [[ -d "$(dirname "${uevent}")"/driver ]]; then
51− grep '^OF_FULLNAME=' "${uevent}" | sed -e 's|OF_FULLNAME=||'
52− fi
49+ for dev_dir in $(find /sys/devices -type d); do
50+ [ ! -f "${dev_dir}"/uevent ] && continue
51+ [ ! -d "${dev_dir}"/driver ] && continue
52+
53+ grep '^OF_FULLNAME=' "${dev_dir}"/uevent | sed -e 's|OF_FULLNAME=||'
5354 done
5455 )
5556

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t