All of lore.kernel.org
 help / color / mirror / Atom feed
* imx7d: Timeout waiting for hardware interrupt.
@ 2022-05-24 13:31 Fabio Estevam
  2022-05-25 10:21 ` Bough Chen
  0 siblings, 1 reply; 8+ messages in thread
From: Fabio Estevam @ 2022-05-24 13:31 UTC (permalink / raw)
  To: Bough Chen
  Cc: linux-mmc, Adrian Hunter, NXP Linux Team, Sebastian Reichel,
	Martin Fuzzey

Hi,

On an imx7d board running 5.10.y the following mmc2 timeout is observed:

mmc2: Timeout waiting for hardware interrupt.
mmc2: sdhci: ============ SDHCI REGISTER DUMP ===========
mmc2: sdhci: Sys addr:  0x82f9425c | Version:  0x00000002
mmc2: sdhci: Blk size:  0x0000002c | Blk cnt:  0x00000001
mmc2: sdhci: Argument:  0x1410002c | Trn mode: 0x00000013
mmc2: sdhci: Present:   0x01d88a0a | Host ctl: 0x00000013
mmc2: sdhci: Power:     0x00000002 | Blk gap:  0x00000080
mmc2: sdhci: Wake-up:   0x00000008 | Clock:    0x0000003f
mmc2: sdhci: Timeout:   0x0000008f | Int stat: 0x00000000
mmc2: sdhci: Int enab:  0x107f100b | Sig enab: 0x107f100b
mmc2: sdhci: ACmd stat: 0x00000000 | Slot int: 0x00000302
mmc2: sdhci: Caps:      0x07eb0000 | Caps_1:   0x0000b400
mmc2: sdhci: Cmd:       0x0000353a | Max curr: 0x00ffffff
mmc2: sdhci: Resp[0]:   0x00001000 | Resp[1]:  0x00000000
mmc2: sdhci: Resp[2]:   0x00000000 | Resp[3]:  0x00000000
mmc2: sdhci: Host ctl2: 0x00000000
mmc2: sdhci: ADMA Err:  0x00000007 | ADMA Ptr: 0x9c042200
mmc2: sdhci-esdhc-imx: ========= ESDHC IMX DEBUG STATUS DUMP =========
mmc2: sdhci-esdhc-imx: cmd debug status:  0x2100
mmc2: sdhci-esdhc-imx: data debug status:  0x2200
mmc2: sdhci-esdhc-imx: trans debug status:  0x2300
mmc2: sdhci-esdhc-imx: dma debug status:  0x2402
mmc2: sdhci-esdhc-imx: adma debug status:  0x25b4
mmc2: sdhci-esdhc-imx: fifo debug status:  0x2610
mmc2: sdhci-esdhc-imx: async fifo debug status:  0x2751
mmc2: sdhci: ============================================

The mmc2 interface is connected to an SDIO Wifi chip.

This irq timeout occurs very rarely.

Any suggestions on how to debug this?

Thanks,

Fabio Estevam

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: imx7d: Timeout waiting for hardware interrupt.
  2022-05-24 13:31 imx7d: Timeout waiting for hardware interrupt Fabio Estevam
@ 2022-05-25 10:21 ` Bough Chen
  2022-05-26 19:07   ` Fabio Estevam
  0 siblings, 1 reply; 8+ messages in thread
From: Bough Chen @ 2022-05-25 10:21 UTC (permalink / raw)
  To: Fabio Estevam
  Cc: linux-mmc, Adrian Hunter, dl-linux-imx, Sebastian Reichel, Martin Fuzzey


> -----Original Message-----
> From: Fabio Estevam <festevam@gmail.com>
> Sent: 2022年5月24日 21:31
> To: Bough Chen <haibo.chen@nxp.com>
> Cc: linux-mmc <linux-mmc@vger.kernel.org>; Adrian Hunter
> <adrian.hunter@intel.com>; dl-linux-imx <linux-imx@nxp.com>; Sebastian
> Reichel <sebastian.reichel@collabora.com>; Martin Fuzzey
> <martin.fuzzey@flowbird.group>
> Subject: imx7d: Timeout waiting for hardware interrupt.
> 
> Hi,
> 
> On an imx7d board running 5.10.y the following mmc2 timeout is observed:
> 
> mmc2: Timeout waiting for hardware interrupt.
> mmc2: sdhci: ============ SDHCI REGISTER DUMP ===========
> mmc2: sdhci: Sys addr:  0x82f9425c | Version:  0x00000002
> mmc2: sdhci: Blk size:  0x0000002c | Blk cnt:  0x00000001
> mmc2: sdhci: Argument:  0x1410002c | Trn mode: 0x00000013
> mmc2: sdhci: Present:   0x01d88a0a | Host ctl: 0x00000013
> mmc2: sdhci: Power:     0x00000002 | Blk gap:  0x00000080
> mmc2: sdhci: Wake-up:   0x00000008 | Clock:    0x0000003f
> mmc2: sdhci: Timeout:   0x0000008f | Int stat: 0x00000000
> mmc2: sdhci: Int enab:  0x107f100b | Sig enab: 0x107f100b
> mmc2: sdhci: ACmd stat: 0x00000000 | Slot int: 0x00000302
> mmc2: sdhci: Caps:      0x07eb0000 | Caps_1:   0x0000b400
> mmc2: sdhci: Cmd:       0x0000353a | Max curr: 0x00ffffff
> mmc2: sdhci: Resp[0]:   0x00001000 | Resp[1]:  0x00000000
> mmc2: sdhci: Resp[2]:   0x00000000 | Resp[3]:  0x00000000
> mmc2: sdhci: Host ctl2: 0x00000000
> mmc2: sdhci: ADMA Err:  0x00000007 | ADMA Ptr: 0x9c042200
> mmc2: sdhci-esdhc-imx: ========= ESDHC IMX DEBUG STATUS DUMP
> =========
> mmc2: sdhci-esdhc-imx: cmd debug status:  0x2100
> mmc2: sdhci-esdhc-imx: data debug status:  0x2200
> mmc2: sdhci-esdhc-imx: trans debug status:  0x2300
> mmc2: sdhci-esdhc-imx: dma debug status:  0x2402
> mmc2: sdhci-esdhc-imx: adma debug status:  0x25b4
> mmc2: sdhci-esdhc-imx: fifo debug status:  0x2610
> mmc2: sdhci-esdhc-imx: async fifo debug status:  0x2751
> mmc2: sdhci: ============================================
> 
> The mmc2 interface is connected to an SDIO Wifi chip.
> 
> This irq timeout occurs very rarely.
> 
> Any suggestions on how to debug this?

Hi Fabio,

According to the log, ADMA Err:  0x00000007, seems meet ADMA length miss match issue, please double check whether the following patch is on your side:
commit e30be063d6dbcc0f18b1eb25fa709fdef89201fb mmc: sdhci-esdhc-imx: correct the fix of ERR004536

also please add the following patch for suspend/resume case
commit a26a4f1baca55a05aecd8d7181802979a93e3d46 mmc: sdhci-esdhci-imx: retune needed for Mega/Mix enabled SoCs

Best Regards
Haibo Chen

> 
> Thanks,
> 
> Fabio Estevam

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: imx7d: Timeout waiting for hardware interrupt.
  2022-05-25 10:21 ` Bough Chen
