Hi Shawn, On 08/11/2017 09:52 AM, Shawn Lin wrote:
+static void rockchip_pcie_disable_clocks(void *data) +{ + struct rockchip_pcie *rockchip = data; + + clk_disable_unprepare(rockchip->clk_pcie_pm); + clk_disable_unprepare(rockchip->hclk_pcie); + clk_disable_unprepare(rockchip->aclk_perf_pcie); + clk_disable_unprepare(rockchip->aclk_pcie); +}
maybe we can reuse this function in suspend noirq
+ static int rockchip_pcie_probe(struct platform_device *pdev) { struct rockchip_pcie *rockchip; @@ -1493,31 +1511,49 @@ static int rockchip_pcie_probe(struct platform_device *pdev) err = clk_prepare_enable(rockchip->aclk_pcie); if (err) { dev_err(dev, "unable to enable aclk_pcie clock\n"); - goto err_aclk_pcie; + return err; } err = clk_prepare_enable(rockchip->aclk_perf_pcie); if (err) { dev_err(dev, "unable to enable aclk_perf_pcie clock\n"); - goto err_aclk_perf_pcie; + clk_disable_unprepare(rockchip->aclk_pcie); + return err; } err = clk_prepare_enable(rockchip->hclk_pcie); if (err) { dev_err(dev, "unable to enable hclk_pcie clock\n"); - goto err_hclk_pcie; + clk_disable_unprepare(rockchip->aclk_pcie); + clk_disable_unprepare(rockchip->aclk_perf_pcie); + return err; } err = clk_prepare_enable(rockchip->clk_pcie_pm); if (err) { - dev_err(dev, "unable to enable hclk_pcie clock\n"); - goto err_pcie_pm; + dev_err(dev, "unable to enable clk_pcie_pm clock\n"); + clk_disable_unprepare(rockchip->aclk_pcie); + clk_disable_unprepare(rockchip->aclk_perf_pcie); + clk_disable_unprepare(rockchip->hclk_pcie); + return err; }
maybe we can have a rockchip_pcie_enable_clocks for these, and also reuse it in resume noirq