|
@@ -2806,6 +2806,7 @@ dpc_post_reset_ha:
|
|
|
**/
|
|
|
static void qla4xxx_free_adapter(struct scsi_qla_host *ha)
|
|
|
{
|
|
|
+ qla4xxx_abort_active_cmds(ha, DID_NO_CONNECT << 16);
|
|
|
|
|
|
if (test_bit(AF_INTERRUPTS_ON, &ha->flags)) {
|
|
|
/* Turn-off interrupts on the card. */
|
|
@@ -4815,6 +4816,20 @@ static int qla4xxx_eh_target_reset(struct scsi_cmnd *cmd)
|
|
|
return SUCCESS;
|
|
|
}
|
|
|
|
|
|
+/**
|
|
|
+ * qla4xxx_is_eh_active - check if error handler is running
|
|
|
+ * @shost: Pointer to SCSI Host struct
|
|
|
+ *
|
|
|
+ * This routine finds that if reset host is called in EH
|
|
|
+ * scenario or from some application like sg_reset
|
|
|
+ **/
|
|
|
+static int qla4xxx_is_eh_active(struct Scsi_Host *shost)
|
|
|
+{
|
|
|
+ if (shost->shost_state == SHOST_RECOVERY)
|
|
|
+ return 1;
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
/**
|
|
|
* qla4xxx_eh_host_reset - kernel callback
|
|
|
* @cmd: Pointer to Linux's SCSI command structure
|
|
@@ -4832,6 +4847,11 @@ static int qla4xxx_eh_host_reset(struct scsi_cmnd *cmd)
|
|
|
if (ql4xdontresethba) {
|
|
|
DEBUG2(printk("scsi%ld: %s: Don't Reset HBA\n",
|
|
|
ha->host_no, __func__));
|
|
|
+
|
|
|
+ /* Clear outstanding srb in queues */
|
|
|
+ if (qla4xxx_is_eh_active(cmd->device->host))
|
|
|
+ qla4xxx_abort_active_cmds(ha, DID_ABORT << 16);
|
|
|
+
|
|
|
return FAILED;
|
|
|
}
|
|
|
|