[PATCH] PCI: dw-rockchip: Clear stale link down interrupt before unmasking it
James Le Cuirot
chewi at gentoo.org
Tue Nov 24 15:25:38 PST 2026
On Mon, 2026-11-23 at 13:12 +0100, Niklas Cassel wrote:
> PCIE_LINK_REQ_RST_NOT_INT is set by smlh_req_rst_not, which according to
> the RK3568 TRM "is asserted after power-on reset until first link up".
> The bit is thus already pending when the driver unmasks the interrupt
> after resetting the controller, both in probe and in .reset_root_port(),
> so the interrupt fires as soon as it is unmasked, even though the link
> is up. Since each recovery resets the controller again, this results in
> an endless loop, as seen on a Quartz64 Model B (RK3566):
>
> pcieport 0000:00:00.0: Recovering Root Port due to Link Down
> pcieport 0000:00:00.0: Root Port has been reset
> pcieport 0000:00:00.0: AER: device recovery successful
> pcieport 0000:00:00.0: Recovering Root Port due to Link Down
>
> Clear the bit before unmasking the interrupt, and in .reset_root_port()
> only unmask it once the link is back up, like in probe. Also keep the
> interrupt masked while .reset_root_port() resets the controller, so the
> link down caused by the reset itself is not reported.
>
> Fixes: b376b3ff9cb0 ("PCI: dw-rockchip: Implement .reset_root_port() and use for link down")
> Reported-by: James Le Cuirot <chewi at gentoo.org>
> Closes: https://lore.kernel.org/linux-pci/08cc96c5171fc969b074371692e6d95d46eba60b.camel@gentoo.org/
> Cc: stable at vger.kernel.org
> Signed-off-by: Niklas Cassel <cassel at kernel.org>
I can confirm that this fixes the issue I reported. Thank you. :)
Tested-by: James Le Cuirot <chewi at gentoo.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 423 bytes
Desc: This is a digitally signed message part
URL: <http://lists.infradead.org/pipermail/linux-rockchip/attachments/20261124/f911f5ae/attachment.sig>
More information about the Linux-rockchip
mailing list