AnsweredAssumed Answered

i.MX6Q/UL, broken-cd causes many interrupts from uSDHC

Question asked by Jose Diaz de Grenu de Pedro on May 22, 2017
Latest reply on Jun 15, 2017 by Jose Diaz de Grenu de Pedro

I am working on a platform based on the i.MX6Q which does not have the card detect line connected to the uSD socket. For that reason, it uses the 'broken-cd' standard kernel funcitonality to periodically poll the status of the interface and be able to support hotplug card detection.

 

The problem is that, when a card is removed, I constantly get interrupts from the uSDHC controller used for the uSD at a high rate (about 50 interrupts per second). After adding some debugging, the interrupt is:

 

[ 23.331244] *** mmc1 got interrupt: 0x00000001  <--- Command complete
[ 23.339184] *** mmc1 got interrupt: 0x00010000  <--- All these are Command Timeout Error
[ 23.346165] *** mmc1 got interrupt: 0x00010000
[ 23.353104] *** mmc1 got interrupt: 0x00010000
[ 23.360034] *** mmc1 got interrupt: 0x00010000
[ 23.366964] *** mmc1 got interrupt: 0x00010000
[ 23.373901] *** mmc1 got interrupt: 0x00010000
[ 23.380830] *** mmc1 got interrupt: 0x00010000
[ 23.387760] *** mmc1 got interrupt: 0x00010000
[ 23.394693] *** mmc1 got interrupt: 0x00010000
[ 23.402638] *** mmc1 got interrupt: 0x00010000
[ 23.454782] *** mmc1 got interrupt: 0x00010000

 

This has a performance hit on the processsor, especially on i.MX6UL, where the behavior is also reproducible.

 

When the card is inserted back, the interrupts rate goes back to 1 per second (as expected, one per each CMD the MMC core framework is polling). I would expect the same rate when there the uSD card is not removed.

 

This is reproducible in the i.MX6Q EVK with the following device tree:

 

usdhc@02194000 {
compatible = "fsl,imx6q-usdhc";
reg = <0x2194000 0x4000>;
interrupts = <0x0 0x17 0x4>;
clocks = <0x3 0xa4 0x3 0xa4 0x3 0xa4>;
clock-names = "ipg", "ahb", "per";
bus-width = <0x8>;
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <0x23>;
no-1-8-v;
keep-power-in-suspend;
enable-sdio-wakeup;
broken-cd;
};

 

usdhc@02198000 {
compatible = "fsl,imx6q-usdhc";
reg = <0x2198000 0x4000>;
interrupts = <0x0 0x18 0x4>;
clocks = <0x3 0xa5 0x3 0xa5 0x3 0xa5>;
clock-names = "ipg", "ahb", "per";
bus-width = <0x8>;
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <0x25>;
no-1-8-v;
keep-power-in-suspend;
enable-sdio-wakeup;
broken-cd;
};

 

 

 

1) Is this expected behavior?

2) Could the driver disable Time out interrupts when the card is unplugged to avoid this?

Outcomes