scsi: qla2xxx: Simplify the code for aborting SCSI commands
authorBart Van Assche <bvanassche@acm.org>
Thu, 20 Feb 2020 04:34:37 +0000 (20:34 -0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Sat, 29 Feb 2020 00:54:58 +0000 (19:54 -0500)
commitc81ef0ed4477c637d1f1dd96ecd8e8fbe18b7283
treec7c385e5527f8ff6a1bc0ce4587973764cf6a6b2
parent0a36fd6cef5e3a11a273300e777a26cb26274547
scsi: qla2xxx: Simplify the code for aborting SCSI commands

Since the SCSI core does not reuse the tag of the SCSI command that is
being aborted by .eh_abort() before .eh_abort() has finished it is not
necessary to check from inside that callback whether or not the SCSI
command has already completed. Instead, rely on the firmware to return an
error code when attempting to abort a command that has already
completed. Additionally, rely on the firmware to return an error code when
attempting to abort an already aborted command.

In qla2x00_abort_srb(), use blk_mq_request_started() instead of
sp->completed and sp->aborted.

Link: https://lore.kernel.org/r/20200220043441.20504-2-bvanassche@acm.org
Cc: Martin Wilck <mwilck@suse.com>
Cc: Quinn Tran <qutran@marvell.com>
Reviewed-by: Daniel Wagner <dwagner@suse.de>
Reviewed-by: Roman Bolshakov <r.bolshakov@yadro.com>
Acked-by: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/qla2xxx/qla_def.h
drivers/scsi/qla2xxx/qla_isr.c
drivers/scsi/qla2xxx/qla_os.c