aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/isci/request.c
diff options
context:
space:
mode:
authorJeff Skirvin <jeffrey.d.skirvin@intel.com>2011-10-27 18:05:22 -0400
committerJames Bottomley <JBottomley@Parallels.com>2011-10-31 05:19:47 -0400
commit3b34c169f8197e02529fa3ec703703c2ce418c57 (patch)
tree4834c97238ea0b7968de0bd9b7efd8c780175eda /drivers/scsi/isci/request.c
parent98145cb722b51ccc3ba27166c9803545accba950 (diff)
[SCSI] isci: Remove redundant isci_request.ttype field.
Use the existing IREQ_TMF flag as a request type indicator. Signed-off-by: Jeff Skirvin <jeffrey.d.skirvin@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/isci/request.c')
-rw-r--r--drivers/scsi/isci/request.c45
1 files changed, 12 insertions, 33 deletions
diff --git a/drivers/scsi/isci/request.c b/drivers/scsi/isci/request.c
index bfc7379727b1..192cb48d849a 100644
--- a/drivers/scsi/isci/request.c
+++ b/drivers/scsi/isci/request.c
@@ -191,7 +191,7 @@ static void sci_task_request_build_ssp_task_iu(struct isci_request *ireq)
191 191
192 task_iu->task_func = isci_tmf->tmf_code; 192 task_iu->task_func = isci_tmf->tmf_code;
193 task_iu->task_tag = 193 task_iu->task_tag =
194 (ireq->ttype == tmf_task) ? 194 (test_bit(IREQ_TMF, &ireq->flags)) ?
195 isci_tmf->io_tag : 195 isci_tmf->io_tag :
196 SCI_CONTROLLER_INVALID_IO_TAG; 196 SCI_CONTROLLER_INVALID_IO_TAG;
197} 197}
@@ -516,7 +516,7 @@ sci_io_request_construct_sata(struct isci_request *ireq,
516 struct domain_device *dev = ireq->target_device->domain_dev; 516 struct domain_device *dev = ireq->target_device->domain_dev;
517 517
518 /* check for management protocols */ 518 /* check for management protocols */
519 if (ireq->ttype == tmf_task) { 519 if (test_bit(IREQ_TMF, &ireq->flags)) {
520 struct isci_tmf *tmf = isci_request_access_tmf(ireq); 520 struct isci_tmf *tmf = isci_request_access_tmf(ireq);
521 521
522 if (tmf->tmf_code == isci_tmf_sata_srst_high || 522 if (tmf->tmf_code == isci_tmf_sata_srst_high ||
@@ -632,7 +632,7 @@ enum sci_status sci_task_request_construct_sata(struct isci_request *ireq)
632 enum sci_status status = SCI_SUCCESS; 632 enum sci_status status = SCI_SUCCESS;
633 633
634 /* check for management protocols */ 634 /* check for management protocols */
635 if (ireq->ttype == tmf_task) { 635 if (test_bit(IREQ_TMF, &ireq->flags)) {
636 struct isci_tmf *tmf = isci_request_access_tmf(ireq); 636 struct isci_tmf *tmf = isci_request_access_tmf(ireq);
637 637
638 if (tmf->tmf_code == isci_tmf_sata_srst_high || 638 if (tmf->tmf_code == isci_tmf_sata_srst_high ||
@@ -2630,14 +2630,8 @@ static void isci_task_save_for_upper_layer_completion(
2630 switch (task_notification_selection) { 2630 switch (task_notification_selection) {
2631 2631
2632 case isci_perform_normal_io_completion: 2632 case isci_perform_normal_io_completion:
2633
2634 /* Normal notification (task_done) */ 2633 /* Normal notification (task_done) */
2635 dev_dbg(&host->pdev->dev, 2634
2636 "%s: Normal - task = %p, response=%d (%d), status=%d (%d)\n",
2637 __func__,
2638 task,
2639 task->task_status.resp, response,
2640 task->task_status.stat, status);
2641 /* Add to the completed list. */ 2635 /* Add to the completed list. */
2642 list_add(&request->completed_node, 2636 list_add(&request->completed_node,
2643 &host->requests_to_complete); 2637 &host->requests_to_complete);
@@ -2650,13 +2644,6 @@ static void isci_task_save_for_upper_layer_completion(
2650 /* No notification to libsas because this request is 2644 /* No notification to libsas because this request is
2651 * already in the abort path. 2645 * already in the abort path.
2652 */ 2646 */
2653 dev_dbg(&host->pdev->dev,
2654 "%s: Aborted - task = %p, response=%d (%d), status=%d (%d)\n",
2655 __func__,
2656 task,
2657 task->task_status.resp, response,
2658 task->task_status.stat, status);
2659
2660 /* Wake up whatever process was waiting for this 2647 /* Wake up whatever process was waiting for this
2661 * request to complete. 2648 * request to complete.
2662 */ 2649 */
@@ -2673,30 +2660,22 @@ static void isci_task_save_for_upper_layer_completion(
2673 2660
2674 case isci_perform_error_io_completion: 2661 case isci_perform_error_io_completion:
2675 /* Use sas_task_abort */ 2662 /* Use sas_task_abort */
2676 dev_dbg(&host->pdev->dev,
2677 "%s: Error - task = %p, response=%d (%d), status=%d (%d)\n",
2678 __func__,
2679 task,
2680 task->task_status.resp, response,
2681 task->task_status.stat, status);
2682 /* Add to the aborted list. */ 2663 /* Add to the aborted list. */
2683 list_add(&request->completed_node, 2664 list_add(&request->completed_node,
2684 &host->requests_to_errorback); 2665 &host->requests_to_errorback);
2685 break; 2666 break;
2686 2667
2687 default: 2668 default:
2688 dev_dbg(&host->pdev->dev,
2689 "%s: Unknown - task = %p, response=%d (%d), status=%d (%d)\n",
2690 __func__,
2691 task,
2692 task->task_status.resp, response,
2693 task->task_status.stat, status);
2694
2695 /* Add to the error to libsas list. */ 2669 /* Add to the error to libsas list. */
2696 list_add(&request->completed_node, 2670 list_add(&request->completed_node,
2697 &host->requests_to_errorback); 2671 &host->requests_to_errorback);
2698 break; 2672 break;
2699 } 2673 }
2674 dev_dbg(&host->pdev->dev,
2675 "%s: %d - task = %p, response=%d (%d), status=%d (%d)\n",
2676 __func__, task_notification_selection, task,
2677 (task) ? task->task_status.resp : 0, response,
2678 (task) ? task->task_status.stat : 0, status);
2700} 2679}
2701 2680
2702static void isci_process_stp_response(struct sas_task *task, struct dev_to_host_fis *fis) 2681static void isci_process_stp_response(struct sas_task *task, struct dev_to_host_fis *fis)
@@ -3079,7 +3058,7 @@ static void sci_request_started_state_enter(struct sci_base_state_machine *sm)
3079 /* XXX as hch said always creating an internal sas_task for tmf 3058 /* XXX as hch said always creating an internal sas_task for tmf
3080 * requests would simplify the driver 3059 * requests would simplify the driver
3081 */ 3060 */
3082 task = ireq->ttype == io_task ? isci_request_access_task(ireq) : NULL; 3061 task = (test_bit(IREQ_TMF, &ireq->flags)) ? NULL : isci_request_access_task(ireq);
3083 3062
3084 /* all unaccelerated request types (non ssp or ncq) handled with 3063 /* all unaccelerated request types (non ssp or ncq) handled with
3085 * substates 3064 * substates
@@ -3563,7 +3542,7 @@ static struct isci_request *isci_io_request_from_tag(struct isci_host *ihost,
3563 3542
3564 ireq = isci_request_from_tag(ihost, tag); 3543 ireq = isci_request_from_tag(ihost, tag);
3565 ireq->ttype_ptr.io_task_ptr = task; 3544 ireq->ttype_ptr.io_task_ptr = task;
3566 ireq->ttype = io_task; 3545 clear_bit(IREQ_TMF, &ireq->flags);
3567 task->lldd_task = ireq; 3546 task->lldd_task = ireq;
3568 3547
3569 return ireq; 3548 return ireq;
@@ -3577,7 +3556,7 @@ struct isci_request *isci_tmf_request_from_tag(struct isci_host *ihost,
3577 3556
3578 ireq = isci_request_from_tag(ihost, tag); 3557 ireq = isci_request_from_tag(ihost, tag);
3579 ireq->ttype_ptr.tmf_task_ptr = isci_tmf; 3558 ireq->ttype_ptr.tmf_task_ptr = isci_tmf;
3580 ireq->ttype = tmf_task; 3559 set_bit(IREQ_TMF, &ireq->flags);
3581 3560
3582 return ireq; 3561 return ireq;
3583} 3562}