* [PATCH] PCI: meson: Propagate devm_add_action_or_reset() failure
@ 2026-05-18 8:04 Shuvam Pandey
2026-05-18 12:56 ` Neil Armstrong
2026-06-09 16:25 ` Manivannan Sadhasivam
0 siblings, 2 replies; 3+ messages in thread
From: Shuvam Pandey @ 2026-05-18 8:04 UTC (permalink / raw)
To: Yue Wang, Lorenzo Pieralisi
Cc: linux-pci, linux-amlogic, linux-arm-kernel, linux-kernel
meson_pcie_probe_clock() enables a clock and then registers a devres
action to disable it during teardown. If devm_add_action_or_reset()
fails, it runs the action immediately, disabling the clock.
The return value is currently ignored, so on that failure path
meson_pcie_probe_clock() returns the disabled clock and probe continues.
Return the error so the existing probe error path unwinds normally.
Fixes: 9c0ef6d34fdbf ("PCI: amlogic: Add the Amlogic Meson PCIe controller driver")
Signed-off-by: Shuvam Pandey <shuvampandey1@gmail.com>
---
drivers/pci/controller/dwc/pci-meson.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/pci/controller/dwc/pci-meson.c b/drivers/pci/controller/dwc/pci-meson.c
index 0694084f612b..8d495bcc3a41 100644
--- a/drivers/pci/controller/dwc/pci-meson.c
+++ b/drivers/pci/controller/dwc/pci-meson.c
@@ -204,7 +204,9 @@ static inline struct clk *meson_pcie_probe_clock(struct device *dev,
return ERR_PTR(ret);
}
- devm_add_action_or_reset(dev, meson_pcie_disable_clock, clk);
+ ret = devm_add_action_or_reset(dev, meson_pcie_disable_clock, clk);
+ if (ret)
+ return ERR_PTR(ret);
return clk;
}
--
2.50.0
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] PCI: meson: Propagate devm_add_action_or_reset() failure
2026-05-18 8:04 [PATCH] PCI: meson: Propagate devm_add_action_or_reset() failure Shuvam Pandey
@ 2026-05-18 12:56 ` Neil Armstrong
2026-06-09 16:25 ` Manivannan Sadhasivam
1 sibling, 0 replies; 3+ messages in thread
From: Neil Armstrong @ 2026-05-18 12:56 UTC (permalink / raw)
To: Shuvam Pandey, Yue Wang,
Lorenzo Pieralisi <lpieralisi@kernel.org>,
Manivannan Sadhasivam, Rob Herring, Bjorn Helgaas, Kevin Hilman,
Jerome Brunet, Martin Blumenstingl
Cc: linux-pci, linux-amlogic, linux-arm-kernel, linux-kernel
On 5/18/26 10:04, Shuvam Pandey wrote:
> meson_pcie_probe_clock() enables a clock and then registers a devres
> action to disable it during teardown. If devm_add_action_or_reset()
> fails, it runs the action immediately, disabling the clock.
>
> The return value is currently ignored, so on that failure path
> meson_pcie_probe_clock() returns the disabled clock and probe continues.
> Return the error so the existing probe error path unwinds normally.
>
> Fixes: 9c0ef6d34fdbf ("PCI: amlogic: Add the Amlogic Meson PCIe controller driver")
> Signed-off-by: Shuvam Pandey <shuvampandey1@gmail.com>
> ---
> drivers/pci/controller/dwc/pci-meson.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/pci/controller/dwc/pci-meson.c b/drivers/pci/controller/dwc/pci-meson.c
> index 0694084f612b..8d495bcc3a41 100644
> --- a/drivers/pci/controller/dwc/pci-meson.c
> +++ b/drivers/pci/controller/dwc/pci-meson.c
> @@ -204,7 +204,9 @@ static inline struct clk *meson_pcie_probe_clock(struct device *dev,
> return ERR_PTR(ret);
> }
>
> - devm_add_action_or_reset(dev, meson_pcie_disable_clock, clk);
> + ret = devm_add_action_or_reset(dev, meson_pcie_disable_clock, clk);
> + if (ret)
> + return ERR_PTR(ret);
>
> return clk;
> }
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Thanks,
Neil
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] PCI: meson: Propagate devm_add_action_or_reset() failure
2026-05-18 8:04 [PATCH] PCI: meson: Propagate devm_add_action_or_reset() failure Shuvam Pandey
2026-05-18 12:56 ` Neil Armstrong
@ 2026-06-09 16:25 ` Manivannan Sadhasivam
1 sibling, 0 replies; 3+ messages in thread
From: Manivannan Sadhasivam @ 2026-06-09 16:25 UTC (permalink / raw)
To: Yue Wang, Lorenzo Pieralisi, Rob Herring, Bjorn Helgaas,
Neil Armstrong, Kevin Hilman, Jerome Brunet, Martin Blumenstingl,
Shuvam Pandey
Cc: linux-pci, linux-amlogic, linux-arm-kernel, linux-kernel
On Mon, 18 May 2026 13:49:40 +0545, Shuvam Pandey wrote:
> meson_pcie_probe_clock() enables a clock and then registers a devres
> action to disable it during teardown. If devm_add_action_or_reset()
> fails, it runs the action immediately, disabling the clock.
>
> The return value is currently ignored, so on that failure path
> meson_pcie_probe_clock() returns the disabled clock and probe continues.
> Return the error so the existing probe error path unwinds normally.
>
> [...]
Applied, thanks!
[1/1] PCI: meson: Propagate devm_add_action_or_reset() failure
commit: b12341b98d5ac52f48ca1390e1e371aed81346c8
Best regards,
--
Manivannan Sadhasivam <mani@kernel.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-06-09 16:25 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-05-18 8:04 [PATCH] PCI: meson: Propagate devm_add_action_or_reset() failure Shuvam Pandey
2026-05-18 12:56 ` Neil Armstrong
2026-06-09 16:25 ` Manivannan Sadhasivam
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®