@ 2022-05-26 19:07   ` Fabio Estevam
  2022-10-18 12:29     ` Fabio Estevam
  0 siblings, 1 reply; 8+ messages in thread
From: Fabio Estevam @ 2022-05-26 19:07 UTC (permalink / raw)
  To: Bough Chen
  Cc: linux-mmc, Adrian Hunter, dl-linux-imx, Sebastian Reichel, Martin Fuzzey

Hi Bough,

On Wed, May 25, 2022 at 7:21 AM Bough Chen <haibo.chen@nxp.com> wrote:

> Hi Fabio,
>
> According to the log, ADMA Err:  0x00000007, seems meet ADMA length miss match issue, please double check whether the following patch is on your side:
> commit e30be063d6dbcc0f18b1eb25fa709fdef89201fb mmc: sdhci-esdhc-imx: correct the fix of ERR004536
>
> also please add the following patch for suspend/resume case
> commit a26a4f1baca55a05aecd8d7181802979a93e3d46 mmc: sdhci-esdhci-imx: retune needed for Mega/Mix enabled SoCs

Both commits are present in 5.10 stable, thanks.

I am testing a devicetree change.

Thanks

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: imx7d: Timeout waiting for hardware interrupt.
  2022-05-26 19:07   ` Fabio Estevam
@ 2022-10-18 12:29     ` Fabio Estevam
  2022-10-18 17:20       ` Fabio Estevam
  0 siblings, 1 reply; 8+ messages in thread
From: Fabio Estevam @ 2022-10-18 12:29 UTC (permalink / raw)
  To: Bough Chen
  Cc: linux-mmc, Adrian Hunter, dl-linux-imx, Sebastian Reichel, Martin Fuzzey

Hi Bough,

On Thu, May 26, 2022 at 4:07 PM Fabio Estevam <festevam@gmail.com> wrote:
>
> Hi Bough,
>
> On Wed, May 25, 2022 at 7:21 AM Bough Chen <haibo.chen@nxp.com> wrote:
>
> > Hi Fabio,
> >
> > According to the log, ADMA Err:  0x00000007, seems meet ADMA length miss match issue, please double check whether the following patch is on your side:
> > commit e30be063d6dbcc0f18b1eb25fa709fdef89201fb mmc: sdhci-esdhc-imx: correct the fix of ERR004536
> >
> > also please add the following patch for suspend/resume case
> > commit a26a4f1baca55a05aecd8d7181802979a93e3d46 mmc: sdhci-esdhci-imx: retune needed for Mega/Mix enabled SoCs
>
> Both commits are present in 5.10 stable, thanks.
>
> I am testing a devicetree change.

After 5 months, the "Timeout waiting for hardware interrupt." error
happened again
on the imx7d-based board running kernel 5.10.y from the stable tree:

mmc2: Timeout waiting for hardware interrupt.
mmc2: sdhci: ============ SDHCI REGISTER DUMP ===========
mmc2: sdhci: Sys addr:  0x8310c85c | Version:  0x00000002
mmc2: sdhci: Blk size:  0x0000002c | Blk cnt:  0x00000001
mmc2: sdhci: Argument:  0x1410002c | Trn mode: 0x00000013
mmc2: sdhci: Present:   0x01dd8a0a | Host ctl: 0x00000013
mmc2: sdhci: Power:     0x00000002 | Blk gap:  0x00000080
mmc2: sdhci: Wake-up:   0x00000008 | Clock:    0x0000007f
mmc2: sdhci: Timeout:   0x0000008f | Int stat: 0x00000000
mmc2: sdhci: Int enab:  0x107f100b | Sig enab: 0x107f100b
mmc2: sdhci: ACmd stat: 0x00000000 | Slot int: 0x00000302
mmc2: sdhci: Caps:      0x07eb0000 | Caps_1:   0x0000b400
mmc2: sdhci: Cmd:       0x0000353a | Max curr: 0x00ffffff
mmc2: sdhci: Resp[0]:   0x00001000 | Resp[1]:  0x00000000
mmc2: sdhci: Resp[2]:   0x00000000 | Resp[3]:  0x00000000
mmc2: sdhci: Host ctl2: 0x00000000
mmc2: sdhci: ADMA Err:  0x00000007 | ADMA Ptr: 0x9c042200
mmc2: sdhci-esdhc-imx: ========= ESDHC IMX DEBUG STATUS DUMP =========
mmc2: sdhci-esdhc-imx: cmd debug status:  0x2100
mmc2: sdhci-esdhc-imx: data debug status:  0x2200
mmc2: sdhci-esdhc-imx: trans debug status:  0x2300
mmc2: sdhci-esdhc-imx: dma debug status:  0x2402
mmc2: sdhci-esdhc-imx: adma debug status:  0x25b4
mmc2: sdhci-esdhc-imx: fifo debug status:  0x2610
mmc2: sdhci-esdhc-imx: async fifo debug status:  0x2751
mmc2: sdhci: ============================================

Would you have any other suggestions as to why this timeout happens?

Thanks,

Fabio Estevam

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: imx7d: Timeout waiting for hardware interrupt.
  2022-10-18 12:29     ` Fabio Estevam
