Skip to contentSkip to conversation

Linux RISC-V AIA Preparatory Series

PATCH New Anup Patel 1 participant 3 messages Oct 27, 2023

Subsystems (2)
lore
Share & tools
lore

Anup Patel

author
#0 lore raw

v2 cover Linux RISC-V AIA Preparatory Series

The first three patches of the v11 Linux RISC-V AIA series can be merged independently hence sending these patches as an independent perparatory series.
(Refer, https://www.spinics.net/lists/devicetree/msg643764.html)

These patches can also be found in the riscv_aia_prep_v2 branch at:
https://github.com/avpatel/linux.git

Changes since v1:
- Use imperative wording in PATCH1 commit description
- Dropped PATCH3 since it is already merged by Thomas

Anup Patel (2):
RISC-V: Don't fail in riscv_of_parent_hartid() for disabled HARTs
of: property: Add fw_devlink support for msi-parent

 arch/riscv/kernel/cpu.c | 11 ++++++-----
 drivers/of/property.c   |  2 ++
 2 files changed, 8 insertions(+), 5 deletions(-)
Signature · 1 line
2.34.1
author
#1 lore raw

PATCH v2 1/2 RISC-V: Don't fail in riscv_of_parent_hartid() for disabled HARTs

The riscv_of_processor_hartid() used by riscv_of_parent_hartid() fails for HARTs disabled in the DT. This results in the following warning thrown by the RISC-V INTC driver for the E-core on SiFive boards:

[    0.000000] riscv-intc: unable to find hart id for /cpus/cpu@0/interrupt-controller

The riscv_of_parent_hartid() is only expected to read the hartid from the DT so we directly call of_get_cpu_hwid() instead of calling riscv_of_processor_hartid().

Fixes ad635e723e17 ("riscv: cpu: Add 64bit hartid support on RV64")
---
 arch/riscv/kernel/cpu.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
arch/riscv/kernel/cpu.c +6 -5
index c17dacb1141c..157ace8b262c 100644
@@ -125,13 +125,14 @@ int __init riscv_early_of_processor_hartid(struct device_node *node, unsigned lo
  */
 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;
 		}
 	}
 
Signature · 1 line
2.34.1
author
#2 lore raw

PATCH v2 2/2 of: property: Add fw_devlink support for msi-parent

In reply to Anup Patel

This allows fw_devlink to create device links between consumers of a MSI and the supplier of the MSI.

---
 drivers/of/property.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/of/property.c +2 -0
index cf8dacf3e3b8..afdaefbd03f6 100644
@@ -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, },
Signature · 1 line
2.34.1