Skip to content

Commit f865598

Browse files
notropopcornmix
authored andcommitted
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>
1 parent 2010049 commit f865598

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/mailbox/bcm2708-vcio.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
#define MAIL0_STA 0x18 /* status */
3636
#define MAIL0_CNF 0x1C /* configuration */
3737
#define MAIL1_WRT 0x20 /* write - and next 4 words */
38+
#define MAIL1_STA 0x38 /* status */
3839

3940
/* On MACH_BCM270x these come through <linux/interrupt.h> (arm_control.h ) */
4041
#ifndef ARM_MS_EMPTY
@@ -85,7 +86,7 @@ static int mbox_write(struct vc_mailbox *mbox, unsigned chan, uint32_t data28)
8586
return -EINVAL;
8687

8788
/* wait for the mailbox FIFO to have some space in it */
88-
while (0 != (readl(mbox->regs + MAIL0_STA) & ARM_MS_FULL))
89+
while (0 != (readl(mbox->regs + MAIL1_STA) & ARM_MS_FULL))
8990
cpu_relax();
9091

9192
writel(MBOX_MSG(chan, data28), mbox->regs + MAIL1_WRT);

0 commit comments

Comments
 (0)