]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
PCI: rcar: Add L1 link state fix into data abort hook
authorMarek Vasut <marek.vasut+renesas@gmail.com>
Sun, 15 Aug 2021 18:16:50 +0000 (20:16 +0200)
committerLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Mon, 16 Aug 2021 13:51:30 +0000 (14:51 +0100)
commita115b1bd3af0c2963e72f6e47143724c59251be6
tree4dd2d26cad2210e9059fe38ad20ec9b08cfbcf49
parent1e29cd9983eba1b596bc07f94d81d728007f8a25
PCI: rcar: Add L1 link state fix into data abort hook

When the link is in L1, hardware should return it to L0
automatically whenever a transaction targets a component on the
other end of the link (PCIe r5.0, sec 5.2).

The R-Car PCIe controller doesn't handle this transition correctly.
If the link is not in L0, an MMIO transaction targeting a downstream
device fails, and the controller reports an ARM imprecise external
abort.

Work around this by hooking the abort handler so the driver can
detect this situation and help the hardware complete the link state
transition.

When the R-Car controller receives a PM_ENTER_L1 DLLP from the
downstream component, it sets PMEL1RX bit in PMSR register, but then
the controller enters some sort of in-between state.  A subsequent
MMIO transaction will fail, resulting in the external abort.  The
abort handler detects this condition and completes the link state
transition by setting the L1IATN bit in PMCTLR and waiting for the
link state transition to complete.

Link: https://lore.kernel.org/r/20210815181650.132579-1-marek.vasut@gmail.com
Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: Wolfram Sang <wsa@the-dreams.de>
Cc: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Cc: linux-renesas-soc@vger.kernel.org
drivers/pci/controller/pcie-rcar-host.c
drivers/pci/controller/pcie-rcar.h