Patch "um: change sigio_spinlock to a mutex" has been added to the 5.9-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    um: change sigio_spinlock to a mutex

to the 5.9-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     um-change-sigio_spinlock-to-a-mutex.patch
and it can be found in the queue-5.9 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit acba3ca0949e9d5841542363b96bca728efafe9e
Author: Johannes Berg <johannes.berg@xxxxxxxxx>
Date:   Thu Jun 4 13:23:17 2020 +0200

    um: change sigio_spinlock to a mutex
    
    [ Upstream commit f2d05059e15af3f70502074f4e3a504530af504a ]
    
    Lockdep complains at boot:
    
    =============================
    [ BUG: Invalid wait context ]
    5.7.0-05093-g46d91ecd597b #98 Not tainted
    -----------------------------
    swapper/1 is trying to lock:
    0000000060931b98 (&desc[i].request_mutex){+.+.}-{3:3}, at: __setup_irq+0x11d/0x623
    other info that might help us debug this:
    context-{4:4}
    1 lock held by swapper/1:
     #0: 000000006074fed8 (sigio_spinlock){+.+.}-{2:2}, at: sigio_lock+0x1a/0x1c
    stack backtrace:
    CPU: 0 PID: 1 Comm: swapper Not tainted 5.7.0-05093-g46d91ecd597b #98
    Stack:
     7fa4fab0 6028dfd1 0000002a 6008bea5
     7fa50700 7fa50040 7fa4fac0 6028e016
     7fa4fb50 6007f6da 60959c18 00000000
    Call Trace:
     [<60023a0e>] show_stack+0x13b/0x155
     [<6028e016>] dump_stack+0x2a/0x2c
     [<6007f6da>] __lock_acquire+0x515/0x15f2
     [<6007eb50>] lock_acquire+0x245/0x273
     [<6050d9f1>] __mutex_lock+0xbd/0x325
     [<6050dc76>] mutex_lock_nested+0x1d/0x1f
     [<6008e27e>] __setup_irq+0x11d/0x623
     [<6008e8ed>] request_threaded_irq+0x169/0x1a6
     [<60021eb0>] um_request_irq+0x1ee/0x24b
     [<600234ee>] write_sigio_irq+0x3b/0x76
     [<600383ca>] sigio_broken+0x146/0x2e4
     [<60020bd8>] do_one_initcall+0xde/0x281
    
    Because we hold sigio_spinlock and then get into requesting
    an interrupt with a mutex.
    
    Change the spinlock to a mutex to avoid that.
    
    Signed-off-by: Johannes Berg <johannes.berg@xxxxxxxxx>
    Signed-off-by: Richard Weinberger <richard@xxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/arch/um/kernel/sigio.c b/arch/um/kernel/sigio.c
index 10c99e058fcae..d1cffc2a7f212 100644
--- a/arch/um/kernel/sigio.c
+++ b/arch/um/kernel/sigio.c
@@ -35,14 +35,14 @@ int write_sigio_irq(int fd)
 }
 
 /* These are called from os-Linux/sigio.c to protect its pollfds arrays. */
-static DEFINE_SPINLOCK(sigio_spinlock);
+static DEFINE_MUTEX(sigio_mutex);
 
 void sigio_lock(void)
 {
-	spin_lock(&sigio_spinlock);
+	mutex_lock(&sigio_mutex);
 }
 
 void sigio_unlock(void)
 {
-	spin_unlock(&sigio_spinlock);
+	mutex_unlock(&sigio_mutex);
 }



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux