usb: host: ohci-exynos: Propagate clock errors from resume
Subsystems (3)
PATCH 1/1 usb: host: ohci-exynos: Propagate clock errors from resume
exynos_ohci_resume() ignores clk_prepare_enable() and proceeds to PHY and OHCI restoration.
Return a clock failure before enabling the PHY. The existing PHY failure path continues to undo a successfully enabled clock.
The issue was found by our static-analysis tool and manually reviewed.
--- drivers/usb/host/ohci-exynos.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/usb/host/ohci-exynos.c +3 -1
@@ -231,7 +231,9 @@ static int exynos_ohci_resume(struct device *dev)struct exynos_ohci_hcd *exynos_ohci =to_exynos_ohci (hcd);int ret; -clk_prepare_enable (exynos_ohci->clk); + ret =clk_prepare_enable (exynos_ohci->clk); +if (ret) +return ret; ret =exynos_ohci_phy_enable (dev);if (ret) {
Signature · 1 line
2.50.1 (Apple Git-155)
Krzysztof Kozlowski
maintainerQuoted 1 line · Pengpeng Hou
exynos_ohci_resume()ignoresclk_prepare_enable()and proceeds to PHY
No, clk_prepare_enable() is not ignored. It is called.
What is ignored is the return status, because it does not matter. It cannot possibly fail, it is simple MMIO access within internals of the SoC.
Anyway, please rephrase the commit msg.
Quoted 8 lines
and OHCI restoration.
Return a clock failure before enabling the PHY. The existing PHY failure path continues to undo a successfully enabled clock.
The issue was found by our static-analysis tool and manually reviewed.
Fixes e864abed546f ("USB: ohci-exynos: add clock gating to suspend/resume")
IMO, I have doubts whether this is a fix, because actual error cannot happen in practice.
Best regards,
Krzysztof