]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.4.36/scsi-mpt3sas-unblock-device-after-controller-reset.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 4.4.36 / scsi-mpt3sas-unblock-device-after-controller-reset.patch
CommitLineData
80704662
GKH
1From 7ff723ad0f87feba43dda45fdae71206063dd7d4 Mon Sep 17 00:00:00 2001
2From: Suganath Prabu S <suganath-prabu.subramani@broadcom.com>
3Date: Thu, 17 Nov 2016 16:15:58 +0530
4Subject: scsi: mpt3sas: Unblock device after controller reset
5
6From: Suganath Prabu S <suganath-prabu.subramani@broadcom.com>
7
8commit 7ff723ad0f87feba43dda45fdae71206063dd7d4 upstream.
9
10While issuing any ATA passthrough command to firmware the driver will
11block the device. But it will unblock the device only if the I/O
12completes through the ISR path. If a controller reset occurs before
13command completion the device will remain in blocked state.
14
15Make sure we unblock the device following a controller reset if an ATA
16passthrough command was queued.
17
18[mkp: clarified patch description]
19
20Fixes: ac6c2a93bd07 ("mpt3sas: Fix for SATA drive in blocked state, after diag reset")
21Signed-off-by: Suganath Prabu S <suganath-prabu.subramani@broadcom.com>
22Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
23Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
24
25---
26 drivers/scsi/mpt3sas/mpt3sas_scsih.c | 13 ++++++++-----
27 1 file changed, 8 insertions(+), 5 deletions(-)
28
29--- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c
30+++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
31@@ -3706,6 +3706,11 @@ _scsih_temp_threshold_events(struct MPT3
32 }
33 }
34
35+static inline bool ata_12_16_cmd(struct scsi_cmnd *scmd)
36+{
37+ return (scmd->cmnd[0] == ATA_12 || scmd->cmnd[0] == ATA_16);
38+}
39+
40 /**
41 * _scsih_flush_running_cmds - completing outstanding commands.
42 * @ioc: per adapter object
43@@ -3727,6 +3732,9 @@ _scsih_flush_running_cmds(struct MPT3SAS
44 if (!scmd)
45 continue;
46 count++;
47+ if (ata_12_16_cmd(scmd))
48+ scsi_internal_device_unblock(scmd->device,
49+ SDEV_RUNNING);
50 mpt3sas_base_free_smid(ioc, smid);
51 scsi_dma_unmap(scmd);
52 if (ioc->pci_error_recovery)
53@@ -3831,11 +3839,6 @@ _scsih_eedp_error_handling(struct scsi_c
54 SAM_STAT_CHECK_CONDITION;
55 }
56
57-static inline bool ata_12_16_cmd(struct scsi_cmnd *scmd)
58-{
59- return (scmd->cmnd[0] == ATA_12 || scmd->cmnd[0] == ATA_16);
60-}
61-
62 /**
63 * scsih_qcmd - main scsi request entry point
64 * @scmd: pointer to scsi command object