>From 1556746987c3b4c1a1a4705625280b1136554f89 Mon Sep 17 00:00:00 2001 From: Hannes Reinecke Date: Sun, 30 Oct 2016 14:24:44 +0100 Subject: [PATCH] mpt3sas: hack: disable concurrent commands for ATA_16/ATA_12 There's a bug in the mpt3sas driver/firmware which would not return BUSY if it's busy processing requests (eg 'erase') and cannot respond to other commands. Hence these commands will timeout and eventually start the error handler. This patch disallows request processing whenever an ATA_12 or ATA_16 command is received, thereby avoiding this problem. Signed-off-by: Hannes Reinecke --- drivers/scsi/mpt3sas/mpt3sas_scsih.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c index 97987e7..18b9f09 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c +++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c @@ -4096,6 +4096,13 @@ scsih_qcmd(struct Scsi_Host *shost, struct scsi_cmnd *scmd) sas_device_priv_data->block) return SCSI_MLQUEUE_DEVICE_BUSY; + /* + * Hack: block the device for any ATA_12/ATA_16 command + */ + if (scmd->cmnd[0] == 0xa1 || scmd->cmnd[0] == 0x85) { + sas_device_priv_data = scmd->device->hostdata; + _scsih_internal_device_block(scmd->device, sas_device_priv_data); + } if (scmd->sc_data_direction == DMA_FROM_DEVICE) mpi_control = MPI2_SCSIIO_CONTROL_READ; else if (scmd->sc_data_direction == DMA_TO_DEVICE) @@ -4835,6 +4842,10 @@ _scsih_io_done(struct MPT3SAS_ADAPTER *ioc, u16 smid, u8 msix_index, u32 reply) out: + if (scmd->cmnd[0] == 0xa1 || scmd->cmnd[0] == 0x85) { + sas_device_priv_data = scmd->device->hostdata; + _scsih_internal_device_unblock(scmd->device, sas_device_priv_data); + } scsi_dma_unmap(scmd); scmd->scsi_done(scmd); -- 2.6.6