• Michael Holzheu's avatar
    s390/debug: Fix s390dbf lockdep problem in debug_(un)register_view() · 5a334c08
    Michael Holzheu authored
    The debug_register/unregister_view() functions call debugfs_remove()
    while holding the debug_info spinlock. Because debugfs_remove() takes
    a mutex and therefore can sleep this is not allowed. To fix the problem
    we give up the debug_info lock before calling debugfs_remove().
    
    The following shows the lockdep message:
    
    [ INFO: possible circular locking dependency detected ]
    -------------------------------------------------------
    rmmod/4379 is trying to acquire lock:
    (&sb->s_type->i_mutex_key#2){+.+.+.}, at: [<00000000003acae2>] debugfs_remove+0x5e/0xa
    
    but task is already holding lock:
    (&(&rc->lock)->rlock){-.-...}, at: [<000000000010a5ae>] debug_unregister_view+0x3a/0xd
    
    which lock already depends on the new lock.
    
    -> #0 (&sb->s_type->i_mutex_key#2){+.+.+.}:
    [<00000000001b1644>] validate_chain+0x880/0x1154
    [<00000000001b4d6c>] __lock_acquire+0x414/0xc44
    [<00000000001b5c16>] lock_acquire+0xbe/0x178
    [<0000000000614016>] mutex_lock_nested+0x66/0x36c
    [<00000000003acae2>] debugfs_remove+0x5e/0xac
    [<000000000010a620>] debug_unregister_view+0xac/0xd0
    [<000003ff8002f140>] qeth_core_exit+0x48/0xf08 [qeth]
    [<00000000001c35a4>] SyS_delete_module+0x1a4/0x260
    [<0000000000618134>] sysc_noemu+0x22/0x28
    [<000003fffd4704da>] 0x3fffd4704da
    Signed-off-by: default avatarMichael Holzheu <holzheu@linux.vnet.ibm.com>
    Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
    5a334c08
debug.c 35.4 KB