]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
scsi: mpi3mr: Fix race between config read submit and interrupt completion
authorRanjan Kumar <ranjan.kumar@broadcom.com>
Fri, 27 Jun 2025 19:45:36 +0000 (01:15 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 28 Aug 2025 14:24:28 +0000 (16:24 +0200)
commit48a1795cbf67ce6939eaeac32abf600a6bb57f27
tree08e13cac3bb1468df7cc9d80d4bfe3187d5c1b12
parente1f8a51a8602f8aa1dd08af36f85d27969267f54
scsi: mpi3mr: Fix race between config read submit and interrupt completion

commit e6327c4acf925bb6d6d387d76fc3bd94471e10d8 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: 824a156633df ("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>
drivers/scsi/mpi3mr/mpi3mr_fw.c