> > drivers/staging/r8188eu/core/rtw_pwrctrl.c:379
> > if (pwrpriv->ps_processing) {
> while (pwrpriv->ps_processing && rtw_get_passing_time_ms(start) <= 3000)
> msleep(10);
> }
>
Hm, just wondering, shouldn't we annotate load from pwrpriv->ps_processing with READ_ONCE() inside while loop?
IIUC compiler might want to cache first load into register and we will stuck here forever.
You're right. This can be cached. In situations like these one should use
barriers or other API that use barriers implicitly (completions, for example).
In this list, a couple of weeks ago, I suggested someone to use them. He/she
re-submitted his/her patches with wait_for_completion() / complete(), I placed
my Reviewed-by tag and Greg was happy to accept it and merge.
Not sure about READ_ONCE(), because, as far as I know, it is used only to
prevent load tearing. But I might be wrong here.
Fabio
P.S.: Is Paul's book still un-read? Unfortunately, I am not yet done :(
Attachment:
OpenPGP_signature
Description: OpenPGP digital signature