Merge patch series "Linux RISC-V AIA Preparatory Series"
authorPalmer Dabbelt <palmer@rivosinc.com>
Thu, 9 Nov 2023 02:57:17 +0000 (18:57 -0800)
committerPalmer Dabbelt <palmer@rivosinc.com>
Thu, 9 Nov 2023 02:57:17 +0000 (18:57 -0800)
These two  ended up in the AIA series, but they're really independent
improvements.

* b4-shazam-merge:
  of: property: Add fw_devlink support for msi-parent
  RISC-V: Don't fail in riscv_of_parent_hartid() for disabled HARTs

Link: https://lore.kernel.org/r/20231027154254.355853-1-apatel@ventanamicro.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
arch/riscv/kernel/cpu.c
drivers/of/property.c

index bcfc0c8dfd0131b92391ba8fa0f2dcc4864c8954..d11d6320fb0d2db489f221ab2527297a247fd304 100644 (file)
@@ -125,13 +125,14 @@ old_interface:
  */
 int riscv_of_parent_hartid(struct device_node *node, unsigned long *hartid)
 {
-       int rc;
-
        for (; node; node = node->parent) {
                if (of_device_is_compatible(node, "riscv")) {
-                       rc = riscv_of_processor_hartid(node, hartid);
-                       if (!rc)
-                               return 0;
+                       *hartid = (unsigned long)of_get_cpu_hwid(node, 0);
+                       if (*hartid == ~0UL) {
+                               pr_warn("Found CPU without hart ID\n");
+                               return -ENODEV;
+                       }
+                       return 0;
                }
        }
 
index cf8dacf3e3b84d8a56aae6aa1bd79da7cf8e7fea..afdaefbd03f61563c2b2972ff0c64266d3acaa9e 100644 (file)
@@ -1267,6 +1267,7 @@ DEFINE_SIMPLE_PROP(resets, "resets", "#reset-cells")
 DEFINE_SIMPLE_PROP(leds, "leds", NULL)
 DEFINE_SIMPLE_PROP(backlight, "backlight", NULL)
 DEFINE_SIMPLE_PROP(panel, "panel", NULL)
+DEFINE_SIMPLE_PROP(msi_parent, "msi-parent", "#msi-cells")
 DEFINE_SUFFIX_PROP(regulators, "-supply", NULL)
 DEFINE_SUFFIX_PROP(gpio, "-gpio", "#gpio-cells")
 
@@ -1356,6 +1357,7 @@ static const struct supplier_bindings of_supplier_bindings[] = {
        { .parse_prop = parse_leds, },
        { .parse_prop = parse_backlight, },
        { .parse_prop = parse_panel, },
+       { .parse_prop = parse_msi_parent, },
        { .parse_prop = parse_gpio_compat, },
        { .parse_prop = parse_interrupts, },
        { .parse_prop = parse_regulators, },