Commit 5bcd3bfb authored by Hannes Reinecke's avatar Hannes Reinecke Committed by Martin K. Petersen

scsi: megaraid: Pass in NULL scb for host reset

When calling a host reset we shouldn't rely on the command triggering the
reset, so allow megaraid_abort_and_reset() to be called with a NULL scb.
And drop the pointless 'bus_reset' and 'target_reset' handlers, which just
call the same function as host_reset.
Signed-off-by: default avatarHannes Reinecke <hare@suse.de>
Link: https://lore.kernel.org/r/20231002154328.43718-12-hare@suse.deReviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarJohannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 397ff21a
...@@ -1898,7 +1898,7 @@ megaraid_reset(struct scsi_cmnd *cmd) ...@@ -1898,7 +1898,7 @@ megaraid_reset(struct scsi_cmnd *cmd)
spin_lock_irq(&adapter->lock); spin_lock_irq(&adapter->lock);
rval = megaraid_abort_and_reset(adapter, cmd, SCB_RESET); rval = megaraid_abort_and_reset(adapter, NULL, SCB_RESET);
/* /*
* This is required here to complete any completed requests * This is required here to complete any completed requests
...@@ -1937,7 +1937,7 @@ megaraid_abort_and_reset(adapter_t *adapter, struct scsi_cmnd *cmd, int aor) ...@@ -1937,7 +1937,7 @@ megaraid_abort_and_reset(adapter_t *adapter, struct scsi_cmnd *cmd, int aor)
scb = list_entry(pos, scb_t, list); scb = list_entry(pos, scb_t, list);
if (scb->cmd == cmd) { /* Found command */ if (!cmd || scb->cmd == cmd) { /* Found command */
scb->state |= aor; scb->state |= aor;
...@@ -1956,33 +1956,25 @@ megaraid_abort_and_reset(adapter_t *adapter, struct scsi_cmnd *cmd, int aor) ...@@ -1956,33 +1956,25 @@ megaraid_abort_and_reset(adapter_t *adapter, struct scsi_cmnd *cmd, int aor)
return FAILED; return FAILED;
} }
else {
/* /*
* Not yet issued! Remove from the pending * Not yet issued! Remove from the pending
* list * list
*/ */
dev_warn(&adapter->dev->dev, dev_warn(&adapter->dev->dev,
"%s-[%x], driver owner\n", "%s-[%x], driver owner\n",
(aor==SCB_ABORT) ? "ABORTING":"RESET", (cmd) ? "ABORTING":"RESET",
scb->idx); scb->idx);
mega_free_scb(adapter, scb); mega_free_scb(adapter, scb);
if( aor == SCB_ABORT ) { if (cmd) {
cmd->result = (DID_ABORT << 16); cmd->result = (DID_ABORT << 16);
}
else {
cmd->result = (DID_RESET << 16);
}
list_add_tail(SCSI_LIST(cmd), list_add_tail(SCSI_LIST(cmd),
&adapter->completed_list); &adapter->completed_list);
}
return SUCCESS; return SUCCESS;
} }
} }
}
return FAILED; return FAILED;
} }
...@@ -4114,8 +4106,6 @@ static const struct scsi_host_template megaraid_template = { ...@@ -4114,8 +4106,6 @@ static const struct scsi_host_template megaraid_template = {
.sg_tablesize = MAX_SGLIST, .sg_tablesize = MAX_SGLIST,
.cmd_per_lun = DEF_CMD_PER_LUN, .cmd_per_lun = DEF_CMD_PER_LUN,
.eh_abort_handler = megaraid_abort, .eh_abort_handler = megaraid_abort,
.eh_device_reset_handler = megaraid_reset,
.eh_bus_reset_handler = megaraid_reset,
.eh_host_reset_handler = megaraid_reset, .eh_host_reset_handler = megaraid_reset,
.no_write_same = 1, .no_write_same = 1,
.cmd_size = sizeof(struct megaraid_cmd_priv), .cmd_size = sizeof(struct megaraid_cmd_priv),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment