• Marek Vasut's avatar
    PCI: rcar: Add L1 link state fix into data abort hook · a115b1bd
    Marek Vasut authored
    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.comSigned-off-by: default avatarMarek Vasut <marek.vasut+renesas@gmail.com>
    Signed-off-by: default avatarLorenzo 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
    a115b1bd
pcie-rcar-host.c 28.3 KB