]> git.baikalelectronics.ru Git - kernel.git/commit
scsi: isci: Drop SAS_TASK_AT_INITIATOR check in isci_task_abort_task()
authorJohn Garry <john.garry@huawei.com>
Thu, 10 Feb 2022 10:43:23 +0000 (18:43 +0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 11 Feb 2022 21:59:57 +0000 (16:59 -0500)
commitd8d320c04264463a06156ea00e2224e807a7c1ea
treef007dfb18bbddaf714d31b2518b195b052dc9e14
parentb8965b0ed9f0c065f00fd38b6ddf36948a5480a7
scsi: isci: Drop SAS_TASK_AT_INITIATOR check in isci_task_abort_task()

In the queue path, move around when we assign sas_task->lldd_task such that
this pointer and the SAS_TASK_AT_INITIATOR flag are set atomically.  It is
also not required to clear SAS_TASK_AT_INITIATOR in isci_task_execute_task()
error path as it is also cleared immediately after in isci_task_refuse()
call.

Now the following items may be considered:

 - SAS_TASK_STATE_DONE and SAS_TASK_AT_INITIATOR are mutually exclusive
   apart from possibly when SAS_TASK_STATE_DONE is set in
   sas_scsi_find_task(), but that is after .lldd_abort_task, i.e. the
   considered callback, is called.

 - If isci_task_refuse() is called in the queue path, then
   sas_task->lldd_task and SAS_TASK_AT_INITIATOR are cleared atomically in
   isci_task_refuse().

 - In the completion path, SAS_TASK_STATE_DONE is set and
   SAS_TASK_AT_INITIATOR is cleared atomically before the
   sas_task.lldd_task is cleared later.

So in isci_task_abort_task() if SAS_TASK_STATE_DONE is not set and
sas_task.lldd_task is still set, then SAS_TASK_AT_INITIATOR must be set -
so we can drop this check on SAS_TASK_AT_INITIATOR.

[mkp: checkpatch]

Link: https://lore.kernel.org/r/1644489804-85730-2-git-send-email-john.garry@huawei.com
Signed-off-by: John Garry <john.garry@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/isci/request.c
drivers/scsi/isci/request.h
drivers/scsi/isci/task.c