[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3978e740-0589-4872-8f2f-1162084d3818@quicinc.com>
Date: Wed, 15 Oct 2025 12:25:00 +0530
From: Pavan Kondeti <pavan.kondeti@....qualcomm.com>
To: Shivendra Pratap <shivendra.pratap@....qualcomm.com>
Cc: Bartosz Golaszewski <bartosz.golaszewski@...aro.org>,
Bjorn Andersson <andersson@...nel.org>,
Sebastian Reichel <sre@...nel.org>, Rob Herring <robh@...nel.org>,
Sudeep Holla <sudeep.holla@....com>,
Souvik Chakravarty <Souvik.Chakravarty@....com>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>, Andy Yan <andy.yan@...k-chips.com>,
Mark Rutland <mark.rutland@....com>,
Lorenzo Pieralisi <lpieralisi@...nel.org>,
Arnd Bergmann <arnd@...db.de>, Konrad Dybcio <konradybcio@...nel.org>,
cros-qcom-dts-watchers@...omium.org, Vinod Koul <vkoul@...nel.org>,
Catalin Marinas <catalin.marinas@....com>,
Will Deacon <will@...nel.org>,
Florian Fainelli <florian.fainelli@...adcom.com>,
Moritz Fischer <moritz.fischer@...us.com>,
John Stultz <john.stultz@...aro.org>,
Matthias Brugger <matthias.bgg@...il.com>,
Krzysztof Kozlowski <krzk@...nel.org>,
Dmitry Baryshkov <dmitry.baryshkov@....qualcomm.com>,
Mukesh Ojha <mukesh.ojha@....qualcomm.com>,
Stephen Boyd <swboyd@...omium.org>,
Andre Draszik <andre.draszik@...aro.org>,
Kathiravan Thirumoorthy <kathiravan.thirumoorthy@....qualcomm.com>,
linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org,
devicetree@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-arm-msm@...r.kernel.org,
Elliot Berman <quic_eberman@...cinc.com>,
Srinivas Kandagatla <srini@...nel.org>,
Umang Chheda <umang.chheda@....qualcomm.com>
Subject: Re: [PATCH v16 07/14] firmware: psci: Implement vendor-specific
resets as reboot-mode
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.
> + return 0;
> +
> +err_register:
> + kfree(reboot);
> +err_kzalloc:
> + atomic_notifier_chain_unregister(&panic_notifier_list, &psci_panic_block);
> +err_notifier:
> + of_node_put(psci_np);
> + of_node_put(np);
> + return ret;
> +}
> +late_initcall(psci_init_vendor_reset)
> +
> static void __init psci_init_system_reset2(void)
> {
> int ret;
>
Powered by blists - more mailing lists