[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87mtfppqi8.ffs@tglx>
Date: Tue, 10 May 2022 13:37:51 +0200
From: Thomas Gleixner <tglx@...utronix.de>
To: Thomas Pfaff <tpfaff@....com>
Cc: linux-kernel@...r.kernel.org, linux-rt-users@...r.kernel.org
Subject: Re: [PATCH v3] irq/core: synchronize irq_thread startup
On Tue, May 10 2022 at 13:34, Thomas Gleixner wrote:
> On Tue, May 10 2022 at 10:43, Thomas Pfaff wrote:
>> It can be done only before the interrupt thread is stopped, and free_irq()
>> itself is already taking care about synchronizing, no matter if its done by
>> __synchronize_hardirq() or by synchronize_irq(), like it was before commit
>> 519cc8652b3a.
>
> No, it does not really take care about it. It can return with
> irq_desc::threads_active > 0 due to the interrupt thread being stopped
> before reaching the thread function. Think about shared interrupts.
Duh. Hit send too fast.
It does matter whether the synchronization is done via
__synchronize_hardirq() or via synchronize_irq(). The latter ensured
that the thread reached the thread function and handled the pending
wakeup _before_ kthread_stop() become true.
So the fix is required to undo the damage created by 519cc8652b3a.
The synchronize_irq() after free_irq() is a completely different
problem.
Thanks,
tglx
Powered by blists - more mailing lists