Skip to contentSkip to conversation

PCI: fu740: Disable pcie_aux clock if reset deassert fails

PATCH New Jayaraj Devaraj 2 participants 2 messages Dec 1

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 PCI: fu740: Disable pcie_aux clock if reset deassert fails

fu740_pcie_host_init() enables the pcie_aux clock and then returns without disabling it if reset_control_deassert() fails, leaving the clock enabled on the error path.

Disable the clock before returning the error.

Fixes e7e21b3a339b ("PCI: fu740: Add SiFive FU740 PCIe host controller driver")

---
Changes in v2:
- Add Fixes: tag.
- Rebase on pci/next.

 drivers/pci/controller/dwc/pcie-fu740.c | 1 +
 1 file changed, 1 insertion(+)
drivers/pci/controller/dwc/pcie-fu740.c +1 -0
index 00ec69a09164..2355243da793 100644
@@ -260,6 +260,7 @@ static int fu740_pcie_host_init(struct dw_pcie_rp *pp)
 	ret = reset_control_deassert(afp->rst);
 	if (ret) {
 		dev_err(dev, "unable to deassert pcie_power_up_rst_n\n");
+		clk_disable_unprepare(afp->pcie_aux);
 		return ret;
 	}
 
Signature · 1 line
2.34.1
#1 lore raw
Sashiko has reviewed this patch and found no issues.
Quoted 8 lines

fu740_pcie_host_init() enables the pcie_aux clock and then returns without disabling it if reset_control_deassert() fails, leaving the clock enabled on the error path.

Disable the clock before returning the error.

Fixes e7e21b3a339b ("PCI: fu740: Add SiFive FU740 PCIe host controller driver")

Sashiko has reviewed this patch and found no issues.

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1