]>
Commit | Line | Data |
---|---|---|
80704662 GKH |
1 | From 7ff723ad0f87feba43dda45fdae71206063dd7d4 Mon Sep 17 00:00:00 2001 |
2 | From: Suganath Prabu S <suganath-prabu.subramani@broadcom.com> | |
3 | Date: Thu, 17 Nov 2016 16:15:58 +0530 | |
4 | Subject: scsi: mpt3sas: Unblock device after controller reset | |
5 | ||
6 | From: Suganath Prabu S <suganath-prabu.subramani@broadcom.com> | |
7 | ||
8 | commit 7ff723ad0f87feba43dda45fdae71206063dd7d4 upstream. | |
9 | ||
10 | While issuing any ATA passthrough command to firmware the driver will | |
11 | block the device. But it will unblock the device only if the I/O | |
12 | completes through the ISR path. If a controller reset occurs before | |
13 | command completion the device will remain in blocked state. | |
14 | ||
15 | Make sure we unblock the device following a controller reset if an ATA | |
16 | passthrough command was queued. | |
17 | ||
18 | [mkp: clarified patch description] | |
19 | ||
20 | Fixes: ac6c2a93bd07 ("mpt3sas: Fix for SATA drive in blocked state, after diag reset") | |
21 | Signed-off-by: Suganath Prabu S <suganath-prabu.subramani@broadcom.com> | |
22 | Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> | |
23 | Signed-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 |