[PATCH v4 2/5] arm64: ras: Add Device Tree frontend
Rob Herring
robh at kernel.org
Wed Nov 18 11:25:43 PST 2026
On Wed, Nov 18, 2026 at 12:48:21AM +0530, Umang Chheda wrote:
> Add a Device Tree frontend for the ARM64 RAS driver, allowing it
> to be used on platforms without ACPI firmware.
>
> The error sources defined in DT are registered as arm64_ras platform
> devices at boot. The frontend produces the same software fwnode properties
> as the ACPI path, so the core driver probes DT and ACPI nodes identically
> without any firmware-specific knowledge.
>
> Signed-off-by: Umang Chheda <umang.chheda at oss.qualcomm.com>
[...]
> + ret = platform_device_add(pdev);
> + if (ret)
> + goto err_put;
> +
> + pr_debug("registered RAS node %pOF as arm64_ras.%d\n", np, pdev->id);
> + return 0;
> +
> +err_put:
> + platform_device_put(pdev);
> + return ret;
> +}
> +
> +static int __init ras_of_init(void)
> +{
> + const struct of_device_id *match;
> + struct device_node *np;
> + int index = 0, ret;
> +
> + if (!acpi_disabled)
> + return 0;
> +
> + for_each_matching_node_and_match(np, ras_of_match, &match) {
> + u8 node_type = *(const unsigned long *)match->data;
> +
> + ret = ras_of_init_one_node(np, node_type, index++);
Why are you rolling your own platform device creation? The DT
infrastructure will create devices for you. And likely you are getting 2
devices for every node because you are not setting flags on the nodes to
prevent that. But setting the flag is not the right thing. Moving all
this code to driver probe is the right thing. That probably means some
refactoring have a common probe function that the DT and ACPI probe
functions can call (assuming there can't just be one common probe).
Rob
More information about the linux-arm-kernel
mailing list