aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/scsi/zfcp_qdio.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390/scsi/zfcp_qdio.c')
-rw-r--r--drivers/s390/scsi/zfcp_qdio.c42
1 files changed, 14 insertions, 28 deletions
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}