diff options
Diffstat (limited to 'drivers/scsi/qla4xxx/ql4_os.c')
-rw-r--r-- | drivers/scsi/qla4xxx/ql4_os.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c index 4169c8baa112..dde539ca4b3d 100644 --- a/drivers/scsi/qla4xxx/ql4_os.c +++ b/drivers/scsi/qla4xxx/ql4_os.c | |||
@@ -2806,6 +2806,7 @@ dpc_post_reset_ha: | |||
2806 | **/ | 2806 | **/ |
2807 | static void qla4xxx_free_adapter(struct scsi_qla_host *ha) | 2807 | static void qla4xxx_free_adapter(struct scsi_qla_host *ha) |
2808 | { | 2808 | { |
2809 | qla4xxx_abort_active_cmds(ha, DID_NO_CONNECT << 16); | ||
2809 | 2810 | ||
2810 | if (test_bit(AF_INTERRUPTS_ON, &ha->flags)) { | 2811 | if (test_bit(AF_INTERRUPTS_ON, &ha->flags)) { |
2811 | /* Turn-off interrupts on the card. */ | 2812 | /* Turn-off interrupts on the card. */ |
@@ -4816,6 +4817,20 @@ static int qla4xxx_eh_target_reset(struct scsi_cmnd *cmd) | |||
4816 | } | 4817 | } |
4817 | 4818 | ||
4818 | /** | 4819 | /** |
4820 | * qla4xxx_is_eh_active - check if error handler is running | ||
4821 | * @shost: Pointer to SCSI Host struct | ||
4822 | * | ||
4823 | * This routine finds that if reset host is called in EH | ||
4824 | * scenario or from some application like sg_reset | ||
4825 | **/ | ||
4826 | static int qla4xxx_is_eh_active(struct Scsi_Host *shost) | ||
4827 | { | ||
4828 | if (shost->shost_state == SHOST_RECOVERY) | ||
4829 | return 1; | ||
4830 | return 0; | ||
4831 | } | ||
4832 | |||
4833 | /** | ||
4819 | * qla4xxx_eh_host_reset - kernel callback | 4834 | * qla4xxx_eh_host_reset - kernel callback |
4820 | * @cmd: Pointer to Linux's SCSI command structure | 4835 | * @cmd: Pointer to Linux's SCSI command structure |
4821 | * | 4836 | * |
@@ -4832,6 +4847,11 @@ static int qla4xxx_eh_host_reset(struct scsi_cmnd *cmd) | |||
4832 | if (ql4xdontresethba) { | 4847 | if (ql4xdontresethba) { |
4833 | DEBUG2(printk("scsi%ld: %s: Don't Reset HBA\n", | 4848 | DEBUG2(printk("scsi%ld: %s: Don't Reset HBA\n", |
4834 | ha->host_no, __func__)); | 4849 | ha->host_no, __func__)); |
4850 | |||
4851 | /* Clear outstanding srb in queues */ | ||
4852 | if (qla4xxx_is_eh_active(cmd->device->host)) | ||
4853 | qla4xxx_abort_active_cmds(ha, DID_ABORT << 16); | ||
4854 | |||
4835 | return FAILED; | 4855 | return FAILED; |
4836 | } | 4856 | } |
4837 | 4857 | ||