summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorBart Van Assche <bart.vanassche@sandisk.com>2017-03-01 09:00:36 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-03-26 13:08:12 +0200
commit4a657746c52a570ddd32c6b8f1909dace0339ec0 (patch)
tree08f79c534ebf6ec2ec675e681ee1dedd18e3c061 /include
parentd4700e2050dfd6cfa07c0fe9570f1689663bdfde (diff)
downloadlinux-stable-4a657746c52a570ddd32c6b8f1909dace0339ec0.tar.gz
linux-stable-4a657746c52a570ddd32c6b8f1909dace0339ec0.tar.bz2
linux-stable-4a657746c52a570ddd32c6b8f1909dace0339ec0.zip
scsi: mpt3sas: Avoid sleeping in interrupt context
commit 8893cf6cb1cf56334c05120e23092dbfc9423ebb upstream. Commit 669f044170d8 ("scsi: srp_transport: Move queuecommand() wait code to SCSI core") can make scsi_internal_device_block() sleep. However, the mpt3sas driver can call this function from an interrupt handler. Hence add a second argument to scsi_internal_device_block() that restores the old behavior of this function for the mpt3sas handler. The call chain that triggered an "IRQ handler enabled interrupts" complaint is as follows: _base_interrupt() -> _base_async_event() -> mpt3sas_scsih_event_callback() -> _scsih_check_topo_delete_events() -> _scsih_block_io_to_children_attached_directly() -> _scsih_block_io_device() -> _scsih_internal_device_block() -> scsi_internal_device_block() Reported-by: Omar Sandoval <osandov@osandov.com> Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com> Cc: Omar Sandoval <osandov@osandov.com> Cc: Hannes Reinecke <hare@suse.com> Cc: Sagi Grimberg <sagi@grimberg.me> Cc: Christoph Hellwig <hch@lst.de> Cc: Sathya Prakash <sathya.prakash@broadcom.com> Cc: Chaitra P B <chaitra.basappa@broadcom.com> Cc: Suganath Prabu Subramani <suganath-prabu.subramani@broadcom.com> Cc: Sreekanth Reddy <Sreekanth.Reddy@broadcom.com> Tested-by: Omar Sandoval <osandov@fb.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include')
-rw-r--r--include/scsi/scsi_device.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h
index be41c76ddd48..59ed779bbd9a 100644
--- a/include/scsi/scsi_device.h
+++ b/include/scsi/scsi_device.h
@@ -475,6 +475,10 @@ static inline int scsi_device_created(struct scsi_device *sdev)
sdev->sdev_state == SDEV_CREATED_BLOCK;
}
+int scsi_internal_device_block(struct scsi_device *sdev, bool wait);
+int scsi_internal_device_unblock(struct scsi_device *sdev,
+ enum scsi_device_state new_state);
+
/* accessor functions for the SCSI parameters */
static inline int scsi_device_sync(struct scsi_device *sdev)
{