]> www.infradead.org Git - users/jedix/linux-maple.git/commit
mpt3sas: Refcount fw_events and fix unsafe list usage
authorSreekanth Reddy <sreekanth.reddy@avagotech.com>
Wed, 11 Nov 2015 12:00:31 +0000 (17:30 +0530)
committerChuck Anderson <chuck.anderson@oracle.com>
Wed, 13 Jul 2016 07:33:18 +0000 (00:33 -0700)
commit3ef7f2590c87062ae56e9fa4bf0a6d04e308d932
tree5cc9e29bb1af83628c38dc3bd01609ba7ec92e80
parent990775ceaf9bcc3537c7720cd4e8b89a0be2594b
mpt3sas: Refcount fw_events and fix unsafe list usage

The fw_event_work struct is concurrently referenced at shutdown. 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.

This patch is ported from commit 008549f6e8a1 ("mpt2sas: Refcount
fw_events and fix unsafe list usage"). These changes are also required
for mpt3sas.

Signed-off-by: Sreekanth Reddy <Sreekanth.Reddy@avagotech.com>
Acked-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Orabug: 22529571
(cherry picked from commit 146b16c8071f5f6c67895d15beeee1163f5107c4)
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/mpt3sas/mpt3sas_scsih.c