[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <26a91705-f721-03d1-f4c8-7f00ce0e65a8@gmail.com>
Date: Mon, 4 Apr 2022 00:15:11 +0300
From: Pavel Skripkin <paskripkin@...il.com>
To: Michael Straube <straube.linux@...il.com>,
"Fabio M. De Francesco" <fmdefrancesco@...il.com>
Cc: Greg KH <gregkh@...uxfoundation.org>,
Larry Finger <Larry.Finger@...inger.net>,
Phillip Potter <phil@...lpotter.co.uk>,
"open list:STAGING SUBSYSTEM" <linux-staging@...ts.linux.dev>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: staging: r8188eu: how to handle nested mutex under spinlock
Hi Michael,
On 4/3/22 23:51, Michael Straube wrote:
>>
>> IMO, the best answer is just remove this loop, since it does nothing. Or
>> redesign it to be more sane
>>
>> It waits for ps_processing to become 0 for 3000 ms, but if 3000 ms
>> expires... execution goes forward like as ps_processing was 0 from the
>> beginning
>>
>> Maybe it's something hw related, like wait for 3000 ms and all will be
>> ok. Can't say...
>>
>
> Hi Pavel,
>
> same with the loop that follows:
>
> /* System suspend is not allowed to wakeup */
> if (pwrpriv->bInSuspend) {
^^^^
btw, this part is useless to
> while (pwrpriv->bInSuspend &&
I've looked into what gcc11 produced from this function and looks like
my compiler is smart enough to not cache that value, but I am afraid not
all compilers are that smart.
And looks like it will be better to wait on mutex_lock(&pwrpriv->lock);
rather than odd loops. Ah, we can't wait here...
In first place, why this function cares about usb suspend callback?
I've got too many questions to that code... I'd better stop
> (rtw_get_passing_time_ms(start) <= 3000 ||
> (rtw_get_passing_time_ms(start) <= 500)))
> msleep(10);
> }
>
> I just waits 500ms if pwrpriv->bInSuspend is true. Additionaly the
> <= 3000 has no effect here because of the ored <= 500.
>
Yeah, and unfortunately it won't be optimized out :(
> Even worse the comment seems misleading because pwrpriv->bInSuspend
> indicates usb autosuspend but not system suspend.
>
With regards,
Pavel Skripkin
Download attachment "OpenPGP_signature" of type "application/pgp-signature" (841 bytes)
Powered by blists - more mailing lists