Skip to content

Commit d8188b1

Browse files
committed
Merge remote-tracking branch 'mkp-scsi/4.9/scsi-fixes' into fixes
2 parents 8a57646 + c733ab3 commit d8188b1

2 files changed

Lines changed: 27 additions & 9 deletions

File tree

drivers/scsi/mpt3sas/mpt3sas_scsih.c

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4010,7 +4010,10 @@ _scsih_eedp_error_handling(struct scsi_cmnd *scmd, u16 ioc_status)
40104010
SAM_STAT_CHECK_CONDITION;
40114011
}
40124012

4013-
4013+
static inline bool ata_12_16_cmd(struct scsi_cmnd *scmd)
4014+
{
4015+
return (scmd->cmnd[0] == ATA_12 || scmd->cmnd[0] == ATA_16);
4016+
}
40144017

40154018
/**
40164019
* scsih_qcmd - main scsi request entry point
@@ -4038,6 +4041,13 @@ scsih_qcmd(struct Scsi_Host *shost, struct scsi_cmnd *scmd)
40384041
if (ioc->logging_level & MPT_DEBUG_SCSI)
40394042
scsi_print_command(scmd);
40404043

4044+
/*
4045+
* Lock the device for any subsequent command until command is
4046+
* done.
4047+
*/
4048+
if (ata_12_16_cmd(scmd))
4049+
scsi_internal_device_block(scmd->device);
4050+
40414051
sas_device_priv_data = scmd->device->hostdata;
40424052
if (!sas_device_priv_data || !sas_device_priv_data->sas_target) {
40434053
scmd->result = DID_NO_CONNECT << 16;
@@ -4613,6 +4623,9 @@ _scsih_io_done(struct MPT3SAS_ADAPTER *ioc, u16 smid, u8 msix_index, u32 reply)
46134623
if (scmd == NULL)
46144624
return 1;
46154625

4626+
if (ata_12_16_cmd(scmd))
4627+
scsi_internal_device_unblock(scmd->device, SDEV_RUNNING);
4628+
46164629
mpi_request = mpt3sas_base_get_msg_frame(ioc, smid);
46174630

46184631
if (mpi_reply == NULL) {

drivers/scsi/qla2xxx/qla_os.c

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1456,15 +1456,20 @@ qla2x00_abort_all_cmds(scsi_qla_host_t *vha, int res)
14561456
for (cnt = 1; cnt < req->num_outstanding_cmds; cnt++) {
14571457
sp = req->outstanding_cmds[cnt];
14581458
if (sp) {
1459-
/* Get a reference to the sp and drop the lock.
1460-
* The reference ensures this sp->done() call
1461-
* - and not the call in qla2xxx_eh_abort() -
1462-
* ends the SCSI command (with result 'res').
1459+
/* Don't abort commands in adapter during EEH
1460+
* recovery as it's not accessible/responding.
14631461
*/
1464-
sp_get(sp);
1465-
spin_unlock_irqrestore(&ha->hardware_lock, flags);
1466-
qla2xxx_eh_abort(GET_CMD_SP(sp));
1467-
spin_lock_irqsave(&ha->hardware_lock, flags);
1462+
if (!ha->flags.eeh_busy) {
1463+
/* Get a reference to the sp and drop the lock.
1464+
* The reference ensures this sp->done() call
1465+
* - and not the call in qla2xxx_eh_abort() -
1466+
* ends the SCSI command (with result 'res').
1467+
*/
1468+
sp_get(sp);
1469+
spin_unlock_irqrestore(&ha->hardware_lock, flags);
1470+
qla2xxx_eh_abort(GET_CMD_SP(sp));
1471+
spin_lock_irqsave(&ha->hardware_lock, flags);
1472+
}
14681473
req->outstanding_cmds[cnt] = NULL;
14691474
sp->done(vha, sp, res);
14701475
}

0 commit comments

Comments
 (0)