Devicetree fixes for v6.8:

- 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
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEktVUI4SxYhzZyEuo+vtdtY28YcMFAmXOLfMACgkQ+vtdtY28
 YcNTRQ//YdGGVejPw+i2Kic2EuMZYPOMhsf8CqX8Dw9uuAgBJ1MRwpynh+Ze6vzE
 6wL/29TE5T3zQ2JO0xpEGBJmKFqErnc5mJry8nKzK7I2mt4tdq+il+0Myr3c0JOs
 IU+5X7+GEyE2EZPZjz0fHNlsdcUSEBeRTn+iLOG65gOZCXZpe5yQk76yYLpLg4PR
 qRPAOQOlmjsLk8rf7b7qmEVrK+IxEXs19AH6bk+6CoXM41giS8qDBG5wSqnnPK77
 QghKTw9/6dgi24JSq3Y+YIJV3G/b5nLydTjjon9rMIu/wZHS3c1JC0jlqGjvpCM9
 vaxj7buczFGXZE/v1a2mb69OSauVqQhgM211GNtUClm1iaK6PSjMWCTHwVtzDHaS
 Dvl3iF+Y51xpooRItJxadj23N1iWmckwMiSoIJKRtBpJ2ZV+B/1OT4nH9OS+WmIu
 OFtGj0dnsIfX+JxA+zgQrgrUY+N9KLJi3yxzVd4zgq9AUIMI34a/Mq0lZs1lUbAF
 f30dUcj9GzrpPchsr+Nu0NUSsoZSPr6dA+2+JbOllkkI1u9OgG/B/NGvLwFX94ry
 20nymH1CFglE1gwG6LXcOBZCBJH57vh6zsETJfHEOJ4h7w3hcwXIvXlW7c72q6Jw
 LWWMdBBJ9xSGr8eJaKlGJYutIJ/7VwuSUgTv2k+5Gav4gfBlNHQ=
 =NqMr
 -----END PGP SIGNATURE-----

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
This commit is contained in:
Linus Torvalds 2024-02-15 10:19:55 -08:00
commit 339e2fca02
14 changed files with 71 additions and 64 deletions

View File

@ -28,7 +28,10 @@ $(obj)/%.example.dts: $(src)/%.yaml check_dtschema_version FORCE
find_all_cmd = find $(srctree)/$(src) \( -name '*.yaml' ! \
-name 'processed-schema*' \)
find_cmd = $(find_all_cmd) | sed 's|^$(srctree)/$(src)/||' | grep -F -e "$(subst :," -e ",$(DT_SCHEMA_FILES))" | sed 's|^|$(srctree)/$(src)/|'
find_cmd = $(find_all_cmd) | \
sed 's|^$(srctree)/||' | \
grep -F -e "$(subst :," -e ",$(DT_SCHEMA_FILES))" | \
sed 's|^|$(srctree)/|'
CHK_DT_DOCS := $(shell $(find_cmd))
quiet_cmd_yamllint = LINT $(src)

View File

@ -7,7 +7,8 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#
title: Ceva AHCI SATA Controller
maintainers:
- Piyush Mehta <piyush.mehta@amd.com>
- Mubin Sayyed <mubin.sayyed@amd.com>
- Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
description: |
The Ceva SATA controller mostly conforms to the AHCI interface with some

View File

@ -29,19 +29,22 @@ properties:
audio-ports:
description:
Array of 8-bit values, 2 values per DAI (Documentation/sound/soc/dai.rst).
Array of 2 values per DAI (Documentation/sound/soc/dai.rst).
The implementation allows one or two DAIs.
If two DAIs are defined, they must be of different type.
$ref: /schemas/types.yaml#/definitions/uint32-matrix
minItems: 1
maxItems: 2
items:
minItems: 1
items:
- description: |
The first value defines the DAI type: TDA998x_SPDIF or TDA998x_I2S
(see include/dt-bindings/display/tda998x.h).
enum: [ 1, 2 ]
- description:
The second value defines the tda998x AP_ENA reg content when the
DAI in question is used.
maximum: 0xff
'#sound-dai-cells':
enum: [ 0, 1 ]

View File

@ -12,7 +12,8 @@ description:
PS_MODE). Every pin can be configured as input/output.
maintainers:
- Piyush Mehta <piyush.mehta@amd.com>
- Mubin Sayyed <mubin.sayyed@amd.com>
- Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
properties:
compatible:

View File

