Re: [PATCHv2] thunderbolt: do not double dequeue a request

From: Sergey Senozhatsky
Date: Thu Mar 27 2025 - 11:04:29 EST


On (25/03/27 16:55), Mika Westerberg wrote:
[..]
> > Yes, if it's scheduled. If it's already executed then we can schedule
> > again.
> >
> > tb_cfg_request_sync() {
> > tb_cfg_request()
> > schedule_work()
>
> This point it runs tb_cfg_request_work() which then calls the callback
> (tb_cfg_request_complete()) before it dequeues so "done" is completed.
>
> > executes tb_cfg_request_dequeue
>
> > wait_for_completion_timeout()
>
> so this will return > 0 as "done" completed..
>
> > schedule_work()
> > executes tb_cfg_request_dequeue again
>
> ..and we don't call this one.

Ah, okay, I see. Thanks for the explanations. I'll drop
that one from the commit message then (let me re-spin v3,
just for the history).

[..]
> > Let me see what I can do (we don't normally apply patches that
> > were not in the corresponding subsystem tree).
> >
> > In the meantime, do you have a subsystem/driver tree that is exposed
> > to linux-next? If so, would be cool if you can pick up the patch so
> > that it can get some extra testing via linux-next.
>
> Yes I do, see [1] but it does not work like that. First you should make
> sure you patch works by testing it yourself and then we can pick it up for
> others to test.

Sure, if I had the H/W testing would have done by now. OK, let me try
to work this out.