Skip to content

Commit bffebc1

Browse files
hreineckemartinkpetersen
authored andcommitted
scsi: qla1280: Separate out host reset function from qla1280_error_action()
There's not much in common between host reset and all other error handlers, so use a separate function here. Signed-off-by: Hannes Reinecke <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Christoph Hellwig <[email protected]> Reviewed-by: Johannes Thumshirn <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent c7c559d commit bffebc1

File tree

1 file changed

+22
-20
lines changed

1 file changed

+22
-20
lines changed

drivers/scsi/qla1280.c

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -716,7 +716,6 @@ enum action {
716716
ABORT_COMMAND,
717717
DEVICE_RESET,
718718
BUS_RESET,
719-
ADAPTER_RESET,
720719
};
721720

722721

@@ -898,22 +897,9 @@ qla1280_error_action(struct scsi_cmnd *cmd, enum action action)
898897
}
899898
break;
900899

901-
case ADAPTER_RESET:
902900
default:
903-
if (qla1280_verbose) {
904-
printk(KERN_INFO
905-
"scsi(%ld): Issued ADAPTER RESET\n",
906-
ha->host_no);
907-
printk(KERN_INFO "scsi(%ld): I/O processing will "
908-
"continue automatically\n", ha->host_no);
909-
}
910-
ha->flags.reset_active = 1;
911-
912-
if (qla1280_abort_isp(ha) != 0) { /* it's dead */
913-
result = FAILED;
914-
}
915-
916-
ha->flags.reset_active = 0;
901+
dprintk(1, "RESET invalid action %d\n", action);
902+
return FAILED;
917903
}
918904

919905
/*
@@ -1011,11 +997,27 @@ qla1280_eh_bus_reset(struct scsi_cmnd *cmd)
1011997
static int
1012998
qla1280_eh_adapter_reset(struct scsi_cmnd *cmd)
1013999
{
1014-
int rc;
1000+
int rc = SUCCESS;
1001+
struct Scsi_Host *shost = cmd->device->host;
1002+
struct scsi_qla_host *ha = (struct scsi_qla_host *)shost->hostdata;
10151003

1016-
spin_lock_irq(cmd->device->host->host_lock);
1017-
rc = qla1280_error_action(cmd, ADAPTER_RESET);
1018-
spin_unlock_irq(cmd->device->host->host_lock);
1004+
spin_lock_irq(shost->host_lock);
1005+
if (qla1280_verbose) {
1006+
printk(KERN_INFO
1007+
"scsi(%ld): Issued ADAPTER RESET\n",
1008+
ha->host_no);
1009+
printk(KERN_INFO "scsi(%ld): I/O processing will "
1010+
"continue automatically\n", ha->host_no);
1011+
}
1012+
ha->flags.reset_active = 1;
1013+
1014+
if (qla1280_abort_isp(ha) != 0) { /* it's dead */
1015+
rc = FAILED;
1016+
}
1017+
1018+
ha->flags.reset_active = 0;
1019+
1020+
spin_unlock_irq(shost->host_lock);
10191021

10201022
return rc;
10211023
}

0 commit comments

Comments
 (0)