Lines Matching refs:ihost
76 static void isci_task_refuse(struct isci_host *ihost, struct sas_task *task, in isci_task_refuse() argument
84 dev_dbg(&ihost->pdev->dev, "%s: task = %p, response=%d, status=%d\n", in isci_task_refuse()
125 struct isci_host *ihost = dev_to_ihost(task->dev); in isci_task_execute_task() local
132 spin_lock_irqsave(&ihost->scic_lock, flags); in isci_task_execute_task()
135 tag = isci_alloc_tag(ihost); in isci_task_execute_task()
136 spin_unlock_irqrestore(&ihost->scic_lock, flags); in isci_task_execute_task()
138 dev_dbg(&ihost->pdev->dev, 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()
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()
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()
200 spin_lock_irqsave(&ihost->scic_lock, flags); in isci_task_execute_task()
204 isci_tci_free(ihost, ISCI_TAG_TCI(tag)); in isci_task_execute_task()
205 spin_unlock_irqrestore(&ihost->scic_lock, flags); in isci_task_execute_task()
212 static struct isci_request *isci_task_request_build(struct isci_host *ihost, in isci_task_request_build() argument
220 dev_dbg(&ihost->pdev->dev, in isci_task_request_build()
226 ireq = isci_tmf_request_from_tag(ihost, isci_tmf, tag); in isci_task_request_build()
231 status = sci_task_request_construct(ihost, idev, tag, in isci_task_request_build()
235 dev_warn(&ihost->pdev->dev, in isci_task_request_build()
254 static int isci_task_execute_tmf(struct isci_host *ihost, in isci_task_execute_tmf() argument
266 spin_lock_irqsave(&ihost->scic_lock, flags); in isci_task_execute_tmf()
267 tag = isci_alloc_tag(ihost); in isci_task_execute_tmf()
268 spin_unlock_irqrestore(&ihost->scic_lock, flags); in isci_task_execute_tmf()
279 dev_dbg(&ihost->pdev->dev, in isci_task_execute_tmf()
285 dev_dbg(&ihost->pdev->dev, in isci_task_execute_tmf()
293 ireq = isci_task_request_build(ihost, idev, tag, tmf); in isci_task_execute_tmf()
297 spin_lock_irqsave(&ihost->scic_lock, flags); in isci_task_execute_tmf()
300 status = sci_controller_start_task(ihost, idev, ireq); in isci_task_execute_tmf()
303 dev_dbg(&ihost->pdev->dev, in isci_task_execute_tmf()
308 spin_unlock_irqrestore(&ihost->scic_lock, flags); in isci_task_execute_tmf()
311 spin_unlock_irqrestore(&ihost->scic_lock, flags); in isci_task_execute_tmf()
314 isci_remote_device_resume_from_abort(ihost, idev); in isci_task_execute_tmf()
324 isci_remote_device_suspend_terminate(ihost, idev, ireq); in isci_task_execute_tmf()
327 isci_print_tmf(ihost, tmf); in isci_task_execute_tmf()
332 dev_dbg(&ihost->pdev->dev, in isci_task_execute_tmf()
340 dev_dbg(&ihost->pdev->dev, in isci_task_execute_tmf()
348 spin_lock_irqsave(&ihost->scic_lock, flags); in isci_task_execute_tmf()
349 isci_tci_free(ihost, ISCI_TAG_TCI(tag)); in isci_task_execute_tmf()
350 spin_unlock_irqrestore(&ihost->scic_lock, flags); in isci_task_execute_tmf()
412 struct isci_host *ihost = dev_to_ihost(dev); in isci_task_lu_reset() local
417 spin_lock_irqsave(&ihost->scic_lock, flags); in isci_task_lu_reset()
419 spin_unlock_irqrestore(&ihost->scic_lock, flags); in isci_task_lu_reset()
421 dev_dbg(&ihost->pdev->dev, in isci_task_lu_reset()
423 __func__, dev, ihost, idev); in isci_task_lu_reset()
427 dev_dbg(&ihost->pdev->dev, "%s: No dev\n", __func__); in isci_task_lu_reset()
434 if (isci_remote_device_suspend_terminate(ihost, idev, NULL) in isci_task_lu_reset()
446 ret = isci_task_send_lu_reset_sas(ihost, idev, lun); in isci_task_lu_reset()
478 struct isci_host *ihost = dev_to_ihost(task->dev); in isci_task_abort_task() local
492 spin_lock_irqsave(&ihost->scic_lock, flags); in isci_task_abort_task()
505 spin_unlock_irqrestore(&ihost->scic_lock, flags); in isci_task_abort_task()
507 dev_warn(&ihost->pdev->dev, in isci_task_abort_task()
537 dev_warn(&ihost->pdev->dev, in isci_task_abort_task()
543 if (isci_remote_device_suspend_terminate(ihost, idev, old_request) in isci_task_abort_task()
545 dev_warn(&ihost->pdev->dev, in isci_task_abort_task()
552 spin_lock_irqsave(&ihost->scic_lock, flags); in isci_task_abort_task()
559 spin_unlock_irqrestore(&ihost->scic_lock, flags); in isci_task_abort_task()
562 isci_remote_device_resume_from_abort(ihost, idev); in isci_task_abort_task()
564 dev_warn(&ihost->pdev->dev, in isci_task_abort_task()
590 spin_unlock_irqrestore(&ihost->scic_lock, flags); in isci_task_abort_task()
594 ret = isci_task_execute_tmf(ihost, idev, &tmf, in isci_task_abort_task()
598 dev_warn(&ihost->pdev->dev, in isci_task_abort_task()
672 isci_task_request_complete(struct isci_host *ihost, in isci_task_request_complete() argument
679 dev_dbg(&ihost->pdev->dev, in isci_task_request_complete()
700 sci_controller_complete_io(ihost, ireq->target_device, ireq); in isci_task_request_complete()
707 wake_up_all(&ihost->eventq); in isci_task_request_complete()
710 isci_free_tag(ihost, ireq->io_tag); in isci_task_request_complete()
717 static int isci_reset_device(struct isci_host *ihost, in isci_reset_device() argument
725 dev_dbg(&ihost->pdev->dev, "%s: idev %p\n", __func__, idev); in isci_reset_device()
728 if (isci_remote_device_suspend_terminate(ihost, idev, NULL) in isci_reset_device()
741 struct isci_phy *iphy = &ihost->phys[phy->number]; in isci_reset_device()
743 reset_stat = isci_port_perform_hard_reset(ihost, iport, in isci_reset_device()
749 isci_remote_device_resume_from_abort(ihost, idev); in isci_reset_device()
751 dev_dbg(&ihost->pdev->dev, "%s: idev %p complete, reset_stat=%d.\n", in isci_reset_device()
760 struct isci_host *ihost = dev_to_ihost(dev); in isci_task_I_T_nexus_reset() local
765 spin_lock_irqsave(&ihost->scic_lock, flags); in isci_task_I_T_nexus_reset()
767 spin_unlock_irqrestore(&ihost->scic_lock, flags); in isci_task_I_T_nexus_reset()
777 ret = isci_reset_device(ihost, dev, idev); in isci_task_I_T_nexus_reset()