Devicetree fixes for v6.2, part 2:

- Fix handling of multiple OF framebuffer devices
 
 - Fix booting on Socionext Synquacer with bad 'dma-ranges' entries
 
 - Add DT binding .yamllint to .gitignore
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEktVUI4SxYhzZyEuo+vtdtY28YcMFAmPiyF0ACgkQ+vtdtY28
 YcNZpA//adsF6J/7vPo9SiRj/Y+EFZ2m2J1mUubMP4UEAGtfG+JnkOmvjTgO3Rar
 aYivXNh2pqKqvOEw35XR5donzeygTxr953W4xzGRrPW282tZeWBeeKfz0bikVguv
 v7WzTlmYVL1I6P5KCNB2C5f5zZEXdDc7dA3pJmt+IM5sjEuduhqwlrw57Rd0uRdM
 OZOjlrLiwA1I9AIo081EmoPHUAcsckgxJzFqdLvh8Vz1JT3n8Rtj1GXuWQvSAueX
 p8vu771QeVJSgzEuZfA4g5Nia9T30g2XhxeD5bBtgndGoKdE8j2AzMoghBODJABa
 hvKd1DV9jP14c9HV7M/kgFb8JBEmXnKpARiSIyoP/KXLVraJS3HpbOSgbuTgdrp5
 lGxLbb44NYGGbPt1Sl25XPInr2b3BMfto/pvve9G9863fcY6SUk5aDuGIx6pNBsl
 lufniFQbaFTLdidskQ7bm187L0QEE4wGMY1ZDs77elMaMdtP6THXfim2Scq1UAKt
 tKMgYUciL/nps7rHCovmS8iXvysU7qztw6+F1nlOJMrrDld7LgrOZffWAjBnbNDa
 z1RZY1O1uyIIMam8VgeBbdMNoiqNv+2MNWH9STpY74DqS3+o2+pXyJitMS6+1U7p
 Rhlzbiwei4F1E0rFZqSGcWsgx+yy7HlgsfnEOKGkWjoFmBik26k=
 =T25l
 -----END PGP SIGNATURE-----

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

Pull devicetree fixes from Rob Herring:

 - Fix handling of multiple OF framebuffer devices

 - Fix booting on Socionext Synquacer with bad 'dma-ranges' entries

 - Add DT binding .yamllint to .gitignore

* tag 'devicetree-fixes-for-6.2-2' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux:
  dt-bindings: interrupt-controller: arm,gic-v3: Fix typo in description of msi-controller property
  dt-bindings: Fix .gitignore
  of/address: Return an error when no valid dma-ranges are found
  of: Make OF framebuffer device names unique
This commit is contained in:
Linus Torvalds 2023-02-07 14:17:12 -08:00
commit 0983f6bf2b
4 changed files with 31 additions and 9 deletions

View File

@ -2,3 +2,8 @@
*.example.dts
/processed-schema*.yaml
/processed-schema*.json
#
# We don't want to ignore the following even if they are dot-files
#
!.yamllint

View File

@ -108,7 +108,7 @@ properties:
msi-controller:
description:
Only present if the Message Based Interrupt functionnality is
Only present if the Message Based Interrupt functionality is
being exposed by the HW, and the mbi-ranges property present.
mbi-ranges:

View File

@ -965,8 +965,19 @@ int of_dma_get_range(struct device_node *np, const struct bus_dma_region **map)
}
of_dma_range_parser_init(&parser, node);
for_each_of_range(&parser, &range)
for_each_of_range(&parser, &range) {
if (range.cpu_addr == OF_BAD_ADDR) {
pr_err("translation of DMA address(%llx) to CPU address failed node(%pOF)\n",
range.bus_addr, node);
continue;
}
num_ranges++;
}
if (!num_ranges) {
ret = -EINVAL;
goto out;
}
r = kcalloc(num_ranges + 1, sizeof(*r), GFP_KERNEL);
if (!r) {
@ -975,18 +986,16 @@ int of_dma_get_range(struct device_node *np, const struct bus_dma_region **map)
}
/*
* Record all info in the generic DMA ranges array for struct device.
* Record all info in the generic DMA ranges array for struct device,
* returning an error if we don't find any parsable ranges.
*/
*map = r;
of_dma_range_parser_init(&parser, node);
for_each_of_range(&parser, &range) {
pr_debug("dma_addr(%llx) cpu_addr(%llx) size(%llx)\n",
range.bus_addr, range.cpu_addr, range.size);
if (range.cpu_addr == OF_BAD_ADDR) {
pr_err("translation of DMA address(%llx) to CPU address failed node(%pOF)\n",
range.bus_addr, node);
if (range.cpu_addr == OF_BAD_ADDR)
continue;
}
r->cpu_start = range.cpu_addr;
r->dma_start = range.bus_addr;
r->size = range.size;

View File

@ -525,6 +525,7 @@ static int __init of_platform_default_populate_init(void)
if (IS_ENABLED(CONFIG_PPC)) {
struct device_node *boot_display = NULL;
struct platform_device *dev;
int display_number = 0;
int ret;
/* Check if we have a MacOS display without a node spec */
@ -555,16 +556,23 @@ static int __init of_platform_default_populate_init(void)
if (!of_get_property(node, "linux,opened", NULL) ||
!of_get_property(node, "linux,boot-display", NULL))
continue;
dev = of_platform_device_create(node, "of-display", NULL);
dev = of_platform_device_create(node, "of-display.0", NULL);
of_node_put(node);
if (WARN_ON(!dev))
return -ENOMEM;
boot_display = node;
display_number++;
break;
}
for_each_node_by_type(node, "display") {
char buf[14];
const char *of_display_format = "of-display.%d";
if (!of_get_property(node, "linux,opened", NULL) || node == boot_display)
continue;
of_platform_device_create(node, "of-display", NULL);
ret = snprintf(buf, sizeof(buf), of_display_format, display_number++);
if (ret < sizeof(buf))
of_platform_device_create(node, buf, NULL);
}
} else {