mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-18 22:14:16 +00:00
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 <hare@suse.de> Link: https://lore.kernel.org/r/20231002154328.43718-16-hare@suse.de Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
parent
c7c559d2b3
commit
bffebc1993
1 changed files with 22 additions and 20 deletions
|
@ -716,7 +716,6 @@ enum action {
|
||||||
ABORT_COMMAND,
|
ABORT_COMMAND,
|
||||||
DEVICE_RESET,
|
DEVICE_RESET,
|
||||||
BUS_RESET,
|
BUS_RESET,
|
||||||
ADAPTER_RESET,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -898,22 +897,9 @@ qla1280_error_action(struct scsi_cmnd *cmd, enum action action)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ADAPTER_RESET:
|
|
||||||
default:
|
default:
|
||||||
if (qla1280_verbose) {
|
dprintk(1, "RESET invalid action %d\n", action);
|
||||||
printk(KERN_INFO
|
return FAILED;
|
||||||
"scsi(%ld): Issued ADAPTER RESET\n",
|
|
||||||
ha->host_no);
|
|
||||||
printk(KERN_INFO "scsi(%ld): I/O processing will "
|
|
||||||
"continue automatically\n", ha->host_no);
|
|
||||||
}
|
|
||||||
ha->flags.reset_active = 1;
|
|
||||||
|
|
||||||
if (qla1280_abort_isp(ha) != 0) { /* it's dead */
|
|
||||||
result = FAILED;
|
|
||||||
}
|
|
||||||
|
|
||||||
ha->flags.reset_active = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1011,11 +997,27 @@ qla1280_eh_bus_reset(struct scsi_cmnd *cmd)
|
||||||
static int
|
static int
|
||||||
qla1280_eh_adapter_reset(struct scsi_cmnd *cmd)
|
qla1280_eh_adapter_reset(struct scsi_cmnd *cmd)
|
||||||
{
|
{
|
||||||
int rc;
|
int rc = SUCCESS;
|
||||||
|
struct Scsi_Host *shost = cmd->device->host;
|
||||||
|
struct scsi_qla_host *ha = (struct scsi_qla_host *)shost->hostdata;
|
||||||
|
|
||||||
spin_lock_irq(cmd->device->host->host_lock);
|
spin_lock_irq(shost->host_lock);
|
||||||
rc = qla1280_error_action(cmd, ADAPTER_RESET);
|
if (qla1280_verbose) {
|
||||||
spin_unlock_irq(cmd->device->host->host_lock);
|
printk(KERN_INFO
|
||||||
|
"scsi(%ld): Issued ADAPTER RESET\n",
|
||||||
|
ha->host_no);
|
||||||
|
printk(KERN_INFO "scsi(%ld): I/O processing will "
|
||||||
|
"continue automatically\n", ha->host_no);
|
||||||
|
}
|
||||||
|
ha->flags.reset_active = 1;
|
||||||
|
|
||||||
|
if (qla1280_abort_isp(ha) != 0) { /* it's dead */
|
||||||
|
rc = FAILED;
|
||||||
|
}
|
||||||
|
|
||||||
|
ha->flags.reset_active = 0;
|
||||||
|
|
||||||
|
spin_unlock_irq(shost->host_lock);
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue