Skip to content

Commit f9a619e

Browse files
Merge patch series "Linux RISC-V AIA Preparatory Series"
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/[email protected] Signed-off-by: Palmer Dabbelt <[email protected]>
2 parents 05942f7 + c5e4ce9 commit f9a619e

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

arch/riscv/kernel/cpu.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -125,13 +125,14 @@ int __init riscv_early_of_processor_hartid(struct device_node *node, unsigned lo
125125
*/
126126
int riscv_of_parent_hartid(struct device_node *node, unsigned long *hartid)
127127
{
128-
int rc;
129-
130128
for (; node; node = node->parent) {
131129
if (of_device_is_compatible(node, "riscv")) {
132-
rc = riscv_of_processor_hartid(node, hartid);
133-
if (!rc)
134-
return 0;
130+
*hartid = (unsigned long)of_get_cpu_hwid(node, 0);
131+
if (*hartid == ~0UL) {
132+
pr_warn("Found CPU without hart ID\n");
133+
return -ENODEV;
134+
}
135+
return 0;
135136
}
136137
}
137138

drivers/of/property.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1267,6 +1267,7 @@ DEFINE_SIMPLE_PROP(resets, "resets", "#reset-cells")
12671267
DEFINE_SIMPLE_PROP(leds, "leds", NULL)
12681268
DEFINE_SIMPLE_PROP(backlight, "backlight", NULL)
12691269
DEFINE_SIMPLE_PROP(panel, "panel", NULL)
1270+
DEFINE_SIMPLE_PROP(msi_parent, "msi-parent", "#msi-cells")
12701271
DEFINE_SUFFIX_PROP(regulators, "-supply", NULL)
12711272
DEFINE_SUFFIX_PROP(gpio, "-gpio", "#gpio-cells")
12721273

@@ -1356,6 +1357,7 @@ static const struct supplier_bindings of_supplier_bindings[] = {
13561357
{ .parse_prop = parse_leds, },
13571358
{ .parse_prop = parse_backlight, },
13581359
{ .parse_prop = parse_panel, },
1360+
{ .parse_prop = parse_msi_parent, },
13591361
{ .parse_prop = parse_gpio_compat, },
13601362
{ .parse_prop = parse_interrupts, },
13611363
{ .parse_prop = parse_regulators, },

0 commit comments

Comments
 (0)