aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJeff Skirvin <jeffrey.d.skirvin@intel.com>2012-03-04 07:44:53 -0500
committerDan Williams <dan.j.williams@intel.com>2012-05-17 17:33:44 -0400
commitf8381807ebdfffa34c2c5aa38eda33673d1a7adf (patch)
treee91cfb2d072f416fa5c5b72acb267e4945fffe94 /drivers
parent397497dd61948b0d59d1d21812b93c97b0eeb2dd (diff)
isci: Remove obviated host callback list.
Since the callbacks to libsas now occur under scic_lock, there is no longer any reason to save the completed requests in a separate list for completion to libsas. Signed-off-by: Jeff Skirvin <jeffrey.d.skirvin@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/scsi/isci/host.c78
-rw-r--r--drivers/scsi/isci/host.h2
-rw-r--r--drivers/scsi/isci/init.c1
-rw-r--r--drivers/scsi/isci/request.c14
-rw-r--r--drivers/scsi/isci/request.h2
5 files changed, 31 insertions, 66 deletions
diff --git a/drivers/scsi/isci/host.c b/drivers/scsi/isci/host.c
index ef2790faeab8..45385f531649 100644
--- a/drivers/scsi/isci/host.c
+++ b/drivers/scsi/isci/host.c
@@ -1077,6 +1077,32 @@ static void sci_controller_completion_handler(struct isci_host *ihost)
1077 writel(0, &ihost->smu_registers->interrupt_mask); 1077 writel(0, &ihost->smu_registers->interrupt_mask);
1078} 1078}
1079 1079
1080void ireq_done(struct isci_host *ihost, struct isci_request *ireq, struct sas_task *task)
1081{
1082 task->lldd_task = NULL;
1083 if (!test_bit(IREQ_ABORT_PATH_ACTIVE, &ireq->flags) &&
1084 !(task->task_state_flags & SAS_TASK_STATE_ABORTED)) {
1085 if (test_bit(IREQ_COMPLETE_IN_TARGET, &ireq->flags)) {
1086 /* Normal notification (task_done) */
1087 dev_dbg(&ihost->pdev->dev,
1088 "%s: Normal - ireq/task = %p/%p\n",
1089 __func__, ireq, task);
1090
1091 task->task_done(task);
1092 } else {
1093 dev_dbg(&ihost->pdev->dev,
1094 "%s: Error - ireq/task = %p/%p\n",
1095 __func__, ireq, task);
1096
1097 sas_task_abort(task);
1098 }
1099 }
1100 if (test_and_clear_bit(IREQ_ABORT_PATH_ACTIVE, &ireq->flags))
1101 wake_up_all(&ihost->eventq);
1102
1103 if (!test_bit(IREQ_NO_AUTO_FREE_TAG, &ireq->flags))
1104 isci_free_tag(ihost, ireq->io_tag);
1105}
1080/** 1106/**
1081 * isci_host_completion_routine() - This function is the delayed service 1107 * isci_host_completion_routine() - This function is the delayed service
1082 * routine that calls the sci core library's completion handler. It's 1108 * routine that calls the sci core library's completion handler. It's
@@ -1088,62 +1114,10 @@ static void sci_controller_completion_handler(struct isci_host *ihost)
1088void isci_host_completion_routine(unsigned long data) 1114void isci_host_completion_routine(unsigned long data)
1089{ 1115{
1090 struct isci_host *ihost = (struct isci_host *)data; 1116 struct isci_host *ihost = (struct isci_host *)data;
1091 struct list_head completed_request_list;
1092 struct list_head *current_position;
1093 struct list_head *next_position;
1094 struct isci_request *request;
1095 struct sas_task *task;
1096 u16 active; 1117 u16 active;
1097 1118
1098 INIT_LIST_HEAD(&completed_request_list);
1099
1100 spin_lock_irq(&ihost->scic_lock); 1119 spin_lock_irq(&ihost->scic_lock);
1101
1102 sci_controller_completion_handler(ihost); 1120 sci_controller_completion_handler(ihost);
1103
1104 /* Take the lists of completed I/Os from the host. */
1105 list_splice_init(&ihost->requests_to_complete,
1106 &completed_request_list);
1107
1108 /* Process any completions in the list. */
1109 list_for_each_safe(current_position, next_position,
1110 &completed_request_list) {
1111
1112 request = list_entry(current_position, struct isci_request,
1113 completed_node);
1114 task = isci_request_access_task(request);
1115
1116 /* Return the task to libsas */
1117 if (task != NULL) {
1118
1119 task->lldd_task = NULL;
1120 if (!test_bit(IREQ_ABORT_PATH_ACTIVE, &request->flags) &&
1121 !(task->task_state_flags & SAS_TASK_STATE_ABORTED)) {
1122 if (test_bit(IREQ_COMPLETE_IN_TARGET,
1123 &request->flags)) {
1124
1125 /* Normal notification (task_done) */
1126 dev_dbg(&ihost->pdev->dev, "%s: Normal"
1127 " - request/task = %p/%p\n",
1128 __func__, request, task);
1129
1130 task->task_done(task);
1131 } else {
1132 dev_warn(&ihost->pdev->dev,
1133 "%s: Error - request/task"
1134 " = %p/%p\n",
1135 __func__, request, task);
1136
1137 sas_task_abort(task);
1138 }
1139 }
1140 }
1141 if (test_and_clear_bit(IREQ_ABORT_PATH_ACTIVE, &request->flags))
1142 wake_up_all(&ihost->eventq);
1143
1144 if (!test_bit(IREQ_NO_AUTO_FREE_TAG, &request->flags))
1145 isci_free_tag(ihost, request->io_tag);
1146 }
1147 spin_unlock_irq(&ihost->scic_lock); 1121 spin_unlock_irq(&ihost->scic_lock);
1148 1122
1149 /* the coalesence timeout doubles at each encoding step, so 1123 /* the coalesence timeout doubles at each encoding step, so
diff --git a/drivers/scsi/isci/host.h b/drivers/scsi/isci/host.h
index eaa13c0be09a..8e8b46322c64 100644
--- a/drivers/scsi/isci/host.h
+++ b/drivers/scsi/isci/host.h
@@ -204,7 +204,6 @@ struct isci_host {
204 unsigned long flags; 204 unsigned long flags;
205 wait_queue_head_t eventq; 205 wait_queue_head_t eventq;
206 struct tasklet_struct completion_tasklet; 206 struct tasklet_struct completion_tasklet;
207 struct list_head requests_to_complete;
208 spinlock_t scic_lock; 207 spinlock_t scic_lock;
209 struct isci_request *reqs[SCI_MAX_IO_REQUESTS]; 208 struct isci_request *reqs[SCI_MAX_IO_REQUESTS];
210 struct isci_remote_device devices[SCI_MAX_REMOTE_DEVICES]; 209 struct isci_remote_device devices[SCI_MAX_REMOTE_DEVICES];
@@ -473,6 +472,7 @@ void isci_host_scan_start(struct Scsi_Host *);
473u16 isci_alloc_tag(struct isci_host *ihost); 472u16 isci_alloc_tag(struct isci_host *ihost);
474enum sci_status isci_free_tag(struct isci_host *ihost, u16 io_tag); 473enum sci_status isci_free_tag(struct isci_host *ihost, u16 io_tag);
475void isci_tci_free(struct isci_host *ihost, u16 tci); 474void isci_tci_free(struct isci_host *ihost, u16 tci);
475void ireq_done(struct isci_host *ihost, struct isci_request *ireq, struct sas_task *task);
476 476
477int isci_host_init(struct isci_host *); 477int isci_host_init(struct isci_host *);
478void isci_host_completion_routine(unsigned long data); 478void isci_host_completion_routine(unsigned long data);
diff --git a/drivers/scsi/isci/init.c b/drivers/scsi/isci/init.c
index f2a8a3346307..47e28b555029 100644
--- a/drivers/scsi/isci/init.c
+++ b/drivers/scsi/isci/init.c
@@ -555,7 +555,6 @@ static struct isci_host *isci_host_alloc(struct pci_dev *pdev, int id)
555 return NULL; 555 return NULL;
556 } 556 }
557 557
558 INIT_LIST_HEAD(&ihost->requests_to_complete);
559 for (i = 0; i < SCI_MAX_PORTS; i++) { 558 for (i = 0; i < SCI_MAX_PORTS; i++) {
560 struct isci_port *iport = &ihost->ports[i]; 559 struct isci_port *iport = &ihost->ports[i];
561 560
diff --git a/drivers/scsi/isci/request.c b/drivers/scsi/isci/request.c
index 6c530e4275e2..7a0431c73493 100644
--- a/drivers/scsi/isci/request.c
+++ b/drivers/scsi/isci/request.c
@@ -2748,13 +2748,9 @@ static void isci_request_io_request_complete(struct isci_host *ihost,
2748 enum exec_status status = SAS_ABORTED_TASK; 2748 enum exec_status status = SAS_ABORTED_TASK;
2749 2749
2750 dev_dbg(&ihost->pdev->dev, 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__, 2753 __func__, request, task, task->data_dir, completion_status);
2754 request,
2755 task,
2756 task->data_dir,
2757 completion_status);
2758 2754
2759 /* The request is done from an SCU HW perspective. */ 2755 /* The request is done from an SCU HW perspective. */
2760 2756
@@ -2955,9 +2951,6 @@ static void isci_request_io_request_complete(struct isci_host *ihost,
2955 } 2951 }
2956 spin_unlock_irqrestore(&task->task_state_lock, task_flags); 2952 spin_unlock_irqrestore(&task->task_state_lock, task_flags);
2957 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. */ 2954 /* complete the io request to the core. */
2962 sci_controller_complete_io(ihost, request->target_device, request); 2955 sci_controller_complete_io(ihost, request->target_device, request);
2963 2956
@@ -2966,6 +2959,8 @@ static void isci_request_io_request_complete(struct isci_host *ihost,
2966 * task to recognize the already completed case. 2959 * task to recognize the already completed case.
2967 */ 2960 */
2968 set_bit(IREQ_TERMINATED, &request->flags); 2961 set_bit(IREQ_TERMINATED, &request->flags);
2962
2963 ireq_done(ihost, request, task);
2969} 2964}
2970 2965
2971static void sci_request_started_state_enter(struct sci_base_state_machine *sm) 2966static void sci_request_started_state_enter(struct sci_base_state_machine *sm)
@@ -3416,7 +3411,6 @@ static struct isci_request *isci_request_from_tag(struct isci_host *ihost, u16 t
3416 ireq->io_request_completion = NULL; 3411 ireq->io_request_completion = NULL;
3417 ireq->flags = 0; 3412 ireq->flags = 0;
3418 ireq->num_sg_entries = 0; 3413 ireq->num_sg_entries = 0;
3419 INIT_LIST_HEAD(&ireq->completed_node);
3420 3414
3421 return ireq; 3415 return ireq;
3422} 3416}
diff --git a/drivers/scsi/isci/request.h b/drivers/scsi/isci/request.h
index 1a651579bb33..aff95317fcf4 100644
--- a/drivers/scsi/isci/request.h
+++ b/drivers/scsi/isci/request.h
@@ -95,8 +95,6 @@ struct isci_request {
95 struct isci_tmf *tmf_task_ptr; /* When ttype==tmf_task */ 95 struct isci_tmf *tmf_task_ptr; /* When ttype==tmf_task */
96 } ttype_ptr; 96 } ttype_ptr;
97 struct isci_host *isci_host; 97 struct isci_host *isci_host;
98 /* For use in the requests_to_{complete|abort} lists: */
99 struct list_head completed_node;
100 dma_addr_t request_daddr; 98 dma_addr_t request_daddr;
101 dma_addr_t zero_scatter_daddr; 99 dma_addr_t zero_scatter_daddr;
102 unsigned int num_sg_entries; 100 unsigned int num_sg_entries;