@ 2022-10-18 17:20       ` Fabio Estevam
  2022-10-19 10:48         ` Bough Chen
  0 siblings, 1 reply; 8+ messages in thread
From: Fabio Estevam @ 2022-10-18 17:20 UTC (permalink / raw)
  To: Bough Chen
  Cc: linux-mmc, Adrian Hunter, dl-linux-imx, Sebastian Reichel, Martin Fuzzey

Hi Bough,

On Tue, Oct 18, 2022 at 9:29 AM Fabio Estevam <festevam@gmail.com> wrote:

> Would you have any other suggestions as to why this timeout happens?

Do you know if the following i.MX8M erratum applies to the imx7d as well?

e11232: USDHC: uSDHC setting requirement for IPG_CLK and AHB_BUS clocks
https://www.nxp.com/docs/en/errata/IMX8MDQLQ_1N14W.pdf

Thanks

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: imx7d: Timeout waiting for hardware interrupt.
  2022-10-18 17:20       ` Fabio Estevam
@ 2022-10-19 10:48         ` Bough Chen
  2022-10-19 13:10           ` Fabio Estevam
  0 siblings, 1 reply; 8+ messages in thread
From: Bough Chen @ 2022-10-19 10:48 UTC (permalink / raw)
  To: Fabio Estevam
  Cc: linux-mmc, Adrian Hunter, dl-linux-imx, Sebastian Reichel, Martin Fuzzey

> -----Original Message-----
> From: Fabio Estevam <festevam@gmail.com>
> Sent: 2022年10月19日 1:20
> To: Bough Chen <haibo.chen@nxp.com>
> Cc: linux-mmc <linux-mmc@vger.kernel.org>; Adrian Hunter
> <adrian.hunter@intel.com>; dl-linux-imx <linux-imx@nxp.com>; Sebastian
> Reichel <sebastian.reichel@collabora.com>; Martin Fuzzey
> <martin.fuzzey@flowbird.group>
> Subject: Re: imx7d: Timeout waiting for hardware interrupt.
> 
> Hi Bough,
> 
> On Tue, Oct 18, 2022 at 9:29 AM Fabio Estevam <festevam@gmail.com> wrote:
> 
> > Would you have any other suggestions as to why this timeout happens?
> 
> Do you know if the following i.MX8M erratum applies to the imx7d as well?

Hi Fabio, 

Yes, I think imx7d also has this limitation. Can you check whether the ipg and ahb clock source from pll_drm_533_clk on 5.10 stable tree?


 67static const char *nand_usdhc_bus_sel[] = { "osc", "pll_sys_pfd2_270m_clk",
 68         "pll_dram_533m_clk", "pll_sys_main_240m_clk",
 69         "pll_sys_pfd2_135m_clk", "pll_sys_pfd6_clk", "pll_enet_250m_clk",
 70         "pll_audio_post_div", };
 71
 72 static const char *ahb_channel_sel[] = { "osc", "pll_sys_pfd2_270m_clk",
 73         "pll_dram_533m_clk", "pll_sys_pfd0_392m_clk",
 74         "pll_enet_250m_clk", "pll_usb_main_clk", "pll_audio_post_div",
 75         "pll_video_post_div", };

Best Regards
Haibo Chen
> 
> e11232: USDHC: uSDHC setting requirement for IPG_CLK and AHB_BUS clocks
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.nxp
> .com%2Fdocs%2Fen%2Ferrata%2FIMX8MDQLQ_1N14W.pdf&amp;data=05%7
> C01%7Chaibo.chen%40nxp.com%7C23932650782d4c1c68ee08dab12d03c7%7C
> 686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C1%7C638017104137800766%7
> CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI
> 6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=G%2FmrmH5
> V659jok782%2BX4E8Nr67aNuISpfeyg8q4jetY%3D&amp;reserved=0
> 
> Thanks

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: imx7d: Timeout waiting for hardware interrupt.
  2022-10-19 10:48         ` Bough Chen
