request.c (87805162b6af20d2ad386a49aec13b753cca523a) | request.c (f8381807ebdfffa34c2c5aa38eda33673d1a7adf) |
---|---|
1/* 2 * This file is provided under a dual BSD/GPLv2 license. When using or 3 * redistributing this file, you may do so under either license. 4 * 5 * GPL LICENSE SUMMARY 6 * 7 * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved. 8 * --- 2734 unchanged lines hidden (view full) --- 2743 struct sas_task *task = isci_request_access_task(request); 2744 struct ssp_response_iu *resp_iu; 2745 unsigned long task_flags; 2746 struct isci_remote_device *idev = request->target_device; 2747 enum service_response response = SAS_TASK_UNDELIVERED; 2748 enum exec_status status = SAS_ABORTED_TASK; 2749 2750 dev_dbg(&ihost->pdev->dev, | 1/* 2 * This file is provided under a dual BSD/GPLv2 license. When using or 3 * redistributing this file, you may do so under either license. 4 * 5 * GPL LICENSE SUMMARY 6 * 7 * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved. 8 * --- 2734 unchanged lines hidden (view full) --- 2743 struct sas_task *task = isci_request_access_task(request); 2744 struct ssp_response_iu *resp_iu; 2745 unsigned long task_flags; 2746 struct isci_remote_device *idev = request->target_device; 2747 enum service_response response = SAS_TASK_UNDELIVERED; 2748 enum exec_status status = SAS_ABORTED_TASK; 2749 2750 dev_dbg(&ihost->pdev->dev, |
2751 "%s: request = %p, task = %p,\n" | 2751 "%s: request = %p, task = %p, " |
2752 "task->data_dir = %d completion_status = 0x%x\n", | 2752 "task->data_dir = %d completion_status = 0x%x\n", |
2753 __func__, 2754 request, 2755 task, 2756 task->data_dir, 2757 completion_status); | 2753 __func__, request, task, task->data_dir, completion_status); |
2758 2759 /* The request is done from an SCU HW perspective. */ 2760 2761 /* This is an active request being completed from the core. */ 2762 switch (completion_status) { 2763 2764 case SCI_IO_FAILURE_RESPONSE_VALID: 2765 dev_dbg(&ihost->pdev->dev, --- 184 unchanged lines hidden (view full) --- 2950 if (test_bit(IREQ_COMPLETE_IN_TARGET, &request->flags)) { 2951 /* Normal notification (task_done) */ 2952 task->task_state_flags |= SAS_TASK_STATE_DONE; 2953 task->task_state_flags &= ~(SAS_TASK_AT_INITIATOR | 2954 SAS_TASK_STATE_PENDING); 2955 } 2956 spin_unlock_irqrestore(&task->task_state_lock, task_flags); 2957 | 2754 2755 /* The request is done from an SCU HW perspective. */ 2756 2757 /* This is an active request being completed from the core. */ 2758 switch (completion_status) { 2759 2760 case SCI_IO_FAILURE_RESPONSE_VALID: 2761 dev_dbg(&ihost->pdev->dev, --- 184 unchanged lines hidden (view full) --- 2946 if (test_bit(IREQ_COMPLETE_IN_TARGET, &request->flags)) { 2947 /* Normal notification (task_done) */ 2948 task->task_state_flags |= SAS_TASK_STATE_DONE; 2949 task->task_state_flags &= ~(SAS_TASK_AT_INITIATOR | 2950 SAS_TASK_STATE_PENDING); 2951 } 2952 spin_unlock_irqrestore(&task->task_state_lock, task_flags); 2953 |
2958 /* Add to the completed list. */ 2959 list_add(&request->completed_node, &ihost->requests_to_complete); 2960 | |
2961 /* complete the io request to the core. */ 2962 sci_controller_complete_io(ihost, request->target_device, request); 2963 2964 /* set terminated handle so it cannot be completed or 2965 * terminated again, and to cause any calls into abort 2966 * task to recognize the already completed case. 2967 */ 2968 set_bit(IREQ_TERMINATED, &request->flags); | 2954 /* complete the io request to the core. */ 2955 sci_controller_complete_io(ihost, request->target_device, request); 2956 2957 /* set terminated handle so it cannot be completed or 2958 * terminated again, and to cause any calls into abort 2959 * task to recognize the already completed case. 2960 */ 2961 set_bit(IREQ_TERMINATED, &request->flags); |
2962 2963 ireq_done(ihost, request, task); |
|
2969} 2970 2971static void sci_request_started_state_enter(struct sci_base_state_machine *sm) 2972{ 2973 struct isci_request *ireq = container_of(sm, typeof(*ireq), sm); 2974 struct domain_device *dev = ireq->target_device->domain_dev; 2975 enum sci_base_request_states state; 2976 struct sas_task *task; --- 434 unchanged lines hidden (view full) --- 3411{ 3412 struct isci_request *ireq; 3413 3414 ireq = ihost->reqs[ISCI_TAG_TCI(tag)]; 3415 ireq->io_tag = tag; 3416 ireq->io_request_completion = NULL; 3417 ireq->flags = 0; 3418 ireq->num_sg_entries = 0; | 2964} 2965 2966static void sci_request_started_state_enter(struct sci_base_state_machine *sm) 2967{ 2968 struct isci_request *ireq = container_of(sm, typeof(*ireq), sm); 2969 struct domain_device *dev = ireq->target_device->domain_dev; 2970 enum sci_base_request_states state; 2971 struct sas_task *task; --- 434 unchanged lines hidden (view full) --- 3406{ 3407 struct isci_request *ireq; 3408 3409 ireq = ihost->reqs[ISCI_TAG_TCI(tag)]; 3410 ireq->io_tag = tag; 3411 ireq->io_request_completion = NULL; 3412 ireq->flags = 0; 3413 ireq->num_sg_entries = 0; |
3419 INIT_LIST_HEAD(&ireq->completed_node); | |
3420 3421 return ireq; 3422} 3423 3424static struct isci_request *isci_io_request_from_tag(struct isci_host *ihost, 3425 struct sas_task *task, 3426 u16 tag) 3427{ --- 111 unchanged lines hidden --- | 3414 3415 return ireq; 3416} 3417 3418static struct isci_request *isci_io_request_from_tag(struct isci_host *ihost, 3419 struct sas_task *task, 3420 u16 tag) 3421{ --- 111 unchanged lines hidden --- |