Re: [PATCH v4 2/5] arm64: ras: Add Device Tree frontend
From: Umang Chheda
Date: Mon Nov 30 2026 - 07:30:05 EST
Hello Rob,
On 11/19/2026 12:55 AM, Rob Herring wrote:
> 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@xxxxxxxxxxxxxxxx>
>
> [...]
>
>> + 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).
Thanks for the review. The intent was to reuse the existing ACPI flow,
but I agree this is not the right DT approach.
I'll rework this to use normal DT device population and refactor the
common initialization logic so it can be shared between the ACPI and DT
paths.
>
> Rob
Thanks,
Umang