[PATCH v3] PCI: rockchip: fix system hang up if activating CONFIG_DEBUG_SHIRQ

jeffy jeffy.chen at rock-chips.com
Thu Aug 10 19:39:08 PDT 2017


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




More information about the Linux-rockchip mailing list