Skip to content

Commit f16dd10

Browse files
ffainelligregkh
authored andcommitted
tty: rp2: Fix reset with non forgiving PCIe host bridges
The write to RP2_GLOBAL_CMD followed by an immediate read of RP2_GLOBAL_CMD in rp2_reset_asic() is intented to flush out the write, however by then the device is already in reset and cannot respond to a memory cycle access. On platforms such as the Raspberry Pi 4 and others using the pcie-brcmstb.c driver, any memory access to a device that cannot respond is met with a fatal system error, rather than being substituted with all 1s as is usually the case on PC platforms. Swapping the delay and the read ensures that the device has finished resetting before we attempt to read from it. Fixes: 7d9f49a ("serial: rp2: New driver for Comtrol RocketPort 2 cards") Cc: stable <stable@kernel.org> Suggested-by: Jim Quinlan <james.quinlan@broadcom.com> Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com> Link: https://lore.kernel.org/r/20240906225435.707837-1-florian.fainelli@broadcom.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent a799585 commit f16dd10

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/tty/serial/rp2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -577,8 +577,8 @@ static void rp2_reset_asic(struct rp2_card *card, unsigned int asic_id)
577577
u32 clk_cfg;
578578

579579
writew(1, base + RP2_GLOBAL_CMD);
580-
readw(base + RP2_GLOBAL_CMD);
581580
msleep(100);
581+
readw(base + RP2_GLOBAL_CMD);
582582
writel(0, base + RP2_CLK_PRESCALER);
583583

584584
/* TDM clock configuration */

0 commit comments

Comments
 (0)