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

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

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

1,048 次查看
jdepedro
Contributor IV

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?

标签 (3)
2 回复数

755 次查看
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Hi Jose,

Apparently this is related to kernel mmc driver issue, there is a patch but this is not implemented yet in current version of BSP, However is on schedule to appear on next BSP release.

[09/23] mmc: sdhci: fix incorrect get data interrupt during no data transfer - Patchwork 

For disable timeout errors, you can use disable_irq() it wont impact other peripherals for shared IRQ. or use  status= "disable"; on your dtb

Hope this helps

0 项奖励
回复

755 次查看
jdepedro
Contributor IV

Thanks for your answer.

Unfortunately seems like the patch does not solve the problem. But another workaround seems to be enough.

0 项奖励
回复