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

scsi: aacraid: complete all commands during bus reset

When issuing a bus reset we should complete all commands, not
just the command triggering the reset.
Signed-off-by: default avatarHannes Reinecke <hare@suse.com>
Reviewed-by: default avatarRaghava Aditya Renukunta  <RaghavaAditya.Renukunta@microsemi.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent c323eab7
...@@ -1010,23 +1010,29 @@ static int aac_eh_bus_reset(struct scsi_cmnd* cmd) ...@@ -1010,23 +1010,29 @@ static int aac_eh_bus_reset(struct scsi_cmnd* cmd)
struct Scsi_Host * host = dev->host; struct Scsi_Host * host = dev->host;
struct aac_dev * aac = (struct aac_dev *)host->hostdata; struct aac_dev * aac = (struct aac_dev *)host->hostdata;
int count; int count;
u32 bus, cid; u32 cmd_bus;
int status = 0; int status = 0;
bus = aac_logical_to_phys(scmd_channel(cmd)); cmd_bus = aac_logical_to_phys(scmd_channel(cmd));
cid = scmd_id(cmd); /* Mark the assoc. FIB to not complete, eh handler does this */
if (bus >= AAC_MAX_BUSES || cid >= AAC_MAX_TARGETS || for (count = 0; count < (host->can_queue + AAC_NUM_MGT_FIB); ++count) {
aac->hba_map[bus][cid].devtype != AAC_DEVTYPE_NATIVE_RAW) { struct fib *fib = &aac->fibs[count];
/* Mark the assoc. FIB to not complete, eh handler does this */
for (count = 0; if (fib->hw_fib_va->header.XferState &&
count < (host->can_queue + AAC_NUM_MGT_FIB); (fib->flags & FIB_CONTEXT_FLAG) &&
++count) { (fib->flags & FIB_CONTEXT_FLAG_SCSI_CMD)) {
struct fib *fib = &aac->fibs[count]; struct aac_hba_map_info *info;
u32 bus, cid;
if (fib->hw_fib_va->header.XferState &&
(fib->flags & FIB_CONTEXT_FLAG) && cmd = (struct scsi_cmnd *)fib->callback_data;
(fib->callback_data == cmd)) { bus = aac_logical_to_phys(scmd_channel(cmd));
if (bus != cmd_bus)
continue;
cid = scmd_id(cmd);
info = &aac->hba_map[bus][cid];
if (bus >= AAC_MAX_BUSES || cid >= AAC_MAX_TARGETS ||
info->devtype != AAC_DEVTYPE_NATIVE_RAW) {
fib->flags |= FIB_CONTEXT_FLAG_TIMED_OUT; fib->flags |= FIB_CONTEXT_FLAG_TIMED_OUT;
cmd->SCp.phase = AAC_OWNER_ERROR_HANDLER; cmd->SCp.phase = AAC_OWNER_ERROR_HANDLER;
} }
......
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