scsi: aacraid: use scsi_host_complete_all_commands() to terminate outstanding commands
Use scsi_host_complete_all_commands() to terminate all outstanding commands and change the command result for terminated commands to the more common 'DID_RESET' instead of 'QUEUE_FULL'. Link: https://lore.kernel.org/r/20200228075318.91255-6-hare@suse.de Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Bart Van Assche <bvanassche@acm.org> Acked-by: Balsundar P <balsundar.p@microchip.com> Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
parent
2c644b1d70
commit
a1855f6126
|
@ -1478,8 +1478,6 @@ static int _aac_reset_adapter(struct aac_dev *aac, int forced, u8 reset_type)
|
||||||
int retval;
|
int retval;
|
||||||
struct Scsi_Host *host;
|
struct Scsi_Host *host;
|
||||||
struct scsi_device *dev;
|
struct scsi_device *dev;
|
||||||
struct scsi_cmnd *command;
|
|
||||||
struct scsi_cmnd *command_list;
|
|
||||||
int jafo = 0;
|
int jafo = 0;
|
||||||
int bled;
|
int bled;
|
||||||
u64 dmamask;
|
u64 dmamask;
|
||||||
|
@ -1607,26 +1605,8 @@ static int _aac_reset_adapter(struct aac_dev *aac, int forced, u8 reset_type)
|
||||||
* This is where the assumption that the Adapter is quiesced
|
* This is where the assumption that the Adapter is quiesced
|
||||||
* is important.
|
* is important.
|
||||||
*/
|
*/
|
||||||
command_list = NULL;
|
scsi_host_complete_all_commands(host, DID_RESET);
|
||||||
__shost_for_each_device(dev, host) {
|
|
||||||
unsigned long flags;
|
|
||||||
spin_lock_irqsave(&dev->list_lock, flags);
|
|
||||||
list_for_each_entry(command, &dev->cmd_list, list)
|
|
||||||
if (command->SCp.phase == AAC_OWNER_FIRMWARE) {
|
|
||||||
command->SCp.buffer = (struct scatterlist *)command_list;
|
|
||||||
command_list = command;
|
|
||||||
}
|
|
||||||
spin_unlock_irqrestore(&dev->list_lock, flags);
|
|
||||||
}
|
|
||||||
while ((command = command_list)) {
|
|
||||||
command_list = (struct scsi_cmnd *)command->SCp.buffer;
|
|
||||||
command->SCp.buffer = NULL;
|
|
||||||
command->result = DID_OK << 16
|
|
||||||
| COMMAND_COMPLETE << 8
|
|
||||||
| SAM_STAT_TASK_SET_FULL;
|
|
||||||
command->SCp.phase = AAC_OWNER_ERROR_HANDLER;
|
|
||||||
command->scsi_done(command);
|
|
||||||
}
|
|
||||||
/*
|
/*
|
||||||
* Any Device that was already marked offline needs to be marked
|
* Any Device that was already marked offline needs to be marked
|
||||||
* running
|
* running
|
||||||
|
|
Loading…
Reference in New Issue