Re: [PATCH v6] media: uvcvideo: Fix race condition with usb_kill_urb

From: Ricardo Ribalda
Date: Wed Jan 04 2023 - 16:12:15 EST


Hi Hillf

On Wed, 4 Jan 2023 at 21:54, Hillf Danton <hdanton@xxxxxxxx> wrote:
>
> On 3 Jan 2023 10:08:56 +0100 Ricardo Ribalda <ribalda@xxxxxxxxxxxx>
> >
> > Would it work?
>
> How did you test your patch v6?

I have not tested v6 besides the compile test. The last one that I
device tested was v4 (with atomics) and it didn't crash on x86. I
assumed that since this is more restrictive it was less likely to
fail.

I put this patch on top of my "granular power saving" patch, because
it is more likely to run into race conditions, and then try to
exercise the driver.

So you have a suggestion to trigger the race conditions more effectively?

To be clear, what I mean by would it work with smp_store_release and
smp_load_aqcuire, is that based on the doc it seems like the right
choe, but I am sure that you have more experience than me here :). I
usually rely on mutexes for this.

Thanks!



--
Ricardo Ribalda