Linux PCI subsystem development
 help / color / mirror / Atom feed
* [PATCH] PCI: microchip: handle clock cleanup registration failures
@ 2026-11-29 13:44 Jiawen Liu
  2026-11-29 13:47 ` sashiko-bot
  0 siblings, 1 reply; 2+ messages in thread
From: Jiawen Liu @ 2026-11-29 13:44 UTC (permalink / raw)
  To: Conor Dooley, Daire McNamara, Lorenzo Pieralisi,
	Krzysztof Wilczyński, Manivannan Sadhasivam, Bjorn Helgaas
  Cc: Rob Herring, linux-riscv, linux-pci, linux-kernel

mc_pcie_init_clk() enables a FIC clock and registers a devres action to
disable it. If registering that action fails, the reset helper disables
the clock immediately, but the ignored error makes mc_pcie_init_clk()
return a valid clock pointer. Probe can then continue without retaining
the required clock enable.

Return the registration error before proceeding with PCI host setup.

Fixes: 6f15a9c9f941 ("PCI: microchip: Add Microchip PolarFire PCIe controller driver")
Signed-off-by: Jiawen Liu <1298662399@qq.com>
---
 drivers/pci/controller/plda/pcie-microchip-host.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/pci/controller/plda/pcie-microchip-host.c b/drivers/pci/controller/plda/pcie-microchip-host.c
index ae26afbb73dd0..c118eef73d60a 100644
--- a/drivers/pci/controller/plda/pcie-microchip-host.c
+++ b/drivers/pci/controller/plda/pcie-microchip-host.c
@@ -521,7 +521,9 @@ static inline struct clk *mc_pcie_init_clk(struct device *dev, const char *id)
 	if (ret)
 		return ERR_PTR(ret);
 
-	devm_add_action_or_reset(dev, mc_pcie_deinit_clk, clk);
+	ret = devm_add_action_or_reset(dev, mc_pcie_deinit_clk, clk);
+	if (ret)
+		return ERR_PTR(ret);
 
 	return clk;
 }
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] PCI: microchip: handle clock cleanup registration failures
  2026-11-29 13:44 [PATCH] PCI: microchip: handle clock cleanup registration failures Jiawen Liu
@ 2026-11-29 13:47 ` sashiko-bot
  0 siblings, 0 replies; 2+ messages in thread
From: sashiko-bot @ 2026-11-29 13:47 UTC (permalink / raw)
  To: Jiawen Liu; +Cc: linux-pci

> mc_pcie_init_clk() enables a FIC clock and registers a devres action to
> disable it. If registering that action fails, the reset helper disables
> the clock immediately, but the ignored error makes mc_pcie_init_clk()
> return a valid clock pointer. Probe can then continue without retaining
> the required clock enable.
> 
> Return the registration error before proceeding with PCI host setup.
> 
> Fixes: 6f15a9c9f941 ("PCI: microchip: Add Microchip PolarFire PCIe controller driver")
> Signed-off-by: Jiawen Liu <1298662399@qq.com>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/tencent_06BA22104833DD66A70640855FE04AFC7A07@qq.com?part=1

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-11-29 13:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-29 13:44 [PATCH] PCI: microchip: handle clock cleanup registration failures Jiawen Liu
2026-11-29 13:47 ` sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox