aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mailbox/bcm2835-mailbox.c
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2015-05-13 13:10:32 -0700
committerJassi Brar <jaswinder.singh@linaro.org>2015-06-13 16:20:39 +0530
commit7d641938aa2ae433a97cc65ec622547cfe08f2ed (patch)
treeb054804a80400f4b1af73d9911d13f659f8c6ea1 /drivers/mailbox/bcm2835-mailbox.c
parentdt: mailbox: Remove 'mbox-names property is discouraged' message from binding (diff)
downloadlinux-dev-7d641938aa2ae433a97cc65ec622547cfe08f2ed.tar.xz
linux-dev-7d641938aa2ae433a97cc65ec622547cfe08f2ed.zip
mailbox/bcm2835: Fix mailbox full detection.
With the VC reader blocked and the ARM writing, MAIL0_STA reads empty permanently while MAIL1_STA goes from empty (0x40000000) to non-empty (0x00000001-0x00000007) to full (0x80000008). This bug ended up having no effect on us, because all of our transactions in the client driver were synchronous and under a mutex. Suggested-by: Phil Elwell <phil@raspberrypi.org> Signed-off-by: Eric Anholt <eric@anholt.net> Acked-by: Stephen Warren <swarren@wwwdotorg.org> Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
Diffstat (limited to 'drivers/mailbox/bcm2835-mailbox.c')
-rw-r--r--drivers/mailbox/bcm2835-mailbox.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/mailbox/bcm2835-mailbox.c b/drivers/mailbox/bcm2835-mailbox.c
index 4b13268529f9..0b47dd42f3bd 100644
--- a/drivers/mailbox/bcm2835-mailbox.c
+++ b/drivers/mailbox/bcm2835-mailbox.c
@@ -49,6 +49,7 @@
#define MAIL0_STA (ARM_0_MAIL0 + 0x18)
#define MAIL0_CNF (ARM_0_MAIL0 + 0x1C)
#define MAIL1_WRT (ARM_0_MAIL1 + 0x00)
+#define MAIL1_STA (ARM_0_MAIL1 + 0x18)
/* Status register: FIFO state. */
#define ARM_MS_FULL BIT(31)
@@ -117,7 +118,7 @@ static bool bcm2835_last_tx_done(struct mbox_chan *link)
bool ret;
spin_lock(&mbox->lock);
- ret = !(readl(mbox->regs + MAIL0_STA) & ARM_MS_FULL);
+ ret = !(readl(mbox->regs + MAIL1_STA) & ARM_MS_FULL);
spin_unlock(&mbox->lock);
return ret;
}