Skip to contentSkip to conversation

mailbox: bcm-flexrm-mailbox: Fix FlexRM ring flush timeout issue

PATCH In review Ray Jui 2 participants 3 messages Feb 4, 2019 – Feb 14, 2019 Mailbox API

lore
Share & tools
lore

Ray Jui

author
#0 lore raw

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.

Fixes a371c10ea4b3 ("mailbox: bcm-flexrm-mailbox: Fix FlexRM ring flush sequence")
---
 drivers/mailbox/bcm-flexrm-mailbox.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/mailbox/bcm-flexrm-mailbox.c +2 -2
index d713271ebf7c..a64116586b4c 100644
@@ -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
Reviewed-by on v1 1/1
#1 lore raw

Fix looks good.

Quoted 9 lines · Ray Jui

From: Rayagonda Kokatanur <[email protected]>

RING_CONTROL reg 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")
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
index d713271ebf7c..a64116586b4c 100644
@@ -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);
author
#2 lore raw

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_CONTROL reg 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")

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
index d713271ebf7c..a64116586b4c 100644
@@ -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);