summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoralf Trønnes <noralf@tronnes.org>2015-05-12 13:45:32 +0200
committerpopcornmix <popcornmix@gmail.com>2015-05-18 14:13:19 +0100
commit09221e7dfe8bbd75f4f69bd5e2cd6f69fbebbe89 (patch)
treeac12c2577b4fdc131ca95b639c083fd195b875af
parent4403b12cce0d16b015f28160ea2829d8e2e1f5a4 (diff)
downloadlinux-09221e7dfe8bbd75f4f69bd5e2cd6f69fbebbe89.tar.gz
mailbox: bcm2708-vcio: Check the correct status register before writing
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). Suggested-by: Phil Elwell <phil@raspberrypi.org> Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
-rw-r--r--drivers/mailbox/bcm2708-vcio.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/mailbox/bcm2708-vcio.c b/drivers/mailbox/bcm2708-vcio.c
index 74a7fcbf5199..19ecfe8023ab 100644
--- a/drivers/mailbox/bcm2708-vcio.c
+++ b/drivers/mailbox/bcm2708-vcio.c
@@ -35,6 +35,7 @@
#define MAIL0_STA 0x18 /* status */
#define MAIL0_CNF 0x1C /* configuration */
#define MAIL1_WRT 0x20 /* write - and next 4 words */
+#define MAIL1_STA 0x38 /* status */
/* On MACH_BCM270x these come through <linux/interrupt.h> (arm_control.h ) */
#ifndef ARM_MS_EMPTY
@@ -85,7 +86,7 @@ static int mbox_write(struct vc_mailbox *mbox, unsigned chan, uint32_t data28)
return -EINVAL;
/* wait for the mailbox FIFO to have some space in it */
- while (0 != (readl(mbox->regs + MAIL0_STA) & ARM_MS_FULL))
+ while (0 != (readl(mbox->regs + MAIL1_STA) & ARM_MS_FULL))
cpu_relax();
writel(MBOX_MSG(chan, data28), mbox->regs + MAIL1_WRT);