Re: [PATCH] media/cec/core: fix task hung in cec_claim_log_addrs

From: Hans Verkuil
Date: Thu Feb 22 2024 - 07:16:19 EST


On 22/02/2024 11:43, Hillf Danton wrote:
> On Wed, 21 Feb 2024 15:38:47 +0100 Hans Verkuil <hverkuil-cisco@xxxxxxxxx>
>> On 21/02/2024 15:20, Edward Adam Davis wrote:
>>> After unlocking adap->lock in cec_claim_log_addrs(), cec_claim_log_addrs() may
>>> re-enter, causing this issue to occur.
>>
>> But if it is called again, then it should hit this at the start of the function:
>>
>> if (WARN_ON(adap->is_configuring || adap->is_configured))
>> return;
>>
>> I'm still not sure what causes the KASAN hung task since I cannot seem to reproduce
>> it, and because it is hard for me to find enough time to dig into this.
>
> Likely because of the window for initializing completion more than once [1].
>
> [1] https://lore.kernel.org/lkml/00000000000054a54e0611f1bc01@xxxxxxxxxx/

I have been able to reproduce this by adding msleeps in several places.

When I have some more time I will start digging into this.

Regards,

Hans