Skip to content

Commit 50740f4

Browse files
thenzlmartinkpetersen
authored andcommitted
scsi: megaraid_sas: Fix for a potential deadlock
This fixes a 'possible circular locking dependency detected' warning CPU0 CPU1 ---- ---- lock(&instance->reset_mutex); lock(&shost->scan_mutex); lock(&instance->reset_mutex); lock(&shost->scan_mutex); Fix this by temporarily releasing the reset_mutex. Signed-off-by: Tomas Henzl <[email protected]> Link: https://lore.kernel.org/r/[email protected] Acked-by: Chandrakanth Patil <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 2c354d1 commit 50740f4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/scsi/megaraid/megaraid_sas_base.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8907,8 +8907,11 @@ megasas_aen_polling(struct work_struct *work)
89078907
(ld_target_id / MEGASAS_MAX_DEV_PER_CHANNEL),
89088908
(ld_target_id % MEGASAS_MAX_DEV_PER_CHANNEL),
89098909
0);
8910-
if (sdev1)
8910+
if (sdev1) {
8911+
mutex_unlock(&instance->reset_mutex);
89118912
megasas_remove_scsi_device(sdev1);
8913+
mutex_lock(&instance->reset_mutex);
8914+
}
89128915

89138916
event_type = SCAN_VD_CHANNEL;
89148917
break;

0 commit comments

Comments
 (0)