]> www.infradead.org Git - users/jedix/linux-maple.git/commit
mpt2sas: Refcount fw_events and fix unsafe list usage
authorCalvin Owens <calvinowens@fb.com>
Fri, 14 Aug 2015 01:48:10 +0000 (18:48 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 20 Oct 2015 19:23:44 +0000 (15:23 -0400)
commit24ff0e4dbe1f9db67d4f8fcb58bc9e1fe02e3446
treeaa3599beb41de2b3e4b57f3b5a957f8b4d7c8b8e
parentfa87fd4acead56a5ced176ee4ca04fb094643851
mpt2sas: Refcount fw_events and fix unsafe list usage

The fw_event_work struct is concurrently referenced at shutdown, so
add a refcount to protect it, and refactor the code to use it.

Additionally, refactor _scsih_fw_event_cleanup_queue() such that it
no longer iterates over the list without holding the lock, since
_firmware_event_work() concurrently deletes items from the list.

Signed-off-by: Calvin Owens <calvinowens@fb.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Nicholas Bellinger <nab@linux-iscsi.org>
Tested-by: Chaitra Basappa <chaitra.basappa@avagotech.com>
Acked-by: Sreekanth Reddy <sreekanth.reddy@avagotech.com>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit 008549f6e8a1dc4aeea4a8d64184909786b27713)
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/mpt2sas/mpt2sas_scsih.c