@ -78,8 +78,8 @@ examples:
pcie@0 {
#address-cells = <3>;
#size-cells = <2>;
ranges = <0x0 0x0 0x0 0x0 0x0 0x0>;
reg = <0x0 0x0 0x0 0x0 0x0 0x0>;
ranges = <0x02000000 0x0 0x100000 0x10000000 0x0 0x0>;
reg = <0x0 0x1000>;
device_type = "pci";
switch@0,0 {

View File

@ -7,7 +7,8 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#
title: Zynq UltraScale+ MPSoC and Versal reset
maintainers:
- Piyush Mehta <piyush.mehta@amd.com>
- Mubin Sayyed <mubin.sayyed@amd.com>
- Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
description: |
The Zynq UltraScale+ MPSoC and Versal has several different resets.

View File

@ -42,7 +42,7 @@ properties:
resets:
description: Reset controller to reset the TPM
$ref: /schemas/types.yaml#/definitions/phandle
maxItems: 1
reset-gpios:
description: Output GPIO pin to reset the TPM

View File

@ -55,9 +55,12 @@ properties:
samsung,sysreg:
$ref: /schemas/types.yaml#/definitions/phandle-array
description: Should be phandle/offset pair. The phandle to the syscon node
which indicates the FSYSx sysreg interface and the offset of
the control register for UFS io coherency setting.
items:
- items:
- description: phandle to FSYSx sysreg node
- description: offset of the control register for UFS io coherency setting
description:
Phandle and offset to the FSYSx sysreg for UFS io coherency setting.
dma-coherent: true

View File

@ -7,7 +7,8 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#
title: Xilinx SuperSpeed DWC3 USB SoC controller
maintainers:
- Piyush Mehta <piyush.mehta@amd.com>
- Mubin Sayyed <mubin.sayyed@amd.com>
- Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
properties:
compatible:

View File

@ -16,8 +16,9 @@ description:
USB 2.0 traffic.
maintainers:
- Piyush Mehta <piyush.mehta@amd.com>
- Michal Simek <michal.simek@amd.com>
- Mubin Sayyed <mubin.sayyed@amd.com>
- Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
properties:
compatible:

View File

@ -7,7 +7,8 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#
title: Xilinx udc controller
maintainers:
- Piyush Mehta <piyush.mehta@amd.com>
- Mubin Sayyed <mubin.sayyed@amd.com>
- Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
properties:
compatible:

View File

@ -763,7 +763,9 @@ struct device_node *of_graph_get_port_parent(struct device_node *node)
/* Walk 3 levels up only if there is 'ports' node. */
for (depth = 3; depth && node; depth--) {
node = of_get_next_parent(node);
if (depth == 2 && !of_node_name_eq(node, "ports"))
if (depth == 2 && !of_node_name_eq(node, "ports") &&
!of_node_name_eq(node, "in-ports") &&
!of_node_name_eq(node, "out-ports"))
break;
}
return node;
@ -1063,36 +1065,6 @@ of_fwnode_device_get_match_data(const struct fwnode_handle *fwnode,
return of_device_get_match_data(dev);
}
static struct device_node *of_get_compat_node(struct device_node *np)
{
of_node_get(np);
while (np) {
if (!of_device_is_available(np)) {
of_node_put(np);
np = NULL;
}
if (of_property_present(np, "compatible"))
break;
np = of_get_next_parent(np);
}
return np;
}
static struct device_node *of_get_compat_node_parent(struct device_node *np)
{
struct device_node *parent, *node;
parent = of_get_parent(np);
node = of_get_compat_node(parent);
of_node_put(parent);
return node;
}
static void of_link_to_phandle(struct device_node *con_np,
struct device_node *sup_np)
{
@ -1222,10 +1194,10 @@ static struct device_node *parse_##fname(struct device_node *np, \
* parse_prop.prop_name: Name of property holding a phandle value
* parse_prop.index: For properties holding a list of phandles, this is the
* index into the list
* @get_con_dev: If the consumer node containing the property is never converted
* to a struct device, implement this ops so fw_devlink can use it
* to find the true consumer.
* @optional: Describes whether a supplier is mandatory or not
* @node_not_dev: The consumer node containing the property is never converted
* to a struct device. Instead, parse ancestor nodes for the
* compatible property to find a node corresponding to a device.
*
* Returns:
* parse_prop() return values are
@ -1236,15 +1208,15 @@ static struct device_node *parse_##fname(struct device_node *np, \
struct supplier_bindings {
struct device_node *(*parse_prop)(struct device_node *np,
const char *prop_name, int index);
struct device_node *(*get_con_dev)(struct device_node *np);
bool optional;
bool node_not_dev;
};
DEFINE_SIMPLE_PROP(clocks, "clocks", "#clock-cells")
DEFINE_SIMPLE_PROP(interconnects, "interconnects", "#interconnect-cells")
DEFINE_SIMPLE_PROP(iommus, "iommus", "#iommu-cells")
DEFINE_SIMPLE_PROP(mboxes, "mboxes", "#mbox-cells")
DEFINE_SIMPLE_PROP(io_channels, "io-channel", "#io-channel-cells")
DEFINE_SIMPLE_PROP(io_channels, "io-channels", "#io-channel-cells")
DEFINE_SIMPLE_PROP(interrupt_parent, "interrupt-parent", NULL)
DEFINE_SIMPLE_PROP(dmas, "dmas", "#dma-cells")
DEFINE_SIMPLE_PROP(power_domains, "power-domains", "#power-domain-cells")
@ -1262,7 +1234,6 @@ DEFINE_SIMPLE_PROP(pinctrl5, "pinctrl-5", NULL)
DEFINE_SIMPLE_PROP(pinctrl6, "pinctrl-6", NULL)
DEFINE_SIMPLE_PROP(pinctrl7, "pinctrl-7", NULL)
DEFINE_SIMPLE_PROP(pinctrl8, "pinctrl-8", NULL)
DEFINE_SIMPLE_PROP(remote_endpoint, "remote-endpoint", NULL)
DEFINE_SIMPLE_PROP(pwms, "pwms", "#pwm-cells")
DEFINE_SIMPLE_PROP(resets, "resets", "#reset-cells")
DEFINE_SIMPLE_PROP(leds, "leds", NULL)
@ -1328,6 +1299,17 @@ static struct device_node *parse_interrupts(struct device_node *np,
return of_irq_parse_one(np, index, &sup_args) ? NULL : sup_args.np;
}
static struct device_node *parse_remote_endpoint(struct device_node *np,
const char *prop_name,
int index)
{
/* Return NULL for index > 0 to signify end of remote-endpoints. */
if (!index || strcmp(prop_name, "remote-endpoint"))
return NULL;
return of_graph_get_remote_port_parent(np);
}
static const struct supplier_bindings of_supplier_bindings[] = {
{ .parse_prop = parse_clocks, },
{ .parse_prop = parse_interconnects, },
@ -1352,7 +1334,10 @@ static const struct supplier_bindings of_supplier_bindings[] = {
{ .parse_prop = parse_pinctrl6, },
{ .parse_prop = parse_pinctrl7, },
{ .parse_prop = parse_pinctrl8, },
{ .parse_prop = parse_remote_endpoint, .node_not_dev = true, },
{
.parse_prop = parse_remote_endpoint,
.get_con_dev = of_graph_get_port_parent,
},
{ .parse_prop = parse_pwms, },
{ .parse_prop = parse_resets, },
{ .parse_prop = parse_leds, },
@ -1403,8 +1388,8 @@ static int of_link_property(struct device_node *con_np, const char *prop_name)
while ((phandle = s->parse_prop(con_np, prop_name, i))) {
struct device_node *con_dev_np;
con_dev_np = s->node_not_dev
? of_get_compat_node_parent(con_np)
con_dev_np = s->get_con_dev
? s->get_con_dev(con_np)
: of_node_get(con_np);
matched = true;
i++;

View File

@ -50,6 +50,12 @@ static struct unittest_results {
failed; \
})
#ifdef CONFIG_OF_KOBJ
#define OF_KREF_READ(NODE) kref_read(&(NODE)->kobj.kref)
#else
#define OF_KREF_READ(NODE) 1
#endif
/*
* Expected message may have a message level other than KERN_INFO.
* 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)
pr_err("missing testcase data\n");
return;
}
prefs[i] = kref_read(&p[i]->kobj.kref);
prefs[i] = OF_KREF_READ(p[i]);
}
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)
unittest(rc == -EINVAL, "expected:%i got:%i\n", -EINVAL, rc);
for (i = 0; i < ARRAY_SIZE(p); ++i) {
unittest(prefs[i] == kref_read(&p[i]->kobj.kref),
unittest(prefs[i] == OF_KREF_READ(p[i]),
"provider%d: expected:%d got:%d\n",
i, prefs[i], kref_read(&p[i]->kobj.kref));
i, prefs[i], OF_KREF_READ(p[i]));
of_node_put(p[i]);
}
}

View File

@ -33,8 +33,8 @@ if [[ ! -d "${PDT}" ]]; then
fi
nodes_compatible=$(
for node_compat in $(find ${PDT} -name compatible); do
node=$(dirname "${node_compat}")
for node in $(find ${PDT} -type d); do
[ ! -f "${node}"/compatible ] && continue
# Check if node is available
if [[ -e "${node}"/status ]]; then
status=$(tr -d '\000' < "${node}"/status)
@ -46,10 +46,11 @@ nodes_compatible=$(
nodes_dev_bound=$(
IFS=$'\n'
for uevent in $(find /sys/devices -name uevent); do
if [[ -d "$(dirname "${uevent}")"/driver ]]; then
grep '^OF_FULLNAME=' "${uevent}" | sed -e 's|OF_FULLNAME=||'
fi
for dev_dir in $(find /sys/devices -type d); do
[ ! -f "${dev_dir}"/uevent ] && continue
[ ! -d "${dev_dir}"/driver ] && continue
grep '^OF_FULLNAME=' "${dev_dir}"/uevent | sed -e 's|OF_FULLNAME=||'
done
)