Hi, I am really sorry for the spamming ! I have not sent a patch to the Linux kernel mailing list for more than 20 years and mail clients do not behave as I expect. My first email was rejected from the mailing lists as it contained HTML. Indentation is not correct in the second one. I hope third one is correct. Just to make it clear this email I am using now is my private and nikolay.nikolov@xxxxxxxxx is my corporate. I am involved in embedded development of a 1LV wifi module and we are using highly patched driver from infineon: https://github.com/Infineon/ifx-backports And we have problems with this driver. I see some flags are used to prevent a race conditions between brcmf_sdio_bus_watchdog() and brcmf_sdio_dataworker() Infineon added some debug messages: WARN: Read operation when bus is in sleep state WARN: Write operation when bus is in sleep state These messages appear from time to time in our embedded system. It turns out the flags used to prevent such condition are not enough - dpc_running, dpc_triggered. What happens in SMP system is watchdog thread checks these flags and finds them set as false and proceeds to set the sdio bus to sleep. Exactly at the same moment while watchdog is setting sdio bus mode to sleep brcmf_sdio_dataworker is started, sets these flags to true and continues to transmit data. Watchdog unaware of this as flags were already checked sets the sdio bus to sleep. As dataworker continues to work, it finds the sdio bus sleeping which is a problem. We are using this patch at the moment and we do not experience this issue anymore. I will also send the patch to Infineon next week. We communicate through a reseller with them so it will take some time and effort. I hope I explained it good enough. If still not clear, please let me know. I will try to explain it better if I have missed something above. I think using mutex makes at least dpc_running flag irrelevant and could be removed. But for now I did not want to add more complexity in my patch. If you agree I can try to remove it in a new patch. Regards, Nikolay Nikolov On Sun, Jul 7, 2024 at 3:21 PM Arend Van Spriel <arend.vanspriel@xxxxxxxxxxxx> wrote: > > On July 7, 2024 2:22:49 PM Nikolay Nikolov <dobrev666@xxxxxxxxx> wrote: > > > Use mutex to prevent sdio bus to be put to sleep by the sdio_bus_watchdog > > while sdio dataworker handles sdio_dpc data transfers. > > Any reason for sending 3 identical patches within the hour. > > As to the patch itself I would like to know if there is a reported issue > being fixed here. What is the motivation behind this patch. Looking at the > code I do not think the mutex is needed so please elaborate. > > Regards, > Arend > > > Signed-off-by: Nikolay Nikolov <nikolay.nikolov@xxxxxxxxx> > > --- > > drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 6 ++++++ > > 1 file changed, 6 insertions(+) > >