Skip to content

Commit c38de5c

Browse files
Ranjan Kumargregkh
authored andcommitted
scsi: mpi3mr: Fix race between config read submit and interrupt completion
commit e6327c4 upstream. The "is_waiting" flag was updated after calling complete(), which could lead to a race where the waiting thread wakes up before the flag is cleared. This may cause a missed wakeup or stale state check. Reorder the operations to update "is_waiting" before signaling completion to ensure consistent state. Fixes: 824a156 ("scsi: mpi3mr: Base driver code") Cc: stable@vger.kernel.org Co-developed-by: Chandrakanth Patil <chandrakanth.patil@broadcom.com> Signed-off-by: Chandrakanth Patil <chandrakanth.patil@broadcom.com> Signed-off-by: Ranjan Kumar <ranjan.kumar@broadcom.com> Link: https://lore.kernel.org/r/20250627194539.48851-2-ranjan.kumar@broadcom.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 5b9f1ef commit c38de5c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/scsi/mpi3mr/mpi3mr_fw.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,8 +428,8 @@ static void mpi3mr_process_admin_reply_desc(struct mpi3mr_ioc *mrioc,
428428
MPI3MR_SENSE_BUF_SZ);
429429
}
430430
if (cmdptr->is_waiting) {
431-
complete(&cmdptr->done);
432431
cmdptr->is_waiting = 0;
432+
complete(&cmdptr->done);
433433
} else if (cmdptr->callback)
434434
cmdptr->callback(mrioc, cmdptr);
435435
}

0 commit comments

Comments
 (0)