2024-04-10 19:21:34

by Larry Finger

[permalink] [raw]
Subject: Need Help with SDIO device

Hi,

I am helping a user of the RTW8821CS device, which fails on startup. The device
is composed of an SDIO wifi unit, and a UART-based Bluetooth section. Our
discussion is at https://github.com/lwfinger/rtw88/issues/187.

What an msleep(150) was added just before the SDIO probe routine proceeds, the
success rate was about 60%. Examination of the dmesg logs of 10 runs showed that
when the BT section completed its initialization before the SDIO probe routine
was executed, wifi started without error. If the SDIO routine was entered before
the BT driver completed initialization, wifi failed with error -110 for SDIO
read/write operations.

What mechanism is available to ensure that one driver finishes initialization
before another starts? Is there anything more sophisticated than an mdelay(500)
at the start of the SDIO probe routine?

Thanks,

Larry