]> www.infradead.org Git - users/jedix/linux-maple.git/commit
scsi: mpi3mr: Check admin reply queue from Watchdog
authorRanjan Kumar <ranjan.kumar@broadcom.com>
Thu, 20 Feb 2025 14:25:27 +0000 (19:55 +0530)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 25 Feb 2025 00:57:44 +0000 (19:57 -0500)
commitca41929b2ed5eaa459a90bbf3be59cada2da3777
tree790dfc3c250d4cedde6aa4b8e7f9fb3303ad213b
parent83a9d30d29f275571f6e8f879f04b2379be7eb6c
scsi: mpi3mr: Check admin reply queue from Watchdog

Admin reply processing can be called from multiple contexts. The driver
uses an atomic flag for synchronization among multiple threads/context for
draining the admin replies.

Upon entering the admin processing routine, the driver will set the atomic
flag and start reply processing. When exiting the routine, the driver
resets the flag. However, there is a race condition when one thread (Thread
1) has processed replies and is about to reset the flag but in the meantime
few more replies are posted and another thread (Thread 2) is called to
process replies. Since the synchronization flag is still set, Thread 2 will
return without processing replies and those new replies will not be
flushed.

Make the watchdog thread monitor cases where admin ISR/poll call returns
due to another thread processing admin replies. If such an instance is
found, make driver call admin ISR to drain replies (if any).

Co-developed-by: Sumit Saxena <sumit.saxena@broadcom.com>
Signed-off-by: Sumit Saxena <sumit.saxena@broadcom.com>
Signed-off-by: Ranjan Kumar <ranjan.kumar@broadcom.com>
Link: https://lore.kernel.org/r/20250220142528.20837-4-ranjan.kumar@broadcom.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/mpi3mr/mpi3mr.h
drivers/scsi/mpi3mr/mpi3mr_fw.c