@ 2022-10-19 13:10           ` Fabio Estevam
  2022-10-19 14:26             ` Fabio Estevam
  0 siblings, 1 reply; 8+ messages in thread
From: Fabio Estevam @ 2022-10-19 13:10 UTC (permalink / raw)
  To: Bough Chen
  Cc: linux-mmc, Adrian Hunter, dl-linux-imx, Sebastian Reichel, Martin Fuzzey

Hi Bough,

On Wed, Oct 19, 2022 at 7:48 AM Bough Chen <haibo.chen@nxp.com> wrote:

> Hi Fabio,
>
> Yes, I think imx7d also has this limitation. Can you check whether the ipg and ahb clock source from pll_drm_533_clk on 5.10 stable tree?
>
>
>  67static const char *nand_usdhc_bus_sel[] = { "osc", "pll_sys_pfd2_270m_clk",
>  68         "pll_dram_533m_clk", "pll_sys_main_240m_clk",
>  69         "pll_sys_pfd2_135m_clk", "pll_sys_pfd6_clk", "pll_enet_250m_clk",
>  70         "pll_audio_post_div", };
>  71
>  72 static const char *ahb_channel_sel[] = { "osc", "pll_sys_pfd2_270m_clk",
>  73         "pll_dram_533m_clk", "pll_sys_pfd0_392m_clk",
>  74         "pll_enet_250m_clk", "pll_usb_main_clk", "pll_audio_post_div",
>  75         "pll_video_post_div", };

