mailbox: bcm-flexrm-mailbox: Fix FlexRM ring flush timeout issue
PATCH 1/1 mailbox: bcm-flexrm-mailbox: Fix FlexRM ring flush timeout issue
From: Rayagonda Kokatanur <[email protected]>
RING_CONTROL reg was not written due to wrong address, hence all the subsequent ring flush was timing out.
--- drivers/mailbox/bcm-flexrm-mailbox.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/mailbox/bcm-flexrm-mailbox.c +2 -2
@@ -1396,9 +1396,9 @@ static void flexrm_shutdown(struct mbox_chan *chan)/* Clear ring flush state */ timeout =1000 ;/* timeout of 1s */ -writel_relaxed (0x0 , ring +RING_CONTROL ); +writel_relaxed (0x0 , ring->regs +RING_CONTROL ); do { - if (!(readl_relaxed(ring + RING_FLUSH_DONE) & + if (!(readl_relaxed(ring->regs + RING_FLUSH_DONE) & FLUSH_DONE_MASK)) break; mdelay(1);
Signature · 1 line
2.17.1
Fix looks good.
Quoted 9 lines · Ray Jui
From: Rayagonda Kokatanur <[email protected]>
RING_CONTROLreg was not written due to wrong address, hence all the subsequent ring flush was timing out.Fixes a371c10ea4b3 ("mailbox: bcm-flexrm-mailbox: Fix FlexRM ring flush sequence")Signed-off-by Rayagonda Kokatanur <[email protected]>Signed-off-by Ray Jui <[email protected]>
Quoted 20 lines
--- drivers/mailbox/bcm-flexrm-mailbox.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/mailbox/bcm-flexrm-mailbox.c +2
-2@@ -1396,9 +1396,9 @@ static void flexrm_shutdown(struct mbox_chan *chan)/* Clear ring flush state */ timeout =1000 ;/* timeout of 1s */ -writel_relaxed (0x0 , ring +RING_CONTROL ); +writel_relaxed (0x0 , ring->regs +RING_CONTROL ); do { - if (!(readl_relaxed(ring + RING_FLUSH_DONE) & + if (!(readl_relaxed(ring->regs + RING_FLUSH_DONE) & FLUSH_DONE_MASK)) break; mdelay(1);
Hi Jassi,
Have you had a chance to review this fix? This is a critical fix for a crash during driver shutdown.
Regards,
Ray
Quoted 34 lines · Scott Branden
Fix looks good.
Quoted 10 lines · Ray Jui
From: Rayagonda Kokatanur <[email protected]>
RING_CONTROLreg was not written due to wrong address, hence all the subsequent ring flush was timing out.Fixes a371c10ea4b3 ("mailbox: bcm-flexrm-mailbox: Fix FlexRM ringflush sequence")
Signed-off-by Rayagonda Kokatanur <[email protected]>Signed-off-by Ray Jui <[email protected]>Reviewed-by Scott Branden <[email protected]>Quoted 20 lines
---
drivers/mailbox/bcm-flexrm-mailbox.c| 4 ++--1 file changed, 2 insertions(+), 2 deletions(-)drivers/mailbox/bcm-flexrm-mailbox.c +0
-0@@ -1396,9 +1396,9 @@ static void flexrm_shutdown(struct mbox_chan *chan) /* Clear ring flush state */timeout = 1000; /* timeout of 1s */
-writel_relaxed(0x0, ring + RING_CONTROL);
+writel_relaxed(0x0, ring->regs + RING_CONTROL); do {
- if (!(readl_relaxed(ring +RING_FLUSH_DONE) & + if (!(readl_relaxed(ring->regs +RING_FLUSH_DONE) &FLUSH_DONE_MASK))
break;
mdelay(1);