[PATCH v16 07/14] firmware: psci: Implement vendor-specific resets as reboot-mode
Shivendra Pratap
shivendra.pratap at oss.qualcomm.com
Wed Oct 15 00:47:01 PDT 2025
On 10/15/2025 12:25 PM, Pavan Kondeti wrote:
> On Wed, Oct 15, 2025 at 10:08:22AM +0530, Shivendra Pratap wrote:
>> +static int __init psci_init_vendor_reset(void)
>> +{
>> + struct reboot_mode_driver *reboot;
>> + struct device_node *psci_np;
>> + struct device_node *np;
>> + int ret;
>> +
>> + if (!psci_system_reset2_supported)
>> + return -EINVAL;
>> +
>> + psci_np = of_find_compatible_node(NULL, NULL, "arm,psci-1.0");
>> + if (!psci_np)
>> + return -ENODEV;
>> +
>> + np = of_find_node_by_name(psci_np, "reboot-mode");
>> + if (!np) {
>> + of_node_put(psci_np);
>> + return -ENODEV;
>> + }
>> +
>> + ret = atomic_notifier_chain_register(&panic_notifier_list, &psci_panic_block);
>> + if (ret)
>> + goto err_notifier;
>> +
>> + reboot = kzalloc(sizeof(*reboot), GFP_KERNEL);
>> + if (!reboot) {
>> + ret = -ENOMEM;
>> + goto err_kzalloc;
>> + }
>> +
>> + reboot->write = psci_set_vendor_sys_reset2;
>> + reboot->driver_name = "psci";
>> +
>> + ret = reboot_mode_register(reboot, of_fwnode_handle(np));
>> + if (ret)
>> + goto err_register;
>> +
>
> minor nit: np and psci_np reference must be dropped since we are done
> using it.
Ack. Sure. thanks. Will update this.
thanks,
Shivendra
More information about the linux-arm-kernel
mailing list