AnsweredAssumed Answered

sdio_reset_comm issues with BCM4343W (6sl/4.1.15)

Question asked by jayakumar2 on Aug 18, 2017
Latest reply on Aug 23, 2017 by Nick Bourdon

Hi,

I'm using a BCM4343W wifi chip with 6sl running Linux 4.1.15. I'm able to have bootup communication with the BCM4343W but when I try to turn on the interface (ifconfig wlan0 up), I get a -110 (ETIMEDOUT) failure associated with SD_IO_SEND_OP_COND.

 

I have tried varying my dts settings in case they were related. I originally had:

&usdhc3 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_usdhc3>;
no-1-8-v;
non-removable;
pm-ignore-notify;
bus-width = <4>;
vmmc-supply = <&wlreg_on>;
keep-power-in-suspend;
enable-sdio-wakeup;
status = "okay";
needs-special-hs-handling;
wifi-host;
};

 

and have tried taking out parameters one at a time to see if any have an effect. The bare minimum to detect the chip and have the driver load was:

 

&usdhc3 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_usdhc3>;
wifi-host;
status = "okay";

bus-width = <4>;
vmmc-supply = <&wlreg_on>;
};

 

The failure remains the same for that.

 

root@imx6slevk:~# ifconfig wlan0 up

Dongle Host Driver, version 1.141.92 (r)
Compiled in drivers/net/wireless/bcmdhd
wl_android_wifi_on in
mmc_send_io_op_cond: err=-110
sdio_reset_comm:801: err=-110
mmc2: Error resetting SDIO communications (-110)
sdioh_start Failed, error = -110

failed to power up wifi chip, retry again (4 left) **, ret=-110

mmc_send_io_op_cond: err=-110
sdio_reset_comm:801: err=-110
mmc2: Error resetting SDIO communications (-110)
sdioh_start Failed, error = -110

failed to power up wifi chip, retry again (3 left) **, ret=-110

...

failed to power up wifi chip, max retry reached **

dhd_open : wl_android_wifi_on failed (-110)
wl_android_wifi_off in
ifconfig: SIOCSIFFLAGS: Operation not permitted

 

I tried to narrow down the cause further.

 

The start of the problem comes from drivers/net/wireless/bcmdhd/wl_android.c:int wl_android_wifi_on(struct net_device *dev)

...
do {
dhd_net_wifi_platform_set_power(dev, TRUE, WIFI_TURNON_DELAY);
#ifdef BCMSDIO
ret = dhd_net_bus_resume(dev, 0);
#endif

 

The dhd_net_bus_resume is failing with -110 (etimedout) because it calls sdioh_start() which fails when calling sdio_reset_comm. The debug shows the callstack is:

 

mmc_send_io_op_cond: err=-110
sdio_reset_comm:801: err=-110
mmc2: Error resetting SDIO communications (-110)
sdioh_start Failed, error = -110

 

The call to sdio_reset_comm has this comment:

 

/* Since the power to the chip is killed, we will have
re enumerate the device again. Set the block size
and enable the fucntion 1 for in preparation for
downloading the code
*/
/* sdio_reset_comm() - has been fixed in latest kernel/msm.git for Linux
2.6.27. The implementation prior to that is buggy, and needs broadcom's
patch for it
*/
if ((ret = sdio_reset_comm(sd->func[0]->card))) {
sd_err(("%s Failed, error = %d\n", __FUNCTION__, ret));
return ret;
}

 

I tried to debug sdio_reset_comm further and it fails due to:

 

err = mmc_send_io_op_cond(host, 0, &ocr);

 

That gives -etimedout.

 

Based on that, I think what's happening is that the host is sending SD_IO_SEND_OP_COND which is SDIO command CMD5 and that command is timing out. But I have not yet worked out why this is happening.

 

 

I would welcome any ideas or suggestions.

 

Thanks!

Outcomes