By default, on imx7 the ahb_root_clk and nand_usdhc_root_clk have the
same pll_sys_pfd2_270m_clk parent:

             pll_sys_pfd2_270m_clk       1        1        0
270000000          0     0  50000
                nand_usdhc_src        0        0        0   270000000
        0     0  50000
                   nand_usdhc_cg       0        0        0   270000000
         0     0  50000
                      nand_usdhc_pre_div       0        0        0
270000000          0     0  50000
                         nand_usdhc_root_clk       0        0        0
  270000000          0     0  50000
                            nand_usdhc_rawnand_clk       0        0
    0   270000000          0     0  50000
                ahb_src               1        1        0   270000000
        0     0  50000
                   ahb_cg             1        1        0   270000000
        0     0  50000
                      ahb_pre_div       1        1        0
270000000          0     0  50000
                         ahb_root_clk       2        3        0
135000000          0     0  50000

So they satisfy the condition requested by the erratum.

Do you know if we should increase the interrupt timeouts like the done
in the MSM driver?

commit 3f8920c5706e9a688705b6217996cde01e851591
Author: Shaik Sajida Bhanu <sbhanu@codeaurora.org>
Date:   Fri Jul 16 17:16:14 2021 +0530

    mmc: sdhci-msm: Update the software timeout value for sdhc

    [ Upstream commit 67b13f3e221ed81b46a657e2b499bf8b20162476 ]

    Whenever SDHC run at clock rate 50MHZ or below, the hardware data
    timeout value will be 21.47secs, which is approx. 22secs and we have
    a current software timeout value as 10secs. We have to set software
    timeout value more than the hardware data timeout value to avioid seeing
    the below register dumps.

    [  332.953670] mmc2: Timeout waiting for hardware interrupt.
    [  332.959608] mmc2: sdhci: ============ SDHCI REGISTER DUMP ===========
    [  332.966450] mmc2: sdhci: Sys addr:  0x00000000 | Version:  0x00007202
    [  332.973256] mmc2: sdhci: Blk size:  0x00000200 | Blk cnt:  0x00000001
    [  332.980054] mmc2: sdhci: Argument:  0x00000000 | Trn mode: 0x00000027
    [  332.986864] mmc2: sdhci: Present:   0x01f801f6 | Host ctl: 0x0000001f
    [  332.993671] mmc2: sdhci: Power:     0x00000001 | Blk gap:  0x00000000
    [  333.000583] mmc2: sdhci: Wake-up:   0x00000000 | Clock:    0x00000007
    [  333.007386] mmc2: sdhci: Timeout:   0x0000000e | Int stat: 0x00000000
    [  333.014182] mmc2: sdhci: Int enab:  0x03ff100b | Sig enab: 0x03ff100b
    [  333.020976] mmc2: sdhci: ACmd stat: 0x00000000 | Slot int: 0x00000000
    [  333.027771] mmc2: sdhci: Caps:      0x322dc8b2 | Caps_1:   0x0000808f
    [  333.034561] mmc2: sdhci: Cmd:       0x0000183a | Max curr: 0x00000000
    [  333.041359] mmc2: sdhci: Resp[0]:   0x00000900 | Resp[1]:  0x00000000
    [  333.048157] mmc2: sdhci: Resp[2]:   0x00000000 | Resp[3]:  0x00000000
    [  333.054945] mmc2: sdhci: Host ctl2: 0x00000000
    [  333.059657] mmc2: sdhci: ADMA Err:  0x00000000 | ADMA Ptr:
    0x0000000ffffff218
    [  333.067178] mmc2: sdhci_msm: ----------- VENDOR REGISTER DUMP
    -----------
    [  333.074343] mmc2: sdhci_msm: DLL sts: 0x00000000 | DLL cfg:
    0x6000642c | DLL cfg2: 0x0020a000
    [  333.083417] mmc2: sdhci_msm: DLL cfg3: 0x00000000 | DLL usr ctl:
    0x00000000 | DDR cfg: 0x80040873
    [  333.092850] mmc2: sdhci_msm: Vndr func: 0x00008a9c | Vndr func2 :
    0xf88218a8 Vndr func3: 0x02626040
    [  333.102371] mmc2: sdhci: ============================================

    So, set software timeout value more than hardware timeout value.

    Signed-off-by: Shaik Sajida Bhanu <sbhanu@codeaurora.org>
    Acked-by: Adrian Hunter <adrian.hunter@intel.com>
    Cc: stable@vger.kernel.org
    Link: https://lore.kernel.org/r/1626435974-14462-1-git-send-email-sbhanu@codeaurora.org
    Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

