Lines Matching refs:task
76 static void isci_task_refuse(struct isci_host *ihost, struct sas_task *task, in isci_task_refuse() argument
85 __func__, task, response, status); in isci_task_refuse()
87 spin_lock_irqsave(&task->task_state_lock, flags); in isci_task_refuse()
89 task->task_status.resp = response; in isci_task_refuse()
90 task->task_status.stat = status; in isci_task_refuse()
93 task->task_state_flags |= SAS_TASK_STATE_DONE; in isci_task_refuse()
94 task->task_state_flags &= ~(SAS_TASK_AT_INITIATOR | in isci_task_refuse()
96 task->lldd_task = NULL; in isci_task_refuse()
97 spin_unlock_irqrestore(&task->task_state_lock, flags); in isci_task_refuse()
99 task->task_done(task); in isci_task_refuse()
102 #define for_each_sas_task(num, task) \ argument
104 task = list_entry(task->list.next, struct sas_task, list))
108 struct sas_task *task) in isci_device_io_ready() argument
112 isci_task_is_ncq_recovery(task)) in isci_device_io_ready()
124 int isci_task_execute_task(struct sas_task *task, gfp_t gfp_flags) in isci_task_execute_task() argument
126 struct isci_host *ihost = dev_to_ihost(task->dev); in isci_task_execute_task()
134 idev = isci_lookup_device(task->dev); in isci_task_execute_task()
135 io_ready = isci_device_io_ready(idev, task); in isci_task_execute_task()
141 task, task->dev, idev, idev ? idev->flags : 0, in isci_task_execute_task()
142 task->uldd_task); in isci_task_execute_task()
145 isci_task_refuse(ihost, task, SAS_TASK_UNDELIVERED, in isci_task_execute_task()
151 isci_task_refuse(ihost, task, SAS_TASK_COMPLETE, in isci_task_execute_task()
155 spin_lock_irqsave(&task->task_state_lock, flags); in isci_task_execute_task()
157 if (task->task_state_flags & SAS_TASK_STATE_ABORTED) { in isci_task_execute_task()
159 spin_unlock_irqrestore(&task->task_state_lock, flags); in isci_task_execute_task()
161 isci_task_refuse(ihost, task, in isci_task_execute_task()
165 task->task_state_flags |= SAS_TASK_AT_INITIATOR; in isci_task_execute_task()
166 spin_unlock_irqrestore(&task->task_state_lock, flags); in isci_task_execute_task()
169 status = isci_request_execute(ihost, idev, task, tag); in isci_task_execute_task()
172 spin_lock_irqsave(&task->task_state_lock, flags); in isci_task_execute_task()
174 task->task_state_flags &= ~SAS_TASK_AT_INITIATOR; in isci_task_execute_task()
175 spin_unlock_irqrestore(&task->task_state_lock, flags); in isci_task_execute_task()
181 isci_task_refuse(ihost, task, in isci_task_execute_task()
193 isci_task_refuse(ihost, task, in isci_task_execute_task()
478 int isci_task_abort_task(struct sas_task *task) in isci_task_abort_task() argument
480 struct isci_host *ihost = dev_to_ihost(task->dev); in isci_task_abort_task()
495 spin_lock(&task->task_state_lock); in isci_task_abort_task()
497 old_request = task->lldd_task; in isci_task_abort_task()
500 if (!(task->task_state_flags & SAS_TASK_STATE_DONE) && in isci_task_abort_task()
501 (task->task_state_flags & SAS_TASK_AT_INITIATOR) && in isci_task_abort_task()
503 idev = isci_get_device(task->dev->lldd_dev); in isci_task_abort_task()
507 spin_unlock(&task->task_state_lock); in isci_task_abort_task()
513 (dev_is_sata(task->dev) ? "STP/SATA" in isci_task_abort_task()
514 : ((dev_is_expander(task->dev->dev_type)) in isci_task_abort_task()
521 task, old_request); in isci_task_abort_task()
533 spin_lock_irqsave(&task->task_state_lock, flags); in isci_task_abort_task()
534 task->task_state_flags |= SAS_TASK_STATE_DONE; in isci_task_abort_task()
535 task->task_state_flags &= ~(SAS_TASK_AT_INITIATOR | in isci_task_abort_task()
537 spin_unlock_irqrestore(&task->task_state_lock, flags); in isci_task_abort_task()
543 __func__, task); in isci_task_abort_task()
552 __func__, idev, old_request, task); in isci_task_abort_task()
558 if (task->task_proto == SAS_PROTOCOL_SMP || in isci_task_abort_task()
559 sas_protocol_ata(task->task_proto) || in isci_task_abort_task()
573 ((task->task_proto == SAS_PROTOCOL_SMP) in isci_task_abort_task()
575 : (sas_protocol_ata(task->task_proto) in isci_task_abort_task()
583 spin_lock_irqsave(&task->task_state_lock, flags); in isci_task_abort_task()
584 task->task_state_flags &= ~(SAS_TASK_AT_INITIATOR | in isci_task_abort_task()
586 task->task_state_flags |= SAS_TASK_STATE_DONE; in isci_task_abort_task()
587 spin_unlock_irqrestore(&task->task_state_lock, flags); in isci_task_abort_task()
605 __func__, idev, task, old_request); in isci_task_abort_task()
675 struct sas_task *task) in isci_task_query_task() argument
678 if (task->task_state_flags & SAS_TASK_NEED_DEV_RESET) in isci_task_query_task()