Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

possible recursive locking detected when doing fsi rescan #191

Open
shenki opened this issue Apr 15, 2020 · 1 comment
Open

possible recursive locking detected when doing fsi rescan #191

shenki opened this issue Apr 15, 2020 · 1 comment

Comments

@shenki
Copy link
Member

shenki commented Apr 15, 2020

root@spork-bmc:~# echo 1 > /sys/class/fsi-master/fsi0/rescan 
[ 5391.476549] 
[ 5391.478235] ============================================
[ 5391.484171] WARNING: possible recursive locking detected
[ 5391.490109] 5.4.32-00259-g49233ddf638c-dirty #169 Not tainted
[ 5391.496527] --------------------------------------------
[ 5391.502478] sh/381 is trying to acquire lock:
[ 5391.507350] b58116e8 (&master->scan_lock){+.+.}, at: fsi_master_unregister+0x44/0x70
[ 5391.516023] 
[ 5391.516023] but task is already holding lock:
[ 5391.522536] bc8c3f28 (&master->scan_lock){+.+.}, at: fsi_master_rescan+0x28/0x58
[ 5391.530805] 
[ 5391.530805] other info that might help us debug this:
[ 5391.538088]  Possible unsafe locking scenario:
[ 5391.538088] 
[ 5391.544692]        CPU0
[ 5391.547417]        ----
[ 5391.550141]   lock(&master->scan_lock);
[ 5391.554420]   lock(&master->scan_lock);
[ 5391.558700] 
[ 5391.558700]  *** DEADLOCK ***
[ 5391.558700] 
[ 5391.565305]  May be due to missing lock nesting notation
[ 5391.565305] 
[ 5391.572881] 5 locks held by sh/381:
[ 5391.576770]  #0: b46fb270 (sb_writers#5){.+.+}, at: vfs_write+0x15c/0x18c
[ 5391.584360]  #1: b4906404 (&of->mutex){+.+.}, at: kernfs_fop_write+0xf8/0x264
[ 5391.592335]  #2: bc8c0f78 (kn->count#150){.+.+}, at: kernfs_fop_write+0x100/0x264
[ 5391.600698]  #3: bc8c3f28 (&master->scan_lock){+.+.}, at: fsi_master_rescan+0x28/0x58
[ 5391.609446]  #4: b57df8bc (&dev->mutex){....}, at: __device_driver_lock+0x3c/0x50
[ 5391.617809] 
[ 5391.617809] stack backtrace:
[ 5391.622673] CPU: 1 PID: 381 Comm: sh Not tainted 5.4.32-00259-g49233ddf638c-dirty #169
[ 5391.631508] Hardware name: Generic DT based system
[ 5391.636852] Backtrace: 
[ 5391.639590] [<8010f384>] (dump_backtrace) from [<8010f5b8>] (show_stack+0x20/0x24)
[ 5391.648042]  r7:00000080 r6:60000093 r5:00000000 r4:80e7052c
[ 5391.654353] [<8010f598>] (show_stack) from [<8092ba74>] (dump_stack+0xe0/0x114)
[ 5391.662516] [<8092b994>] (dump_stack) from [<80189874>] (__lock_acquire+0x7ec/0x253c)
[ 5391.671257]  r7:bc94f200 r6:bc94f780 r5:812fce44 r4:812fce44
[ 5391.677576] [<80189088>] (__lock_acquire) from [<8018bea4>] (lock_acquire+0xd0/0x27c)
[ 5391.686321]  r10:60000013 r9:8148fdc0 r8:00000000 r7:00000000 r6:00000000 r5:00000000
[ 5391.695061]  r4:b58116e8
[ 5391.697893] [<8018bdd4>] (lock_acquire) from [<80948fc8>] (__mutex_lock+0xa8/0xabc)
[ 5391.706443]  r10:00000051 r9:8148fdc0 r8:bd154000 r7:00000000 r6:00000000 r5:00000000
[ 5391.715182]  r4:b58116b4
[ 5391.718012] [<80948f20>] (__mutex_lock) from [<8094acd0>] (mutex_lock_nested+0x2c/0x34)
[ 5391.726949]  r10:00000051 r9:b581f400 r8:bd154000 r7:00000000 r6:80e64610 r5:b58116b4
[ 5391.735687]  r4:b5811400
[ 5391.738515] [<8094aca4>] (mutex_lock_nested) from [<8075a9b8>] (fsi_master_unregister+0x44/0x70)
[ 5391.748332] [<8075a974>] (fsi_master_unregister) from [<8075aa58>] (hub_master_remove+0x20/0x44)
[ 5391.758139]  r5:00000000 r4:b5811400
[ 5391.762134] [<8075aa38>] (hub_master_remove) from [<805d291c>] (device_release_driver_internal+0xfc/0x1b4)
[ 5391.772910]  r5:00000000 r4:b57df800
[ 5391.776903] [<805d2820>] (device_release_driver_internal) from [<805d29f4>] (device_release_driver+0x20/0x24)
[ 5391.787971]  r7:00000000 r6:80e64160 r5:b57df800 r4:bd3eec4c
[ 5391.794289] [<805d29d4>] (device_release_driver) from [<805d0368>] (bus_remove_device+0xe0/0x148)
[ 5391.804199] [<805d0288>] (bus_remove_device) from [<805ccb18>] (device_del+0x14c/0x398)
[ 5391.813134]  r7:00000000 r6:bd154000 r5:b57df888 r4:b57df800
[ 5391.819454] [<805cc9cc>] (device_del) from [<805ccd88>] (device_unregister+0x24/0x6c)
[ 5391.828197]  r10:00000051 r9:bd155f60 r8:019fb498 r7:00000000 r6:bd154000 r5:807584cc
[ 5391.836937]  r4:b57df800
[ 5391.839775] [<805ccd64>] (device_unregister) from [<807584e4>] (fsi_slave_remove_device+0x18/0x20)
[ 5391.849778]  r5:807584cc r4:00000000
[ 5391.853772] [<807584cc>] (fsi_slave_remove_device) from [<805cd210>] (device_for_each_child+0x70/0xa8)
[ 5391.864165] [<805cd1a0>] (device_for_each_child) from [<807584ac>] (fsi_master_remove_slave+0x24/0x44)
[ 5391.874555]  r7:b49063c0 r6:bd154000 r5:80758488 r4:b581f400
[ 5391.880874] [<80758488>] (fsi_master_remove_slave) from [<805cd210>] (device_for_each_child+0x70/0xa8)
[ 5391.891264]  r5:80758488 r4:00000000
[ 5391.895258] [<805cd1a0>] (device_for_each_child) from [<8075a84c>] (fsi_master_rescan+0x38/0x58)
[ 5391.905065]  r7:b49063c0 r6:b717abc0 r5:bc8c3ef4 r4:bc8c3c40
[ 5391.911385] [<8075a814>] (fsi_master_rescan) from [<8075a888>] (master_rescan_store+0x1c/0x28)
[ 5391.920996]  r5:805caca8 r4:00000002
[ 5391.924989] [<8075a86c>] (master_rescan_store) from [<805caccc>] (dev_attr_store+0x24/0x30)
[ 5391.934310]  r5:805caca8 r4:8075a86c
[ 5391.938304] [<805caca8>] (dev_attr_store) from [<80380a98>] (sysfs_kf_write+0x50/0x5c)
[ 5391.947140]  r5:805caca8 r4:00000002
[ 5391.951132] [<80380a48>] (sysfs_kf_write) from [<80380058>] (kernfs_fop_write+0x134/0x264)
[ 5391.960358]  r7:b49063c0 r6:b49063d0 r5:00000000 r4:00000000
[ 5391.966678] [<8037ff24>] (kernfs_fop_write) from [<802e79cc>] (__vfs_write+0x4c/0x1dc)
[ 5391.975518]  r10:00000004 r9:00000000 r8:8037ff24 r7:00000002 r6:bd155f60 r5:bd154000
[ 5391.984255]  r4:b49bb780
[ 5391.987083] [<802e7980>] (__vfs_write) from [<802e96f8>] (vfs_write+0xbc/0x18c)
[ 5391.995245]  r10:00000004 r9:00000000 r8:00000000 r7:bd155f60 r6:019fb498 r5:b49bb780
[ 5392.003984]  r4:00000002
[ 5392.006812] [<802e963c>] (vfs_write) from [<802e9998>] (ksys_write+0x74/0xec)
[ 5392.014779]  r8:00000000 r7:00000002 r6:bd154000 r5:b49bb780 r4:b49bb780
[ 5392.022261] [<802e9924>] (ksys_write) from [<802e9a28>] (sys_write+0x18/0x1c)
[ 5392.030228]  r9:bd154000 r8:801011c4 r7:00000004 r6:76fb3260 r5:019fb498 r4:00000002
[ 5392.038867] [<802e9a10>] (sys_write) from [<80101000>] (ret_fast_syscall+0x0/0x28)
[ 5392.047316] Exception stack(0xbd155fa8 to 0xbd155ff0)
[ 5392.052957] 5fa0:                   00000002 019fb498 00000001 019fb498 00000002 00000000
[ 5392.062088] 5fc0: 00000002 019fb498 76fb3260 00000004 76f41124 76f40c8c 00000000 00000000
[ 5392.071216] 5fe0: 00000498 7eb899f8 76e6c1cc 76ec6c10
@mdmillerii
Copy link

I seem to remember some deferral infrastructure, probably for scsi or usb, but will search later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants