diff mbox series

[v2] mmc: renesas_sdhi_internal_dmac: mask DMAC interrupts

Message ID 624fec83-0190-18b4-1d80-b59b1bc964b2@cogentembedded.com (mailing list archive)
State New, archived
Headers show
Series [v2] mmc: renesas_sdhi_internal_dmac: mask DMAC interrupts | expand

Commit Message

Sergei Shtylyov Aug. 22, 2018, 6:22 p.m. UTC
I have encountered an interrupt storm during the eMMC chip probing (and
the chip finally didn't get detected).  It turned out that U-Boot left
the SDHI DMA interrupts enabled while the Linux driver didn't use those.
Masking those interrupts in renesas_sdhi_internal_dmac_request_dma() gets
rid of both issues...

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

---
The patch is against Ulf Hansson's 'mmc.git' repo's 'fixes' branch.

Changes in version 2:
- fixed #define INFO{1|2}_RESERVED_BITS, rename them to INFO{1|2}_MASK_CLEAR,
  and moved them higher;
- shortened the comment before masking the DMAC interrupts;
- fixed up the excess whitespace in the patch dsescription.

 drivers/mmc/host/renesas_sdhi_internal_dmac.c |    8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Wolfram Sang Aug. 22, 2018, 7:37 p.m. UTC | #1
On Wed, Aug 22, 2018 at 09:22:26PM +0300, Sergei Shtylyov wrote:
> I have encountered an interrupt storm during the eMMC chip probing (and
> the chip finally didn't get detected).  It turned out that U-Boot left
> the SDHI DMA interrupts enabled while the Linux driver didn't use those.
> Masking those interrupts in renesas_sdhi_internal_dmac_request_dma() gets
> rid of both issues...
> 
> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Sergei Shtylyov Aug. 22, 2018, 8:07 p.m. UTC | #2
On 08/22/2018 10:37 PM, Wolfram Sang wrote:

>> I have encountered an interrupt storm during the eMMC chip probing (and
>> the chip finally didn't get detected).  It turned out that U-Boot left
>> the SDHI DMA interrupts enabled while the Linux driver didn't use those.
>> Masking those interrupts in renesas_sdhi_internal_dmac_request_dma() gets
>> rid of both issues...
>>
>> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
> 
> Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

Fixes: 2a68ea7896e3 ("mmc: renesas-sdhi: add support for R-Car Gen3 SDHI DMAC")

MBR, Sergei
Ulf Hansson Aug. 23, 2018, 10:43 a.m. UTC | #3
On 22 August 2018 at 22:07, Sergei Shtylyov
<sergei.shtylyov@cogentembedded.com> wrote:
> On 08/22/2018 10:37 PM, Wolfram Sang wrote:
>
>>> I have encountered an interrupt storm during the eMMC chip probing (and
>>> the chip finally didn't get detected).  It turned out that U-Boot left
>>> the SDHI DMA interrupts enabled while the Linux driver didn't use those.
>>> Masking those interrupts in renesas_sdhi_internal_dmac_request_dma() gets
>>> rid of both issues...
>>>
>>> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
>>
>> Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
>
> Fixes: 2a68ea7896e3 ("mmc: renesas-sdhi: add support for R-Car Gen3 SDHI DMAC")
>
> MBR, Sergei

Applied for fixes, thanks!

Kind regards
Uffe
diff mbox series

Patch

Index: renesas/drivers/mmc/host/renesas_sdhi_internal_dmac.c
===================================================================
--- renesas.orig/drivers/mmc/host/renesas_sdhi_internal_dmac.c
+++ renesas/drivers/mmc/host/renesas_sdhi_internal_dmac.c
@@ -49,10 +49,12 @@ 
 
 /* DM_CM_INFO1 and DM_CM_INFO1_MASK */
 #define INFO1_CLEAR		0
+#define INFO1_MASK_CLEAR	GENMASK_ULL(31, 0)
 #define INFO1_DTRANEND1		BIT(17)
 #define INFO1_DTRANEND0		BIT(16)
 
 /* DM_CM_INFO2 and DM_CM_INFO2_MASK */
+#define INFO2_MASK_CLEAR	GENMASK_ULL(31, 0)
 #define INFO2_DTRANERR1		BIT(17)
 #define INFO2_DTRANERR0		BIT(16)
 
@@ -236,6 +238,12 @@  renesas_sdhi_internal_dmac_request_dma(s
 {
 	struct renesas_sdhi *priv = host_to_priv(host);
 
+	/* Disable DMAC interrupts, we don't use them */
+	renesas_sdhi_internal_dmac_dm_write(host, DM_CM_INFO1_MASK,
+					    INFO1_MASK_CLEAR);
+	renesas_sdhi_internal_dmac_dm_write(host, DM_CM_INFO2_MASK,
+					    INFO2_MASK_CLEAR);
+
 	/* Each value is set to non-zero to assume "enabling" each DMA */
 	host->chan_rx = host->chan_tx = (void *)0xdeadbeaf;