All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] PCI: rcar: Remove __clk_is_enabled() call
@ 2021-10-10 22:06 marek.vasut
  2021-10-11  7:29 ` Geert Uytterhoeven
  0 siblings, 1 reply; 2+ messages in thread
From: marek.vasut @ 2021-10-10 22:06 UTC (permalink / raw)
  To: linux-pci
  Cc: Marek Vasut, Arnd Bergmann, Bjorn Helgaas, Geert Uytterhoeven,
	Lorenzo Pieralisi, Stephen Boyd, Wolfram Sang, Yoshihiro Shimoda,
	linux-renesas-soc

From: Marek Vasut <marek.vasut+renesas@gmail.com>

Remove __clk_is_enabled() call, otherwise the following build error occurs:
  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'
This should be OK, since the bus clock are always enabled in probe() of the driver.

Fixes: a115b1bd3af0 ("PCI: rcar: Add L1 link state fix into data abort hook")
Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: Stephen Boyd <sboyd@kernel.org>
Cc: Wolfram Sang <wsa@the-dreams.de>
Cc: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Cc: linux-renesas-soc@vger.kernel.org
---
V2: Drop the __clk_is_enabled(), like it was done already in V1 of
    a115b1bd3af0 ("PCI: rcar: Add L1 link state fix into data abort hook")
---
 drivers/pci/controller/pcie-rcar-host.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/pci/controller/pcie-rcar-host.c b/drivers/pci/controller/pcie-rcar-host.c
index 8f3131844e77..e3b7bf250e36 100644
--- a/drivers/pci/controller/pcie-rcar-host.c
+++ b/drivers/pci/controller/pcie-rcar-host.c
@@ -51,11 +51,6 @@ struct rcar_msi {
  * the L1 link state fixup function, called from the ARM fault handler.
  */
 static void __iomem *pcie_base;
-/*
- * Static copy of bus clock pointer, so we can check whether the clock
- * is enabled or not.
- */
-static struct clk *pcie_bus_clk;
 #endif
 
 /* Structure representing the PCIe interface */
@@ -794,7 +789,6 @@ static int rcar_pcie_get_resources(struct rcar_pcie_host *host)
 #ifdef CONFIG_ARM
 	/* Cache static copy for L1 link state fixup hook on aarch32 */
 	pcie_base = pcie->base;
-	pcie_bus_clk = host->bus_clk;
 #endif
 
 	return 0;
@@ -1064,7 +1058,7 @@ static int rcar_pcie_aarch32_abort_handler(unsigned long addr,
 
 	spin_lock_irqsave(&pmsr_lock, flags);
 
-	if (!pcie_base || !__clk_is_enabled(pcie_bus_clk)) {
+	if (!pcie_base) {
 		ret = 1;
 		goto unlock_exit;
 	}
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] PCI: rcar: Remove __clk_is_enabled() call
  2021-10-10 22:06 [PATCH v2] PCI: rcar: Remove __clk_is_enabled() call marek.vasut
@ 2021-10-11  7:29 ` Geert Uytterhoeven
  0 siblings, 0 replies; 2+ messages in thread
From: Geert Uytterhoeven @ 2021-10-11  7:29 UTC (permalink / raw)
  To: Marek Vasut
  Cc: linux-pci, Marek Vasut, Arnd Bergmann, Bjorn Helgaas,
	Lorenzo Pieralisi, Stephen Boyd, Wolfram Sang, Yoshihiro Shimoda,
	Linux-Renesas

Hi Marek,

Thanks for your patch!

On Mon, Oct 11, 2021 at 12:07 AM <marek.vasut@gmail.com> wrote:
> From: Marek Vasut <marek.vasut+renesas@gmail.com>
>
> Remove __clk_is_enabled() call, otherwise the following build error occurs:
>   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'
> This should be OK, since the bus clock are always enabled in probe() of the driver.

As I said in [1], the bus clock is the wrong clock to check.  The
correct clock to check is the module clock (like in the ATF version
of your patch).  Unfortunately I missed this in the review of the
original patch, sorry for that.

As I said in [2], while the bus clock is always enabled, the module
clock is under control of Runtime PM.  I'm not sure it's never
disabled (e.g. during system suspend).  So you may have to check
pm_runtime_suspended().

If you ever get an imprecise external abort for some other reason,
while the PCIe module clock is disabled, accessing the PCIe module
registers will lead to another imprecise external abort, causing
infinite recursion.

> Fixes: a115b1bd3af0 ("PCI: rcar: Add L1 link state fix into data abort hook")
> Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>

> V2: Drop the __clk_is_enabled(), like it was done already in V1 of
>     a115b1bd3af0 ("PCI: rcar: Add L1 link state fix into data abort hook")

I couldn't find v1, not in my mailbox, and not in lore?

[1] https://lore.kernel.org/linux-pci/CAMuHMdV8Xu-Pgda9ZrgaXFqXdzBrSRWwiSQFLjzxqRGNWkO3wQ@mail.gmail.com
[2] https://lore.kernel.org/linux-pci/CAMuHMdVQ7r6-H8kBiNYXdqHQRGJxc4eE4hYthFw+XJZx86g6eA@mail.gmail.com

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-10-11  7:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-10 22:06 [PATCH v2] PCI: rcar: Remove __clk_is_enabled() call marek.vasut
2021-10-11  7:29 ` Geert Uytterhoeven

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.