aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/scsi
diff options
context:
space:
mode:
authorJan Glauber <jang@linux.vnet.ibm.com>2008-07-17 11:16:48 -0400
committerHeiko Carstens <heiko.carstens@de.ibm.com>2008-07-17 11:22:10 -0400
commit779e6e1c724d30e0fd1baca78b852e41e3a23c1d (patch)
treeb7fc4f0f01b66c3c65226cc627edd501e00ab44f /drivers/s390/scsi
parentdae39843f478d181da5b5e1c2c703dfcaaf838c1 (diff)
[S390] qdio: new qdio driver.
List of major changes: - split qdio driver into several files - seperation of thin interrupt code - improved handling for multiple thin interrupt devices - inbound and outbound processing now always runs in tasklet context - significant less tasklet schedules per interrupt needed - merged qebsm with non-qebsm handling - cleanup qdio interface and added kerneldoc - coding style Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com> Reviewed-by: Utz Bacher <utz.bacher@de.ibm.com> Reviewed-by: Ursula Braun <braunu@de.ibm.com> Signed-off-by: Jan Glauber <jang@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Diffstat (limited to 'drivers/s390/scsi')
-rw-r--r--drivers/s390/scsi/zfcp_dbf.c12
-rw-r--r--drivers/s390/scsi/zfcp_dbf.h2
-rw-r--r--drivers/s390/scsi/zfcp_ext.h5
-rw-r--r--drivers/s390/scsi/zfcp_qdio.c42
4 files changed, 19 insertions, 42 deletions
diff --git a/drivers/s390/scsi/zfcp_dbf.c b/drivers/s390/scsi/zfcp_dbf.c
index 36169c6944fd..fca48b88fc53 100644
--- a/drivers/s390/scsi/zfcp_dbf.c
+++ b/drivers/s390/scsi/zfcp_dbf.c
@@ -297,15 +297,13 @@ void zfcp_hba_dbf_event_fsf_unsol(const char *tag, struct zfcp_adapter *adapter,
297/** 297/**
298 * zfcp_hba_dbf_event_qdio - trace event for QDIO related failure 298 * zfcp_hba_dbf_event_qdio - trace event for QDIO related failure
299 * @adapter: adapter affected by this QDIO related event 299 * @adapter: adapter affected by this QDIO related event
300 * @status: as passed by qdio module
301 * @qdio_error: as passed by qdio module 300 * @qdio_error: as passed by qdio module
302 * @siga_error: as passed by qdio module
303 * @sbal_index: first buffer with error condition, as passed by qdio module 301 * @sbal_index: first buffer with error condition, as passed by qdio module
304 * @sbal_count: number of buffers affected, as passed by qdio module 302 * @sbal_count: number of buffers affected, as passed by qdio module
305 */ 303 */
306void zfcp_hba_dbf_event_qdio(struct zfcp_adapter *adapter, unsigned int status, 304void zfcp_hba_dbf_event_qdio(struct zfcp_adapter *adapter,
307 unsigned int qdio_error, unsigned int siga_error, 305 unsigned int qdio_error, int sbal_index,
308 int sbal_index, int sbal_count) 306 int sbal_count)
309{ 307{
310 struct zfcp_hba_dbf_record *r = &adapter->hba_dbf_buf; 308 struct zfcp_hba_dbf_record *r = &adapter->hba_dbf_buf;
311 unsigned long flags; 309 unsigned long flags;
@@ -313,9 +311,7 @@ void zfcp_hba_dbf_event_qdio(struct zfcp_adapter *adapter, unsigned int status,
313 spin_lock_irqsave(&adapter->hba_dbf_lock, flags); 311 spin_lock_irqsave(&adapter->hba_dbf_lock, flags);
314 memset(r, 0, sizeof(*r)); 312 memset(r, 0, sizeof(*r));
315 strncpy(r->tag, "qdio", ZFCP_DBF_TAG_SIZE); 313 strncpy(r->tag, "qdio", ZFCP_DBF_TAG_SIZE);
316 r->u.qdio.status = status;
317 r->u.qdio.qdio_error = qdio_error; 314 r->u.qdio.qdio_error = qdio_error;
318 r->u.qdio.siga_error = siga_error;
319 r->u.qdio.sbal_index = sbal_index; 315 r->u.qdio.sbal_index = sbal_index;
320 r->u.qdio.sbal_count = sbal_count; 316 r->u.qdio.sbal_count = sbal_count;
321 debug_event(adapter->hba_dbf, 0, r, sizeof(*r)); 317 debug_event(adapter->hba_dbf, 0, r, sizeof(*r));
@@ -398,9 +394,7 @@ static void zfcp_hba_dbf_view_status(char **p,
398 394
399static void zfcp_hba_dbf_view_qdio(char **p, struct zfcp_hba_dbf_record_qdio *r) 395static void zfcp_hba_dbf_view_qdio(char **p, struct zfcp_hba_dbf_record_qdio *r)
400{ 396{
401 zfcp_dbf_out(p, "status", "0x%08x", r->status);
402 zfcp_dbf_out(p, "qdio_error", "0x%08x", r->qdio_error); 397 zfcp_dbf_out(p, "qdio_error", "0x%08x", r->qdio_error);
403 zfcp_dbf_out(p, "siga_error", "0x%08x", r->siga_error);
404 zfcp_dbf_out(p, "sbal_index", "0x%02x", r->sbal_index); 398 zfcp_dbf_out(p, "sbal_index", "0x%02x", r->sbal_index);
405 zfcp_dbf_out(p, "sbal_count", "0x%02x", r->sbal_count); 399 zfcp_dbf_out(p, "sbal_count", "0x%02x", r->sbal_count);
406} 400}
diff --git a/drivers/s390/scsi/zfcp_dbf.h b/drivers/s390/scsi/zfcp_dbf.h
index d04aea604974..0ddb18449d11 100644
--- a/drivers/s390/scsi/zfcp_dbf.h
+++ b/drivers/s390/scsi/zfcp_dbf.h
@@ -139,9 +139,7 @@ struct zfcp_hba_dbf_record_status {
139} __attribute__ ((packed)); 139} __attribute__ ((packed));
140 140
141struct zfcp_hba_dbf_record_qdio { 141struct zfcp_hba_dbf_record_qdio {
142 u32 status;
143 u32 qdio_error; 142 u32 qdio_error;
144 u32 siga_error;
145 u8 sbal_index; 143 u8 sbal_index;
146 u8 sbal_count; 144 u8 sbal_count;
147} __attribute__ ((packed)); 145} __attribute__ ((packed));
diff --git a/drivers/s390/scsi/zfcp_ext.h b/drivers/s390/scsi/zfcp_ext.h
index 8065b2b224b7..edfdb21591f3 100644
--- a/drivers/s390/scsi/zfcp_ext.h
+++ b/drivers/s390/scsi/zfcp_ext.h
@@ -48,9 +48,8 @@ extern void zfcp_rec_dbf_event_action(u8, struct zfcp_erp_action *);
48extern void zfcp_hba_dbf_event_fsf_response(struct zfcp_fsf_req *); 48extern void zfcp_hba_dbf_event_fsf_response(struct zfcp_fsf_req *);
49extern void zfcp_hba_dbf_event_fsf_unsol(const char *, struct zfcp_adapter *, 49extern void zfcp_hba_dbf_event_fsf_unsol(const char *, struct zfcp_adapter *,
50 struct fsf_status_read_buffer *); 50 struct fsf_status_read_buffer *);
51extern void zfcp_hba_dbf_event_qdio(struct zfcp_adapter *, 51extern void zfcp_hba_dbf_event_qdio(struct zfcp_adapter *, unsigned int, int,
52 unsigned int, unsigned int, unsigned int, 52 int);
53 int, int);
54extern void zfcp_san_dbf_event_ct_request(struct zfcp_fsf_req *); 53extern void zfcp_san_dbf_event_ct_request(struct zfcp_fsf_req *);
55extern void zfcp_san_dbf_event_ct_response(struct zfcp_fsf_req *); 54extern void zfcp_san_dbf_event_ct_response(struct zfcp_fsf_req *);
56extern void zfcp_san_dbf_event_els_request(struct zfcp_fsf_req *); 55extern void zfcp_san_dbf_event_els_request(struct zfcp_fsf_req *);
diff --git a/drivers/s390/scsi/zfcp_qdio.c b/drivers/s390/scsi/zfcp_qdio.c
index 72e3094796d4..d6dbd653fde9 100644
--- a/drivers/s390/scsi/zfcp_qdio.c
+++ b/drivers/s390/scsi/zfcp_qdio.c
@@ -74,17 +74,15 @@ static void zfcp_qdio_zero_sbals(struct qdio_buffer *sbal[], int first, int cnt)
74 } 74 }
75} 75}
76 76
77static void zfcp_qdio_int_req(struct ccw_device *cdev, unsigned int status, 77static void zfcp_qdio_int_req(struct ccw_device *cdev, unsigned int qdio_err,
78 unsigned int qdio_err, unsigned int siga_err, 78 int queue_no, int first, int count,
79 unsigned int queue_no, int first, int count,
80 unsigned long parm) 79 unsigned long parm)
81{ 80{
82 struct zfcp_adapter *adapter = (struct zfcp_adapter *) parm; 81 struct zfcp_adapter *adapter = (struct zfcp_adapter *) parm;
83 struct zfcp_qdio_queue *queue = &adapter->req_q; 82 struct zfcp_qdio_queue *queue = &adapter->req_q;
84 83
85 if (unlikely(status & QDIO_STATUS_LOOK_FOR_ERROR)) { 84 if (unlikely(qdio_err)) {
86 zfcp_hba_dbf_event_qdio(adapter, status, qdio_err, siga_err, 85 zfcp_hba_dbf_event_qdio(adapter, qdio_err, first, count);
87 first, count);
88 zfcp_qdio_handler_error(adapter, 140); 86 zfcp_qdio_handler_error(adapter, 140);
89 return; 87 return;
90 } 88 }
@@ -129,8 +127,7 @@ static void zfcp_qdio_resp_put_back(struct zfcp_adapter *adapter, int processed)
129 127
130 count = atomic_read(&queue->count) + processed; 128 count = atomic_read(&queue->count) + processed;
131 129
132 retval = do_QDIO(cdev, QDIO_FLAG_SYNC_INPUT | QDIO_FLAG_UNDER_INTERRUPT, 130 retval = do_QDIO(cdev, QDIO_FLAG_SYNC_INPUT, 0, start, count);
133 0, start, count, NULL);
134 131
135 if (unlikely(retval)) { 132 if (unlikely(retval)) {
136 atomic_set(&queue->count, count); 133 atomic_set(&queue->count, count);
@@ -142,9 +139,8 @@ static void zfcp_qdio_resp_put_back(struct zfcp_adapter *adapter, int processed)
142 } 139 }
143} 140}
144 141
145static void zfcp_qdio_int_resp(struct ccw_device *cdev, unsigned int status, 142static void zfcp_qdio_int_resp(struct ccw_device *cdev, unsigned int qdio_err,
146 unsigned int qdio_err, unsigned int siga_err, 143 int queue_no, int first, int count,
147 unsigned int queue_no, int first, int count,
148 unsigned long parm) 144 unsigned long parm)
149{ 145{
150 struct zfcp_adapter *adapter = (struct zfcp_adapter *) parm; 146 struct zfcp_adapter *adapter = (struct zfcp_adapter *) parm;
@@ -152,9 +148,8 @@ static void zfcp_qdio_int_resp(struct ccw_device *cdev, unsigned int status,
152 volatile struct qdio_buffer_element *sbale; 148 volatile struct qdio_buffer_element *sbale;
153 int sbal_idx, sbale_idx, sbal_no; 149 int sbal_idx, sbale_idx, sbal_no;
154 150
155 if (unlikely(status & QDIO_STATUS_LOOK_FOR_ERROR)) { 151 if (unlikely(qdio_err)) {
156 zfcp_hba_dbf_event_qdio(adapter, status, qdio_err, siga_err, 152 zfcp_hba_dbf_event_qdio(adapter, qdio_err, first, count);
157 first, count);
158 zfcp_qdio_handler_error(adapter, 147); 153 zfcp_qdio_handler_error(adapter, 147);
159 return; 154 return;
160 } 155 }
@@ -362,7 +357,7 @@ int zfcp_qdio_send(struct zfcp_fsf_req *fsf_req)
362 } 357 }
363 358
364 retval = do_QDIO(adapter->ccw_device, QDIO_FLAG_SYNC_OUTPUT, 0, first, 359 retval = do_QDIO(adapter->ccw_device, QDIO_FLAG_SYNC_OUTPUT, 0, first,
365 count, NULL); 360 count);
366 if (unlikely(retval)) { 361 if (unlikely(retval)) {
367 zfcp_qdio_zero_sbals(req_q->sbal, first, count); 362 zfcp_qdio_zero_sbals(req_q->sbal, first, count);
368 return retval; 363 return retval;
@@ -400,10 +395,6 @@ int zfcp_qdio_allocate(struct zfcp_adapter *adapter)
400 init_data->qib_param_field = NULL; 395 init_data->qib_param_field = NULL;
401 init_data->input_slib_elements = NULL; 396 init_data->input_slib_elements = NULL;
402 init_data->output_slib_elements = NULL; 397 init_data->output_slib_elements = NULL;
403 init_data->min_input_threshold = 1;
404 init_data->max_input_threshold = 5000;
405 init_data->min_output_threshold = 1;
406 init_data->max_output_threshold = 1000;
407 init_data->no_input_qs = 1; 398 init_data->no_input_qs = 1;
408 init_data->no_output_qs = 1; 399 init_data->no_output_qs = 1;
409 init_data->input_handler = zfcp_qdio_int_resp; 400 init_data->input_handler = zfcp_qdio_int_resp;
@@ -436,9 +427,7 @@ void zfcp_qdio_close(struct zfcp_adapter *adapter)
436 atomic_clear_mask(ZFCP_STATUS_ADAPTER_QDIOUP, &adapter->status); 427 atomic_clear_mask(ZFCP_STATUS_ADAPTER_QDIOUP, &adapter->status);
437 spin_unlock(&req_q->lock); 428 spin_unlock(&req_q->lock);
438 429
439 while (qdio_shutdown(adapter->ccw_device, QDIO_FLAG_CLEANUP_USING_CLEAR) 430 qdio_shutdown(adapter->ccw_device, QDIO_FLAG_CLEANUP_USING_CLEAR);
440 == -EINPROGRESS)
441 ssleep(1);
442 431
443 /* cleanup used outbound sbals */ 432 /* cleanup used outbound sbals */
444 count = atomic_read(&req_q->count); 433 count = atomic_read(&req_q->count);
@@ -473,7 +462,7 @@ int zfcp_qdio_open(struct zfcp_adapter *adapter)
473 return -EIO; 462 return -EIO;
474 } 463 }
475 464
476 if (qdio_activate(adapter->ccw_device, 0)) { 465 if (qdio_activate(adapter->ccw_device)) {
477 dev_err(&adapter->ccw_device->dev, 466 dev_err(&adapter->ccw_device->dev,
478 "Activate of QDIO queues failed.\n"); 467 "Activate of QDIO queues failed.\n");
479 goto failed_qdio; 468 goto failed_qdio;
@@ -487,7 +476,7 @@ int zfcp_qdio_open(struct zfcp_adapter *adapter)
487 } 476 }
488 477
489 if (do_QDIO(adapter->ccw_device, QDIO_FLAG_SYNC_INPUT, 0, 0, 478 if (do_QDIO(adapter->ccw_device, QDIO_FLAG_SYNC_INPUT, 0, 0,
490 QDIO_MAX_BUFFERS_PER_Q, NULL)) { 479 QDIO_MAX_BUFFERS_PER_Q)) {
491 dev_err(&adapter->ccw_device->dev, 480 dev_err(&adapter->ccw_device->dev,
492 "Init of QDIO response queue failed.\n"); 481 "Init of QDIO response queue failed.\n");
493 goto failed_qdio; 482 goto failed_qdio;
@@ -501,9 +490,6 @@ int zfcp_qdio_open(struct zfcp_adapter *adapter)
501 return 0; 490 return 0;
502 491
503failed_qdio: 492failed_qdio:
504 while (qdio_shutdown(adapter->ccw_device, QDIO_FLAG_CLEANUP_USING_CLEAR) 493 qdio_shutdown(adapter->ccw_device, QDIO_FLAG_CLEANUP_USING_CLEAR);
505 == -EINPROGRESS)
506 ssleep(1);
507
508 return -EIO; 494 return -EIO;
509} 495}