]> git.baikalelectronics.ru Git - kernel.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)
committerMartin K. Petersen <martin.petersen@oracle.com>
Thu, 12 Nov 2015 00:01:11 +0000 (19:01 -0500)
commita70b0a8aa65698f6bcfa2f9d678cb2f7b6d642c3
tree468dd22608c91e18f91f5d81b382fedf50123715
parent44b5b1d8355abce75058447d8226bf7e66de423c
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 00a592c78fe4 ("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>
drivers/scsi/mpt3sas/mpt3sas_scsih.c