Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2018-07-10 15:53:18 +0200
committerTakashi Iwai <tiwai@suse.de>2018-07-10 15:53:27 +0200
commita94e6a37a512bcd0ef6aabcdb00f16624b6ddc8e (patch)
treed40a5a286f621ddce8de3effaf6c418b50a85a23
parent4b404219a050ad1b057c152b8fb6569bb6b1ecb1 (diff)
mailbox: bcm-flexrm-mailbox: Fix FlexRM ring flush sequence
(bsc#1051510).
-rw-r--r--patches.drivers/mailbox-bcm-flexrm-mailbox-Fix-FlexRM-ring-flush-seq75
-rw-r--r--series.conf1
2 files changed, 76 insertions, 0 deletions
diff --git a/patches.drivers/mailbox-bcm-flexrm-mailbox-Fix-FlexRM-ring-flush-seq b/patches.drivers/mailbox-bcm-flexrm-mailbox-Fix-FlexRM-ring-flush-seq
new file mode 100644
index 0000000000..b9e9a20552
--- /dev/null
+++ b/patches.drivers/mailbox-bcm-flexrm-mailbox-Fix-FlexRM-ring-flush-seq
@@ -0,0 +1,75 @@
+From a371c10ea4b38a5f120e86d906d404d50a0f4660 Mon Sep 17 00:00:00 2001
+From: Anup Patel <anup.patel@broadcom.com>
+Date: Tue, 3 Oct 2017 10:51:48 +0530
+Subject: [PATCH] mailbox: bcm-flexrm-mailbox: Fix FlexRM ring flush sequence
+Git-commit: a371c10ea4b38a5f120e86d906d404d50a0f4660
+Patch-mainline: v4.15-rc1
+References: bsc#1051510
+
+As-per suggestion from FlexRM HW folks, we have to first set
+FlexRM ring flush state and then clear it for FlexRM ring flush
+to work properly.
+
+Currently, the FlexRM driver has incomplete FlexRM ring flush
+sequence which causes repeated insmod+rmmod of mailbox client
+drivers to fail.
+
+This patch fixes FlexRM ring flush sequence in flexrm_shutdown()
+as described above.
+
+Fixes: dbc049eee730 ("mailbox: Add driver for Broadcom FlexRM
+ring manager")
+
+Signed-off-by: Anup Patel <anup.patel@broadcom.com>
+Reviewed-by: Scott Branden <scott.branden@broadcom.com>
+Cc: stable@vger.kernel.org
+Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
+Acked-by: Takashi Iwai <tiwai@suse.de>
+
+---
+ drivers/mailbox/bcm-flexrm-mailbox.c | 22 +++++++++++++++++++---
+ 1 file changed, 19 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/mailbox/bcm-flexrm-mailbox.c b/drivers/mailbox/bcm-flexrm-mailbox.c
+index ae6146311934..f052a3eb2098 100644
+--- a/drivers/mailbox/bcm-flexrm-mailbox.c
++++ b/drivers/mailbox/bcm-flexrm-mailbox.c
+@@ -1365,8 +1365,8 @@ static void flexrm_shutdown(struct mbox_chan *chan)
+ /* Disable/inactivate ring */
+ writel_relaxed(0x0, ring->regs + RING_CONTROL);
+
+- /* Flush ring with timeout of 1s */
+- timeout = 1000;
++ /* Set ring flush state */
++ timeout = 1000; /* timeout of 1s */
+ writel_relaxed(BIT(CONTROL_FLUSH_SHIFT),
+ ring->regs + RING_CONTROL);
+ do {
+@@ -1374,7 +1374,23 @@ static void flexrm_shutdown(struct mbox_chan *chan)
+ FLUSH_DONE_MASK)
+ break;
+ mdelay(1);
+- } while (timeout--);
++ } while (--timeout);
++ if (!timeout)
++ dev_err(ring->mbox->dev,
++ "setting ring%d flush state timedout\n", ring->num);
++
++ /* Clear ring flush state */
++ timeout = 1000; /* timeout of 1s */
++ writel_relaxed(0x0, ring + RING_CONTROL);
++ do {
++ if (!(readl_relaxed(ring + RING_FLUSH_DONE) &
++ FLUSH_DONE_MASK))
++ break;
++ mdelay(1);
++ } while (--timeout);
++ if (!timeout)
++ dev_err(ring->mbox->dev,
++ "clearing ring%d flush state timedout\n", ring->num);
+
+ /* Abort all in-flight requests */
+ for (reqid = 0; reqid < RING_MAX_REQ_COUNT; reqid++) {
+--
+2.18.0
+
diff --git a/series.conf b/series.conf
index adfd75ec31..b2a51347d6 100644
--- a/series.conf
+++ b/series.conf
@@ -8329,6 +8329,7 @@
patches.drivers/bpf-fix-lockdep-splat.patch
patches.drivers/geneve-fix-fill_info-when-link-down
patches.fixes/mm-pagewalk.c-report-holes-in-hugetlb-ranges.patch
+ patches.drivers/mailbox-bcm-flexrm-mailbox-Fix-FlexRM-ring-flush-seq
patches.drivers/ata-pata_artop-remove-redundant-initialization-of-pi.patch
patches.drivers/0001-ata-ceva-Move-sata-port-phy-oob-settings-to-device-t.patch
patches.drivers/0002-ata-ceva-Add-gen-3-mode-support-in-driver.patch