From 0ae49b555e80debeb1587d19637a855bb13d32e3 Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Wed, 8 Jan 2020 10:29:16 +0100 Subject: ARM: rpi mailbox: Use non interruptible timeout This makes sure that during a mailbox transfer no other mailbox transfer is started. This happens on a raspberrypi3 where one GPIO on the firmware GPIO controller (which is controlled via mailbox) is registered as a heartbeat LED. With this it can happen that during a mailbox transfer the poller which drives the heartbeat LED is triggered in is_timeout() which results in corrupted transfers. Signed-off-by: Sascha Hauer --- arch/arm/mach-bcm283x/mbox.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'arch/arm/mach-bcm283x') diff --git a/arch/arm/mach-bcm283x/mbox.c b/arch/arm/mach-bcm283x/mbox.c index 1b1981f7cb..22abbb0ca5 100644 --- a/arch/arm/mach-bcm283x/mbox.c +++ b/arch/arm/mach-bcm283x/mbox.c @@ -37,7 +37,7 @@ static int bcm2835_mbox_call_raw(u32 chan, struct bcm2835_mbox_hdr *buffer, val = readl(mbox_base + MAIL0_STA); if (val & BCM2835_MBOX_STATUS_RD_EMPTY) break; - if (is_timeout(starttime, TIMEOUT)) { + if (is_timeout_non_interruptible(starttime, TIMEOUT)) { pr_err("mbox: Timeout draining stale responses\n"); return -ETIMEDOUT; } @@ -49,7 +49,7 @@ static int bcm2835_mbox_call_raw(u32 chan, struct bcm2835_mbox_hdr *buffer, val = readl(mbox_base + MAIL0_STA); if (!(val & BCM2835_MBOX_STATUS_WR_FULL)) break; - if (is_timeout(starttime, TIMEOUT)) { + if (is_timeout_non_interruptible(starttime, TIMEOUT)) { pr_err("mbox: Timeout waiting for send space\n"); return -ETIMEDOUT; } @@ -67,7 +67,7 @@ static int bcm2835_mbox_call_raw(u32 chan, struct bcm2835_mbox_hdr *buffer, val = readl(mbox_base + MAIL0_STA); if (!(val & BCM2835_MBOX_STATUS_RD_EMPTY)) break; - if (is_timeout(starttime, TIMEOUT)) { + if (is_timeout_non_interruptible(starttime, TIMEOUT)) { pr_err("mbox: Timeout waiting for response\n"); return -ETIMEDOUT; } -- cgit v1.2.3