Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

+71 -64
+4 -1
Documentation/devicetree/bindings/Makefile
··· 28 28 find_all_cmd = find $(srctree)/$(src) \( -name '*.yaml' ! \ 29 29 -name 'processed-schema*' \) 30 30 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)/|' 32 35 CHK_DT_DOCS := $(shell $(find_cmd)) 33 36 34 37 quiet_cmd_yamllint = LINT $(src)
+2 -1
Documentation/devicetree/bindings/ata/ceva,ahci-1v84.yaml
··· 7 7 title: Ceva AHCI SATA Controller 8 8 9 9 maintainers: 10 - - Piyush Mehta <piyush.mehta@amd.com> 10 + - Mubin Sayyed <mubin.sayyed@amd.com> 11 + - Radhey Shyam Pandey <radhey.shyam.pandey@amd.com> 11 12 12 13 description: | 13 14 The Ceva SATA controller mostly conforms to the AHCI interface with some
+5 -2
Documentation/devicetree/bindings/display/bridge/nxp,tda998x.yaml
··· 29 29 30 30 audio-ports: 31 31 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). 33 33 The implementation allows one or two DAIs. 34 34 If two DAIs are defined, they must be of different type. 35 35 $ref: /schemas/types.yaml#/definitions/uint32-matrix 36 + minItems: 1 37 + maxItems: 2 36 38 items: 37 - minItems: 1 38 39 items: 39 40 - description: | 40 41 The first value defines the DAI type: TDA998x_SPDIF or TDA998x_I2S 41 42 (see include/dt-bindings/display/tda998x.h). 43 + enum: [ 1, 2 ] 42 44 - description: 43 45 The second value defines the tda998x AP_ENA reg content when the 44 46 DAI in question is used. 47 + maximum: 0xff 45 48 46 49 '#sound-dai-cells': 47 50 enum: [ 0, 1 ]
+2 -1
Documentation/devicetree/bindings/gpio/xlnx,zynqmp-gpio-modepin.yaml
··· 12 12 PS_MODE). Every pin can be configured as input/output. 13 13 14 14 maintainers: 15 - - Piyush Mehta <piyush.mehta@amd.com> 15 + - Mubin Sayyed <mubin.sayyed@amd.com> 16 + - Radhey Shyam Pandey <radhey.shyam.pandey@amd.com> 16 17 17 18 properties: 18 19 compatible:
+2 -2
Documentation/devicetree/bindings/net/marvell,prestera.yaml
··· 78 78 pcie@0 { 79 79 #address-cells = <3>; 80 80 #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>; 83 83 device_type = "pci"; 84 84 85 85 switch@0,0 {
+2 -1
Documentation/devicetree/bindings/reset/xlnx,zynqmp-reset.yaml
··· 7 7 title: Zynq UltraScale+ MPSoC and Versal reset 8 8 9 9 maintainers: 10 - - Piyush Mehta <piyush.mehta@amd.com> 10 + - Mubin Sayyed <mubin.sayyed@amd.com> 11 + - Radhey Shyam Pandey <radhey.shyam.pandey@amd.com> 11 12 12 13 description: | 13 14 The Zynq UltraScale+ MPSoC and Versal has several different resets.
+1 -1
Documentation/devicetree/bindings/tpm/tpm-common.yaml
··· 42 42 43 43 resets: 44 44 description: Reset controller to reset the TPM 45 - $ref: /schemas/types.yaml#/definitions/phandle 45 + maxItems: 1 46 46 47 47 reset-gpios: 48 48 description: Output GPIO pin to reset the TPM
+6 -3
Documentation/devicetree/bindings/ufs/samsung,exynos-ufs.yaml
··· 55 55 56 56 samsung,sysreg: 57 57 $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. 61 64 62 65 dma-coherent: true 63 66
+2 -1
Documentation/devicetree/bindings/usb/dwc3-xilinx.yaml
··· 7 7 title: Xilinx SuperSpeed DWC3 USB SoC controller 8 8 9 9 maintainers: 10 - - Piyush Mehta <piyush.mehta@amd.com> 10 + - Mubin Sayyed <mubin.sayyed@amd.com> 11 + - Radhey Shyam Pandey <radhey.shyam.pandey@amd.com> 11 12 12 13 properties: 13 14 compatible:
+2 -1
Documentation/devicetree/bindings/usb/microchip,usb5744.yaml
··· 16 16 USB 2.0 traffic. 17 17 18 18 maintainers: 19 - - Piyush Mehta <piyush.mehta@amd.com> 20 19 - Michal Simek <michal.simek@amd.com> 20 + - Mubin Sayyed <mubin.sayyed@amd.com> 21 + - Radhey Shyam Pandey <radhey.shyam.pandey@amd.com> 21 22 22 23 properties: 23 24 compatible:
+2 -1
Documentation/devicetree/bindings/usb/xlnx,usb2.yaml
··· 7 7 title: Xilinx udc controller 8 8 9 9 maintainers: 10 - - Piyush Mehta <piyush.mehta@amd.com> 10 + - Mubin Sayyed <mubin.sayyed@amd.com> 11 + - Radhey Shyam Pandey <radhey.shyam.pandey@amd.com> 11 12 12 13 properties: 13 14 compatible:
+25 -40
drivers/of/property.c
··· 763 763 /* Walk 3 levels up only if there is 'ports' node. */ 764 764 for (depth = 3; depth && node; depth--) { 765 765 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")) 767 769 break; 768 770 } 769 771 return node; ··· 1065 1063 return of_device_get_match_data(dev); 1066 1064 } 1067 1065 1068 - static struct device_node *of_get_compat_node(struct device_node *np) 1069 - { 1070 - of_node_get(np); 1071 - 1072 - while (np) { 1073 - if (!of_device_is_available(np)) { 1074 - of_node_put(np); 1075 - np = NULL; 1076 - } 1077 - 1078 - if (of_property_present(np, "compatible")) 1079 - break; 1080 - 1081 - np = of_get_next_parent(np); 1082 - } 1083 - 1084 - return np; 1085 - } 1086 - 1087 - static struct device_node *of_get_compat_node_parent(struct device_node *np) 1088 - { 1089 - struct device_node *parent, *node; 1090 - 1091 - parent = of_get_parent(np); 1092 - node = of_get_compat_node(parent); 1093 - of_node_put(parent); 1094 - 1095 - return node; 1096 - } 1097 - 1098 1066 static void of_link_to_phandle(struct device_node *con_np, 1099 1067 struct device_node *sup_np) 1100 1068 { ··· 1194 1222 * parse_prop.prop_name: Name of property holding a phandle value 1195 1223 * parse_prop.index: For properties holding a list of phandles, this is the 1196 1224 * index into the list 1225 + * @get_con_dev: If the consumer node containing the property is never converted 1226 + * to a struct device, implement this ops so fw_devlink can use it 1227 + * to find the true consumer. 1197 1228 * @optional: Describes whether a supplier is mandatory or not 1198 - * @node_not_dev: The consumer node containing the property is never converted 1199 - * to a struct device. Instead, parse ancestor nodes for the 1200 - * compatible property to find a node corresponding to a device. 1201 1229 * 1202 1230 * Returns: 1203 1231 * parse_prop() return values are ··· 1208 1236 struct supplier_bindings { 1209 1237 struct device_node *(*parse_prop)(struct device_node *np, 1210 1238 const char *prop_name, int index); 1239 + struct device_node *(*get_con_dev)(struct device_node *np); 1211 1240 bool optional; 1212 - bool node_not_dev; 1213 1241 }; 1214 1242 1215 1243 DEFINE_SIMPLE_PROP(clocks, "clocks", "#clock-cells") 1216 1244 DEFINE_SIMPLE_PROP(interconnects, "interconnects", "#interconnect-cells") 1217 1245 DEFINE_SIMPLE_PROP(iommus, "iommus", "#iommu-cells") 1218 1246 DEFINE_SIMPLE_PROP(mboxes, "mboxes", "#mbox-cells") 1219 - DEFINE_SIMPLE_PROP(io_channels, "io-channel", "#io-channel-cells") 1247 + DEFINE_SIMPLE_PROP(io_channels, "io-channels", "#io-channel-cells") 1220 1248 DEFINE_SIMPLE_PROP(interrupt_parent, "interrupt-parent", NULL) 1221 1249 DEFINE_SIMPLE_PROP(dmas, "dmas", "#dma-cells") 1222 1250 DEFINE_SIMPLE_PROP(power_domains, "power-domains", "#power-domain-cells") ··· 1234 1262 DEFINE_SIMPLE_PROP(pinctrl6, "pinctrl-6", NULL) 1235 1263 DEFINE_SIMPLE_PROP(pinctrl7, "pinctrl-7", NULL) 1236 1264 DEFINE_SIMPLE_PROP(pinctrl8, "pinctrl-8", NULL) 1237 - DEFINE_SIMPLE_PROP(remote_endpoint, "remote-endpoint", NULL) 1238 1265 DEFINE_SIMPLE_PROP(pwms, "pwms", "#pwm-cells") 1239 1266 DEFINE_SIMPLE_PROP(resets, "resets", "#reset-cells") 1240 1267 DEFINE_SIMPLE_PROP(leds, "leds", NULL) ··· 1299 1328 return of_irq_parse_one(np, index, &sup_args) ? NULL : sup_args.np; 1300 1329 } 1301 1330 1331 + static struct device_node *parse_remote_endpoint(struct device_node *np, 1332 + const char *prop_name, 1333 + int index) 1334 + { 1335 + /* Return NULL for index > 0 to signify end of remote-endpoints. */ 1336 + if (!index || strcmp(prop_name, "remote-endpoint")) 1337 + return NULL; 1338 + 1339 + return of_graph_get_remote_port_parent(np); 1340 + } 1341 + 1302 1342 static const struct supplier_bindings of_supplier_bindings[] = { 1303 1343 { .parse_prop = parse_clocks, }, 1304 1344 { .parse_prop = parse_interconnects, }, ··· 1334 1352 { .parse_prop = parse_pinctrl6, }, 1335 1353 { .parse_prop = parse_pinctrl7, }, 1336 1354 { .parse_prop = parse_pinctrl8, }, 1337 - { .parse_prop = parse_remote_endpoint, .node_not_dev = true, }, 1355 + { 1356 + .parse_prop = parse_remote_endpoint, 1357 + .get_con_dev = of_graph_get_port_parent, 1358 + }, 1338 1359 { .parse_prop = parse_pwms, }, 1339 1360 { .parse_prop = parse_resets, }, 1340 1361 { .parse_prop = parse_leds, }, ··· 1388 1403 while ((phandle = s->parse_prop(con_np, prop_name, i))) { 1389 1404 struct device_node *con_dev_np; 1390 1405 1391 - con_dev_np = s->node_not_dev 1392 - ? of_get_compat_node_parent(con_np) 1406 + con_dev_np = s->get_con_dev 1407 + ? s->get_con_dev(con_np) 1393 1408 : of_node_get(con_np); 1394 1409 matched = true; 1395 1410 i++;
+9 -3
drivers/of/unittest.c
··· 50 50 failed; \ 51 51 }) 52 52 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 + 53 59 /* 54 60 * Expected message may have a message level other than KERN_INFO. 55 61 * Print the expected message only if the current loglevel will allow ··· 576 570 pr_err("missing testcase data\n"); 577 571 return; 578 572 } 579 - prefs[i] = kref_read(&p[i]->kobj.kref); 573 + prefs[i] = OF_KREF_READ(p[i]); 580 574 } 581 575 582 576 rc = of_count_phandle_with_args(np, "phandle-list", "#phandle-cells"); ··· 699 693 unittest(rc == -EINVAL, "expected:%i got:%i\n", -EINVAL, rc); 700 694 701 695 for (i = 0; i < ARRAY_SIZE(p); ++i) { 702 - unittest(prefs[i] == kref_read(&p[i]->kobj.kref), 696 + unittest(prefs[i] == OF_KREF_READ(p[i]), 703 697 "provider%d: expected:%d got:%d\n", 704 - i, prefs[i], kref_read(&p[i]->kobj.kref)); 698 + i, prefs[i], OF_KREF_READ(p[i])); 705 699 of_node_put(p[i]); 706 700 } 707 701 }
+7 -6
tools/testing/selftests/dt/test_unprobed_devices.sh
··· 33 33 fi 34 34 35 35 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 38 38 # Check if node is available 39 39 if [[ -e "${node}"/status ]]; then 40 40 status=$(tr -d '\000' < "${node}"/status) ··· 46 46 47 47 nodes_dev_bound=$( 48 48 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=||' 53 54 done 54 55 ) 55 56