aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/scsi/zfcp_qdio.c
diff options
context:
space:
mode:
authorSwen Schillig <swen@vnet.ibm.com>2009-08-18 09:43:13 -0400
committerJames Bottomley <James.Bottomley@suse.de>2009-09-05 09:49:16 -0400
commitbd63eaf4b8d783e6033930e377e516169abcadc4 (patch)
treecbb160657a3c6e0366c3d8b69275008f88e43fb9 /drivers/s390/scsi/zfcp_qdio.c
parent55c770fa11d21456e02dc7afb9a37404da9c7b4c (diff)
[SCSI] zfcp: fix layering oddities between zfcp_fsf and zfcp_qdio
There is no need for the QDIO layer to have knowledge or do things wich are done better by the FSF layer and vice versa. Straighten a few things to improve vividness. Signed-off-by: Swen Schillig <swen@vnet.ibm.com> Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/s390/scsi/zfcp_qdio.c')
-rw-r--r--drivers/s390/scsi/zfcp_qdio.c45
1 files changed, 2 insertions, 43 deletions
diff --git a/drivers/s390/scsi/zfcp_qdio.c b/drivers/s390/scsi/zfcp_qdio.c
index e0a215309df0..2e9b3a9cebd9 100644
--- a/drivers/s390/scsi/zfcp_qdio.c
+++ b/drivers/s390/scsi/zfcp_qdio.c
@@ -112,31 +112,6 @@ static void zfcp_qdio_int_req(struct ccw_device *cdev, unsigned int qdio_err,
112 wake_up(&adapter->request_wq); 112 wake_up(&adapter->request_wq);
113} 113}
114 114
115static void zfcp_qdio_reqid_check(struct zfcp_adapter *adapter,
116 unsigned long req_id, int sbal_idx)
117{
118 struct zfcp_fsf_req *fsf_req;
119 unsigned long flags;
120
121 spin_lock_irqsave(&adapter->req_list_lock, flags);
122 fsf_req = zfcp_reqlist_find(adapter, req_id);
123
124 if (!fsf_req)
125 /*
126 * Unknown request means that we have potentially memory
127 * corruption and must stop the machine immediatly.
128 */
129 panic("error: unknown request id (%lx) on adapter %s.\n",
130 req_id, dev_name(&adapter->ccw_device->dev));
131
132 zfcp_reqlist_remove(adapter, fsf_req);
133 spin_unlock_irqrestore(&adapter->req_list_lock, flags);
134
135 fsf_req->sbal_response = sbal_idx;
136 fsf_req->qdio_inb_usage = atomic_read(&adapter->resp_q.count);
137 zfcp_fsf_req_complete(fsf_req);
138}
139
140static void zfcp_qdio_resp_put_back(struct zfcp_adapter *adapter, int processed) 115static void zfcp_qdio_resp_put_back(struct zfcp_adapter *adapter, int processed)
141{ 116{
142 struct zfcp_qdio_queue *queue = &adapter->resp_q; 117 struct zfcp_qdio_queue *queue = &adapter->resp_q;
@@ -163,9 +138,7 @@ static void zfcp_qdio_int_resp(struct ccw_device *cdev, unsigned int qdio_err,
163 unsigned long parm) 138 unsigned long parm)
164{ 139{
165 struct zfcp_adapter *adapter = (struct zfcp_adapter *) parm; 140 struct zfcp_adapter *adapter = (struct zfcp_adapter *) parm;
166 struct zfcp_qdio_queue *queue = &adapter->resp_q; 141 int sbal_idx, sbal_no;
167 struct qdio_buffer_element *sbale;
168 int sbal_idx, sbale_idx, sbal_no;
169 142
170 if (unlikely(qdio_err)) { 143 if (unlikely(qdio_err)) {
171 zfcp_hba_dbf_event_qdio(adapter, qdio_err, first, count); 144 zfcp_hba_dbf_event_qdio(adapter, qdio_err, first, count);
@@ -179,22 +152,8 @@ static void zfcp_qdio_int_resp(struct ccw_device *cdev, unsigned int qdio_err,
179 */ 152 */
180 for (sbal_no = 0; sbal_no < count; sbal_no++) { 153 for (sbal_no = 0; sbal_no < count; sbal_no++) {
181 sbal_idx = (first + sbal_no) % QDIO_MAX_BUFFERS_PER_Q; 154 sbal_idx = (first + sbal_no) % QDIO_MAX_BUFFERS_PER_Q;
182
183 /* go through all SBALEs of SBAL */ 155 /* go through all SBALEs of SBAL */
184 for (sbale_idx = 0; sbale_idx < QDIO_MAX_ELEMENTS_PER_BUFFER; 156 zfcp_fsf_reqid_check(adapter, sbal_idx);
185 sbale_idx++) {
186 sbale = zfcp_qdio_sbale(queue, sbal_idx, sbale_idx);
187 zfcp_qdio_reqid_check(adapter,
188 (unsigned long) sbale->addr,
189 sbal_idx);
190 if (likely(sbale->flags & SBAL_FLAGS_LAST_ENTRY))
191 break;
192 };
193
194 if (unlikely(!(sbale->flags & SBAL_FLAGS_LAST_ENTRY)))
195 dev_warn(&adapter->ccw_device->dev,
196 "A QDIO protocol error occurred, "
197 "operations continue\n");
198 } 157 }
199 158
200 /* 159 /*