* [PATCH] mpt3sas: Fix for SATA drive in blocked state, after diag reset while ATA Passthrough command is outstanding.
@ 2016-11-17 10:45 Suganath Prabu S
2016-11-18 1:48 ` Martin K. Petersen
0 siblings, 1 reply; 2+ messages in thread
From: Suganath Prabu S @ 2016-11-17 10:45 UTC (permalink / raw)
To: JBottomley, jejb, hch
Cc: martin.petersen, linux-scsi, Sathya.Prakash, kashyap.desai,
krishnaraddi.mankani, linux-kernel, suganath-prabu.subramani,
chaitra.basappa, sreekanth.reddy
While issuing any ATA Pass-through command to Firmware,
driver will block the device, it will unblock the device only if that
IO completes through ISR path. But if in-between any host reset
occurs then driver won't unblock the device and
device will be in blocked state.
Signed-off-by: Suganath Prabu S <suganath-prabu.subramani@broadcom.com>
---
drivers/scsi/mpt3sas/mpt3sas_scsih.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
index a250cfd..5c8f752 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
@@ -3899,6 +3899,11 @@ _scsih_temp_threshold_events(struct MPT3SAS_ADAPTER *ioc,
}
}
+static inline bool ata_12_16_cmd(struct scsi_cmnd *scmd)
+{
+ return (scmd->cmnd[0] == ATA_12 || scmd->cmnd[0] == ATA_16);
+}
+
/**
* _scsih_flush_running_cmds - completing outstanding commands.
* @ioc: per adapter object
@@ -3920,6 +3925,9 @@ _scsih_flush_running_cmds(struct MPT3SAS_ADAPTER *ioc)
if (!scmd)
continue;
count++;
+ if (ata_12_16_cmd(scmd))
+ scsi_internal_device_unblock(scmd->device,
+ SDEV_RUNNING);
mpt3sas_base_free_smid(ioc, smid);
scsi_dma_unmap(scmd);
if (ioc->pci_error_recovery)
@@ -4027,11 +4035,6 @@ _scsih_eedp_error_handling(struct scsi_cmnd *scmd, u16 ioc_status)
SAM_STAT_CHECK_CONDITION;
}
-static inline bool ata_12_16_cmd(struct scsi_cmnd *scmd)
-{
- return (scmd->cmnd[0] == ATA_12 || scmd->cmnd[0] == ATA_16);
-}
-
/**
* scsih_qcmd - main scsi request entry point
* @scmd: pointer to scsi command object
--
2.4.3
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] mpt3sas: Fix for SATA drive in blocked state, after diag reset while ATA Passthrough command is outstanding.
2016-11-17 10:45 [PATCH] mpt3sas: Fix for SATA drive in blocked state, after diag reset while ATA Passthrough command is outstanding Suganath Prabu S
@ 2016-11-18 1:48 ` Martin K. Petersen
0 siblings, 0 replies; 2+ messages in thread
From: Martin K. Petersen @ 2016-11-18 1:48 UTC (permalink / raw)
To: Suganath Prabu S
Cc: JBottomley, jejb, hch, martin.petersen, linux-scsi,
Sathya.Prakash, kashyap.desai, krishnaraddi.mankani,
linux-kernel, chaitra.basappa, sreekanth.reddy
>>>>> "Suganath" == Suganath Prabu S <suganath-prabu.subramani@broadcom.com> writes:
Suganath> While issuing any ATA Pass-through command to Firmware, driver
Suganath> will block the device, it will unblock the device only if that
Suganath> IO completes through ISR path. But if in-between any host
Suganath> reset occurs then driver won't unblock the device and device
Suganath> will be in blocked state.
Applied to 4.9/scsi-fixes.
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-11-18 1:48 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-17 10:45 [PATCH] mpt3sas: Fix for SATA drive in blocked state, after diag reset while ATA Passthrough command is outstanding Suganath Prabu S
2016-11-18 1:48 ` Martin K. Petersen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®