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_STATE_PENDING; in isci_task_refuse()
95 task->lldd_task = NULL; in isci_task_refuse()
96 spin_unlock_irqrestore(&task->task_state_lock, flags); in isci_task_refuse()
98 task->task_done(task); in isci_task_refuse()
101 #define for_each_sas_task(num, task) \ argument
103 task = list_entry(task->list.next, struct sas_task, list))
107 struct sas_task *task) in isci_device_io_ready() argument
111 isci_task_is_ncq_recovery(task)) in isci_device_io_ready()
123 int isci_task_execute_task(struct sas_task *task, gfp_t gfp_flags) in isci_task_execute_task() argument
125 struct isci_host *ihost = dev_to_ihost(task->dev); in isci_task_execute_task()
133 idev = isci_lookup_device(task->dev); in isci_task_execute_task()
134 io_ready = isci_device_io_ready(idev, task); in isci_task_execute_task()
140 task, task->dev, idev, idev ? idev->flags : 0, in isci_task_execute_task()
141 task->uldd_task); in isci_task_execute_task()
144 isci_task_refuse(ihost, task, SAS_TASK_UNDELIVERED, in isci_task_execute_task()
150 isci_task_refuse(ihost, task, SAS_TASK_COMPLETE, in isci_task_execute_task()
154 spin_lock_irqsave(&task->task_state_lock, flags); in isci_task_execute_task()
156 if (task->task_state_flags & SAS_TASK_STATE_ABORTED) { in isci_task_execute_task()
158 spin_unlock_irqrestore(&task->task_state_lock, flags); in isci_task_execute_task()
160 isci_task_refuse(ihost, task, in isci_task_execute_task()
167 ireq = isci_io_request_from_tag(ihost, task, tag); in isci_task_execute_task()
168 spin_unlock_irqrestore(&task->task_state_lock, flags); in isci_task_execute_task()
172 status = isci_request_execute(ihost, idev, task, ireq); in isci_task_execute_task()
179 isci_task_refuse(ihost, task, in isci_task_execute_task()
191 isci_task_refuse(ihost, task, in isci_task_execute_task()
476 int isci_task_abort_task(struct sas_task *task) in isci_task_abort_task() argument
478 struct isci_host *ihost = dev_to_ihost(task->dev); in isci_task_abort_task()
493 spin_lock(&task->task_state_lock); in isci_task_abort_task()
495 old_request = task->lldd_task; in isci_task_abort_task()
498 if (!(task->task_state_flags & SAS_TASK_STATE_DONE) && in isci_task_abort_task()
500 idev = isci_get_device(task->dev->lldd_dev); in isci_task_abort_task()
504 spin_unlock(&task->task_state_lock); in isci_task_abort_task()
510 (dev_is_sata(task->dev) ? "STP/SATA" in isci_task_abort_task()
511 : ((dev_is_expander(task->dev->dev_type)) in isci_task_abort_task()
518 task, old_request); in isci_task_abort_task()
530 spin_lock_irqsave(&task->task_state_lock, flags); in isci_task_abort_task()
531 task->task_state_flags |= SAS_TASK_STATE_DONE; in isci_task_abort_task()
532 task->task_state_flags &= ~SAS_TASK_STATE_PENDING; in isci_task_abort_task()
533 spin_unlock_irqrestore(&task->task_state_lock, flags); in isci_task_abort_task()
539 __func__, task); in isci_task_abort_task()
548 __func__, idev, old_request, task); in isci_task_abort_task()
554 if (task->task_proto == SAS_PROTOCOL_SMP || in isci_task_abort_task()
555 sas_protocol_ata(task->task_proto) || in isci_task_abort_task()
569 ((task->task_proto == SAS_PROTOCOL_SMP) in isci_task_abort_task()
571 : (sas_protocol_ata(task->task_proto) in isci_task_abort_task()
579 spin_lock_irqsave(&task->task_state_lock, flags); in isci_task_abort_task()
580 task->task_state_flags &= ~SAS_TASK_STATE_PENDING; in isci_task_abort_task()
581 task->task_state_flags |= SAS_TASK_STATE_DONE; in isci_task_abort_task()
582 spin_unlock_irqrestore(&task->task_state_lock, flags); in isci_task_abort_task()
600 __func__, idev, task, old_request); in isci_task_abort_task()
652 struct sas_task *task) in isci_task_query_task() argument
655 if (task->task_state_flags & SAS_TASK_NEED_DEV_RESET) in isci_task_query_task()