CMD CRC error on SDIO interface used for Wifi on Jetson TX2

Hi All,

We are using CY4354 wifi bt module on SDIO interface on JEtson TX2. After few hours of doing file transfer through tftp utility we are getting CMD CRC error and the TX2 custom board is rebooting.

I am attaching here is the piece of device tree node and error log.
DTS Nodes:
sdmmc3: sdhci@3440000 {
compatible = “nvidia,tegra186-sdhci”;
reg = <0x0 0x3440000 0x0 0x210>;
interrupts = < 0 64 0x04>;
max-clk-limit = <204000000>;
ddr-clk-limit = <48000000>;
tap-delay = <11>;
trim-delay = <5>;
nvidia,ddr-tap-delay = <11>;
ddr-trim-delay = <5>;
bus-width = <4>;
ignore-pm-notify;
mmc-ocr-mask = <0>;
keep-power-in-suspend;
non-removable;
cap-mmc-highspeed;
cap-sd-highspeed;
pwrdet-support;
pinctrl-names = “sdmmc_e_33v_enable”, “sdmmc_e_33v_disable”;
pinctrl-0 = <&sdmmc3_e_33V_enable>;
pinctrl-1 = <&sdmmc3_e_33V_disable>;
compad-vref-3v3 = <0x1>;
compad-vref-1v8 = <0x2>;
nvidia,min-tap-delay = <84>;
nvidia,max-tap-delay = <136>;
pll_source = “pll_p”;
resets = <&tegra_car TEGRA186_RESET_SDMMC3>;
reset-names = “sdhci”;
clocks = <&tegra_car TEGRA186_CLK_SDMMC3>,
<&tegra_car TEGRA186_CLK_PLLP_OUT0>,
<&tegra_car TEGRA186_CLK_SDMMC_LEGACY_TM>;
clock-names = “sdmmc”, “pll_p”, “sdmmc_legacy_tm”;
iommus = <&smmu TEGRA_SID_SDMMC3A>;
nvidia,en-periodic-calib;
force-non-removable-rescan;
status = “disabled”;
};

   sdhci@3440000 {         /*added AW-CM235NF wifi support on SDMMC3*/
            #address-cells = <1>;
            #size-cells = <0>;
            uhs-mask = <0x8>;
            only-1-8-v;
            non-removable;
            force-non-removable-rescan;
            no-sd;
            max-clk-limit = <25000000>;
            status = "okay";
            brcmfmac: brcmfmac@0 {
                    reg = <0>;
                    compatible = "brcm,bcm4329-fmac";
            };
    };

Error Log:

[ 4088.507301] brcmfmac: brcmf_sdio_bus_sleep: error while changing bus sleep state -110
[ 4445.932791] mmc1: CMD CRC or end bit error, int mask 0x60001
[ 4466.938819] INFO: rcu_preempt detected stalls on CPUs/tasks:
[ 4466.944674] 0-…: (3 GPs behind) idle=337/2/0 softirq=331152/331152 fqs=2558
[ 4466.952050] (detected by 1, t=5255 jiffies, g=363891, c=363890, q=94)
[ 4472.087338] NMI watchdog: BUG: soft lockup - CPU#0 stuck for 22s! [swapper/0:0]
[ 4472.095102] Kernel panic - not syncing: softlockup: hung tasks
[ 4472.100966] CPU: 0 PID: 0 Comm: swapper/0 Tainted: G W O L 4.9.140-tegra #20
[ 4472.108824] Hardware name: lightning (DT)
[ 4472.112853] Call trace:
[ 4472.115330] [] dump_backtrace+0x0/0x198
[ 4472.120753] [] show_stack+0x24/0x30
[ 4472.125829] [] dump_stack+0x98/0xc0
[ 4472.130905] [] panic+0x11c/0x298
[ 4472.135720] [] watchdog_unpark_threads+0x0/0x98
[ 4472.141836] [] __hrtimer_run_queues+0xd8/0x360
[ 4472.147862] [] hrtimer_interrupt+0xa8/0x1e0
[ 4472.153633] [] tegra186_timer_isr+0x34/0x48
[ 4472.159400] [] __handle_irq_event_percpu+0x68/0x288
[ 4472.165859] [] handle_irq_event_percpu+0x28/0x60
[ 4472.172057] [] handle_irq_event+0x50/0x80
[ 4472.177651] [] handle_fasteoi_irq+0xc8/0x1b8
[ 4472.183502] [] generic_handle_irq+0x34/0x50
[ 4472.189266] [] __handle_domain_irq+0x68/0xc0
[ 4472.195114] [] gic_handle_irq+0x5c/0xb0
[ 4472.200530] [] el1_irq+0xe8/0x194
[ 4472.205431] [] irq_exit+0xd0/0x118
[ 4472.210412] [] __handle_domain_irq+0x6c/0xc0
[ 4472.216261] [] gic_handle_irq+0x5c/0xb0
[ 4472.221677] [] el1_irq+0xe8/0x194

Please suggest what can be the possible reasons of this error and how to debug further.

Thanks

I couldn’t tell you the cause, but apparently it is an error when waking up or going into a low power sleep mode. A pretty common error in USB equipment, but haven’t heard of it being an issue for any SDIO interface. Someone else may know of a way to prevent this from going into sleep mode, perhaps via a device tree or kernel command line edit (I only know the answer for doing this with USB).

1 Like

Are you sure the wifi driver only needs this property?

The last time we enable bcmd4354 wifi driver, we need to give interrupt and fw info to the driver.

brcmfmac: brcmfmac@0 {
                    reg = <0>;
                    compatible = "brcm,bcm4329-fmac";
            };
bcm4354: bcmdhd_wlan {
	compatible = "android,bcmdhd_wlan";
	interrupt-parent = <&tegra_main_gpio>;
	interrupts = <TEGRA194_MAIN_GPIO(Q, 6) 0x14>; /* can take GPIO as per the board design */
	fw_path = "/lib/firmware/brcm/fw_bcmdhd-old-unlocked.bin";
	nv_path = "/lib/firmware/brcm/nvram.txt";
	sdhci-host = <&sdmmc3>;
	pwr-retry-cnt = <3>;
	status = "okay";
 };

Hi Wayne,

With these many properties my wifi driver is working well. the only issue i am facing is CRC error randomly.

We are able to get a fix for this issue, it was due to sleep and PM Power management being enabled in the config of Wifi Driver. There were certain scenario where the sdio bus sleep and wake was going for a toss and randomly it was resulting in CRC CMD error which in turn leads to device reboot. We got this resolved by disabling the sdio bus sleep calls and PM Power management.

Thanks

1 Like

Is this fix inside the the vendor wifi dirver or the sdhci driver?

This fix we did in Wifi Driver not in SDHCI Driver

Can you share your solution/patch here to help other users?

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.