Skip to content

Commit d2a14b5

Browse files
Marek VasutLorenzo Pieralisi
authored andcommitted
PCI: rcar: Check if device is runtime suspended instead of __clk_is_enabled()
Replace __clk_is_enabled() with pm_runtime_suspended(), as __clk_is_enabled() was checking the wrong bus clock and caused the following build error too: arm-linux-gnueabi-ld: drivers/pci/controller/pcie-rcar-host.o: in function `rcar_pcie_aarch32_abort_handler': pcie-rcar-host.c:(.text+0xdd0): undefined reference to `__clk_is_enabled' Link: https://lore.kernel.org/r/[email protected] Fixes: a115b1b ("PCI: rcar: Add L1 link state fix into data abort hook") Signed-off-by: Marek Vasut <[email protected]> Signed-off-by: Lorenzo Pieralisi <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]> Acked-by: Randy Dunlap <[email protected]> Cc: Arnd Bergmann <[email protected]> Cc: Bjorn Helgaas <[email protected]> Cc: Geert Uytterhoeven <[email protected]> Cc: Lorenzo Pieralisi <[email protected]> Cc: Stephen Boyd <[email protected]> Cc: Wolfram Sang <[email protected]> Cc: Yoshihiro Shimoda <[email protected]> Cc: [email protected]
1 parent fa55b7d commit d2a14b5

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

drivers/pci/controller/pcie-rcar-host.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ struct rcar_msi {
5050
*/
5151
static void __iomem *pcie_base;
5252
/*
53-
* Static copy of bus clock pointer, so we can check whether the clock
54-
* is enabled or not.
53+
* Static copy of PCIe device pointer, so we can check whether the
54+
* device is runtime suspended or not.
5555
*/
56-
static struct clk *pcie_bus_clk;
56+
static struct device *pcie_dev;
5757
#endif
5858

5959
/* Structure representing the PCIe interface */
@@ -792,7 +792,7 @@ static int rcar_pcie_get_resources(struct rcar_pcie_host *host)
792792
#ifdef CONFIG_ARM
793793
/* Cache static copy for L1 link state fixup hook on aarch32 */
794794
pcie_base = pcie->base;
795-
pcie_bus_clk = host->bus_clk;
795+
pcie_dev = pcie->dev;
796796
#endif
797797

798798
return 0;
@@ -1062,7 +1062,7 @@ static int rcar_pcie_aarch32_abort_handler(unsigned long addr,
10621062

10631063
spin_lock_irqsave(&pmsr_lock, flags);
10641064

1065-
if (!pcie_base || !__clk_is_enabled(pcie_bus_clk)) {
1065+
if (!pcie_base || pm_runtime_suspended(pcie_dev)) {
10661066
ret = 1;
10671067
goto unlock_exit;
10681068
}

0 commit comments

Comments
 (0)