PCI: rockchip: Clean up PHY if driver probe or resume fails
authorShawn Lin <shawn.lin@rock-chips.com>
Wed, 23 Aug 2017 07:03:07 +0000 (15:03 +0800)
committerBjorn Helgaas <bhelgaas@google.com>
Tue, 29 Aug 2017 18:18:07 +0000 (13:18 -0500)
commit8c595dd1fd97d8e241c7a8c2f9fe9b08867b1d4a
tree81e09c54197c5b097146794075a27fd8e74200d8
parentde8473f51470805cfd3132cc91598471bb9c5151
PCI: rockchip: Clean up PHY if driver probe or resume fails

We observed that the clk_pciephy_ref is still enabled when we fail to probe
the driver.

  root@linaro-alip:~# grep pcie /sys/kernel/debug/clk/clk_summary
  clk_pciephy_ref                    1     1        24000000       0 0
  clk_pcie_pm                        0     0        24000000       0 0
  clk_pcie_core_cru          0     0       125000000       0 0
  clk_pciephy_ref100m        0     0       100000000       0 0
  aclk_pcie          0     0       148500000       0 0
  aclk_perf_pcie     0     0       148500000       0 0
  pclk_pcie  0     0        37125000       0 0
  clk_pcie_core                      0     0               0       0 0

clk_pciephy_ref is used by the PHY driver and we need to properly disable
it for this case.  Add error handling in rockchip_pcie_init_port() and
rockchip_pcie_resume_noirq() to fix this issue.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
drivers/pci/host/pcie-rockchip.c