Use raw_spin_unlock_irq instead spin_unlock_irq to avoid incompatible
pointer type error on preempt-rt branch:

kernel/workqueue.c:4176:17: error: passing argument 1 of 'rt_spin_lock'
from incompatible pointer type [-Werror=incompatible-pointer-types]
|  4176 |   spin_lock_irq(&wq_mayday_lock);
|       |                 ^~~~~~~~~~~~~~~
|       |                 |
|       |                 raw_spinlock_t * {aka struct raw_spinlock *}
include/linux/spinlock_rt.h:40:40: note: in definition of macro 'spin_lock'
|    40 | #define spin_lock(lock)   rt_spin_lock(lock)
|       |                                        ^~~~
kernel/workqueue.c:4176:3: note: in expansion of macro 'spin_lock_irq'
|  4176 |   spin_lock_irq(&wq_mayday_lock);
|       |   ^~~~~~~~~~~~~
include/linux/spinlock_rt.h:21:49: note: expected 'spinlock_t *'
{aka 'struct spinlock *'} but argument is of type 'raw_spinlock_t *'
{aka 'struct raw_spinlock *'}
|    21 | extern void __lockfunc rt_spin_lock(spinlock_t *lock);
|       |                                     ~~~~~~~~~~~~^~~~

Signed-off-by: Daniel Dragomir <[email protected]>
---
 kernel/workqueue.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index d88d11cfbad5..75f59299dd06 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -4173,9 +4173,9 @@ void destroy_workqueue(struct workqueue_struct *wq)
                struct worker *rescuer = wq->rescuer;
 
                /* this prevents new queueing */
-               spin_lock_irq(&wq_mayday_lock);
+               raw_spin_lock_irq(&wq_mayday_lock);
                wq->rescuer = NULL;
-               spin_unlock_irq(&wq_mayday_lock);
+               raw_spin_unlock_irq(&wq_mayday_lock);
 
                /* rescuer will empty maydays list before exiting */
                kthread_stop(rescuer->task);
-- 
2.17.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#8788): 
https://lists.yoctoproject.org/g/linux-yocto/message/8788
Mute This Topic: https://lists.yoctoproject.org/mt/75213396/21656
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/unsub  
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to