Or any other suggestions?

Thanks

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: imx7d: Timeout waiting for hardware interrupt.
  2022-10-19 13:10           ` Fabio Estevam
@ 2022-10-19 14:26             ` Fabio Estevam
  0 siblings, 0 replies; 8+ messages in thread
From: Fabio Estevam @ 2022-10-19 14:26 UTC (permalink / raw)
  To: Bough Chen
  Cc: linux-mmc, Adrian Hunter, dl-linux-imx, Sebastian Reichel, Martin Fuzzey

Hi Bough,

On Wed, Oct 19, 2022 at 10:10 AM Fabio Estevam <festevam@gmail.com> wrote:

> Or any other suggestions?

I am wondering if we are seeing some kind of clock glitch due to the
way that runtime suspend/resume are handled.

Currently, esdhc_pltfm_set_clock() changes the clock while ahb and ipg
clocks are on, which could be problematic.

I think we only need the per clock turned on while changing the clocks
inside esdhc_pltfm_set_clock().

What do you think about the change below?

https://pastebin.com/raw/U9KrHM1C

Thanks

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-10-19 14:41 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-24 13:31 imx7d: Timeout waiting for hardware interrupt Fabio Estevam
2022-05-25 10:21 ` Bough Chen
2022-05-26 19:07   ` Fabio Estevam
2022-10-18 12:29     ` Fabio Estevam
2022-10-18 17:20       ` Fabio Estevam
2022-10-19 10:48         ` Bough Chen
2022-10-19 13:10           ` Fabio Estevam
2022-10-19 14:26             ` Fabio Estevam

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.