Re: [PATCH 1/2] drm/panthor: Replace sleep locks with spinlocks in fdinfo path

2025-02-12 Thread Tvrtko Ursulin
On 12/02/2025 16:33, Boris Brezillon wrote: On Tue, 11 Feb 2025 11:39:49 + Tvrtko Ursulin wrote: On 10/02/2025 16:08, Adrián Larumbe wrote: Hi Tvrtko, Thanks! [18153.770244] BUG: sleeping function called from invalid context at kernel/locking/mutex.c:562 [18153.771059] in_atomic():

Re: [PATCH 1/2] drm/panthor: Replace sleep locks with spinlocks in fdinfo path

2025-02-12 Thread Boris Brezillon
On Tue, 11 Feb 2025 11:39:49 + Tvrtko Ursulin wrote: > On 10/02/2025 16:08, Adrián Larumbe wrote: > > Hi Tvrtko, > > Thanks! > > > [18153.770244] BUG: sleeping function called from invalid context at > > kernel/locking/mutex.c:562 > > [18153.771059] in_atomic(): 1, irqs_disabled(): 0, no

Re: [PATCH 1/2] drm/panthor: Replace sleep locks with spinlocks in fdinfo path

2025-02-12 Thread Adrián Larumbe
Hi Boris, Here are the branch and kernel config I used for reproducing the bug: https://gitlab.freedesktop.org/larumbe/drm-misc/-/tree/panthor-fdinfo-internalbosizes-10 https://gitlab.collabora.com/-/snippets/426 On 11.02.2025 13:41, Boris Brezillon wrote: > On Tue, 11 Feb 2025 11:39:49 + >

Re: [PATCH 1/2] drm/panthor: Replace sleep locks with spinlocks in fdinfo path

2025-02-11 Thread Boris Brezillon
On Tue, 11 Feb 2025 11:39:49 + Tvrtko Ursulin wrote: > On 10/02/2025 16:08, Adrián Larumbe wrote: > > Hi Tvrtko, > > Thanks! > > > [18153.770244] BUG: sleeping function called from invalid context at > > kernel/locking/mutex.c:562 > > [18153.771059] in_atomic(): 1, irqs_disabled(): 0, no

Re: [PATCH 1/2] drm/panthor: Replace sleep locks with spinlocks in fdinfo path

2025-02-11 Thread Tvrtko Ursulin
On 10/02/2025 16:08, Adrián Larumbe wrote: Hi Tvrtko, Thanks! [18153.770244] BUG: sleeping function called from invalid context at kernel/locking/mutex.c:562 [18153.771059] in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 203412, name: cat [18153.771757] preempt_count: 1, expected:

Re: [PATCH 1/2] drm/panthor: Replace sleep locks with spinlocks in fdinfo path

2025-02-10 Thread Adrián Larumbe
This is the debug log for the second patch in the series: [18325.029172] BUG: sleeping function called from invalid context at kernel/locking/mutex.c:562 [18325.029947] in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 203483, name: cat [18325.030646] preempt_count: 1, expected: 0 [18325.03

Re: [PATCH 1/2] drm/panthor: Replace sleep locks with spinlocks in fdinfo path

2025-02-10 Thread Adrián Larumbe
Hi Tvrtko, [18153.770244] BUG: sleeping function called from invalid context at kernel/locking/mutex.c:562 [18153.771059] in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 203412, name: cat [18153.771757] preempt_count: 1, expected: 0 [18153.772164] RCU nest depth: 0, expected: 0 [18153.772

Re: [PATCH 1/2] drm/panthor: Replace sleep locks with spinlocks in fdinfo path

2025-02-10 Thread Tvrtko Ursulin
On 10/02/2025 12:41, Adrián Larumbe wrote: Panthor's fdinfo handler is routed through the /proc file system, which executes in an atomic context. That means we cannot use mutexes because they might sleep. Have the debug splat at hand? I am thinking it is not because of fdinfo reads, which ar

Re: [PATCH 1/2] drm/panthor: Replace sleep locks with spinlocks in fdinfo path

2025-02-10 Thread Liviu Dudau
On Mon, Feb 10, 2025 at 12:41:59PM +, Adrián Larumbe wrote: > Panthor's fdinfo handler is routed through the /proc file system, which > executes in an atomic context. That means we cannot use mutexes because > they might sleep. > > This bug was uncovered by enabling some of the kernel's mutex-

Re: [PATCH 1/2] drm/panthor: Replace sleep locks with spinlocks in fdinfo path

2025-02-10 Thread Boris Brezillon
On Mon, 10 Feb 2025 12:41:59 + Adrián Larumbe wrote: > Panthor's fdinfo handler is routed through the /proc file system, which > executes in an atomic context. That means we cannot use mutexes because > they might sleep. > > This bug was uncovered by enabling some of the kernel's mutex-debug

[PATCH 1/2] drm/panthor: Replace sleep locks with spinlocks in fdinfo path

2025-02-10 Thread Adrián Larumbe
Panthor's fdinfo handler is routed through the /proc file system, which executes in an atomic context. That means we cannot use mutexes because they might sleep. This bug was uncovered by enabling some of the kernel's mutex-debugging features: CONFIG_DEBUG_RT_MUTEXES=y CONFIG_DEBUG_MUTEXES=y Rep