diff options
author | David S. Miller <davem@davemloft.net> | 2008-09-08 19:59:05 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-09-08 19:59:05 -0400 |
commit | 17dce5dfe38ae2fb359b61e855f5d8a3a8b7892b (patch) | |
tree | 88bb1fcf84f9ebfa4299c9a8dcd9e6330b358446 /drivers/s390/cio/qdio_main.c | |
parent | 712d6954e3998d0de2840d8130941e8042541246 (diff) | |
parent | 82a28c794f27aac17d7a3ebd7f14d731a11a5532 (diff) |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6
Conflicts:
net/mac80211/mlme.c
Diffstat (limited to 'drivers/s390/cio/qdio_main.c')
-rw-r--r-- | drivers/s390/cio/qdio_main.c | 74 |
1 files changed, 34 insertions, 40 deletions
diff --git a/drivers/s390/cio/qdio_main.c b/drivers/s390/cio/qdio_main.c index d15648514a0f..e6eabc853422 100644 --- a/drivers/s390/cio/qdio_main.c +++ b/drivers/s390/cio/qdio_main.c | |||
@@ -330,6 +330,7 @@ static int qdio_siga_output(struct qdio_q *q) | |||
330 | int cc; | 330 | int cc; |
331 | u32 busy_bit; | 331 | u32 busy_bit; |
332 | u64 start_time = 0; | 332 | u64 start_time = 0; |
333 | char dbf_text[15]; | ||
333 | 334 | ||
334 | QDIO_DBF_TEXT5(0, trace, "sigaout"); | 335 | QDIO_DBF_TEXT5(0, trace, "sigaout"); |
335 | QDIO_DBF_HEX5(0, trace, &q, sizeof(void *)); | 336 | QDIO_DBF_HEX5(0, trace, &q, sizeof(void *)); |
@@ -338,6 +339,9 @@ static int qdio_siga_output(struct qdio_q *q) | |||
338 | again: | 339 | again: |
339 | cc = qdio_do_siga_output(q, &busy_bit); | 340 | cc = qdio_do_siga_output(q, &busy_bit); |
340 | if (queue_type(q) == QDIO_IQDIO_QFMT && cc == 2 && busy_bit) { | 341 | if (queue_type(q) == QDIO_IQDIO_QFMT && cc == 2 && busy_bit) { |
342 | sprintf(dbf_text, "bb%4x%2x", q->irq_ptr->schid.sch_no, q->nr); | ||
343 | QDIO_DBF_TEXT3(0, trace, dbf_text); | ||
344 | |||
341 | if (!start_time) | 345 | if (!start_time) |
342 | start_time = get_usecs(); | 346 | start_time = get_usecs(); |
343 | else if ((get_usecs() - start_time) < QDIO_BUSY_BIT_PATIENCE) | 347 | else if ((get_usecs() - start_time) < QDIO_BUSY_BIT_PATIENCE) |
@@ -748,16 +752,18 @@ static void qdio_kick_outbound_q(struct qdio_q *q) | |||
748 | rc = qdio_siga_output(q); | 752 | rc = qdio_siga_output(q); |
749 | switch (rc) { | 753 | switch (rc) { |
750 | case 0: | 754 | case 0: |
751 | /* went smooth this time, reset timestamp */ | ||
752 | q->u.out.timestamp = 0; | ||
753 | |||
754 | /* TODO: improve error handling for CC=0 case */ | 755 | /* TODO: improve error handling for CC=0 case */ |
755 | #ifdef CONFIG_QDIO_DEBUG | 756 | #ifdef CONFIG_QDIO_DEBUG |
756 | QDIO_DBF_TEXT3(0, trace, "cc2reslv"); | 757 | if (q->u.out.timestamp) { |
757 | sprintf(dbf_text, "%4x%2x%2x", q->irq_ptr->schid.sch_no, q->nr, | 758 | QDIO_DBF_TEXT3(0, trace, "cc2reslv"); |
758 | atomic_read(&q->u.out.busy_siga_counter)); | 759 | sprintf(dbf_text, "%4x%2x%2x", q->irq_ptr->schid.sch_no, |
759 | QDIO_DBF_TEXT3(0, trace, dbf_text); | 760 | q->nr, |
761 | atomic_read(&q->u.out.busy_siga_counter)); | ||
762 | QDIO_DBF_TEXT3(0, trace, dbf_text); | ||
763 | } | ||
760 | #endif /* CONFIG_QDIO_DEBUG */ | 764 | #endif /* CONFIG_QDIO_DEBUG */ |
765 | /* went smooth this time, reset timestamp */ | ||
766 | q->u.out.timestamp = 0; | ||
761 | break; | 767 | break; |
762 | /* cc=2 and busy bit */ | 768 | /* cc=2 and busy bit */ |
763 | case (2 | QDIO_ERROR_SIGA_BUSY): | 769 | case (2 | QDIO_ERROR_SIGA_BUSY): |
@@ -1066,14 +1072,12 @@ void qdio_int_handler(struct ccw_device *cdev, unsigned long intparm, | |||
1066 | if (IS_ERR(irb)) { | 1072 | if (IS_ERR(irb)) { |
1067 | switch (PTR_ERR(irb)) { | 1073 | switch (PTR_ERR(irb)) { |
1068 | case -EIO: | 1074 | case -EIO: |
1069 | sprintf(dbf_text, "ierr%4x", | 1075 | sprintf(dbf_text, "ierr%4x", irq_ptr->schid.sch_no); |
1070 | cdev->private->schid.sch_no); | ||
1071 | QDIO_DBF_TEXT2(1, setup, dbf_text); | 1076 | QDIO_DBF_TEXT2(1, setup, dbf_text); |
1072 | qdio_int_error(cdev); | 1077 | qdio_int_error(cdev); |
1073 | return; | 1078 | return; |
1074 | case -ETIMEDOUT: | 1079 | case -ETIMEDOUT: |
1075 | sprintf(dbf_text, "qtoh%4x", | 1080 | sprintf(dbf_text, "qtoh%4x", irq_ptr->schid.sch_no); |
1076 | cdev->private->schid.sch_no); | ||
1077 | QDIO_DBF_TEXT2(1, setup, dbf_text); | 1081 | QDIO_DBF_TEXT2(1, setup, dbf_text); |
1078 | qdio_int_error(cdev); | 1082 | qdio_int_error(cdev); |
1079 | return; | 1083 | return; |
@@ -1124,8 +1128,10 @@ void qdio_int_handler(struct ccw_device *cdev, unsigned long intparm, | |||
1124 | struct qdio_ssqd_desc *qdio_get_ssqd_desc(struct ccw_device *cdev) | 1128 | struct qdio_ssqd_desc *qdio_get_ssqd_desc(struct ccw_device *cdev) |
1125 | { | 1129 | { |
1126 | struct qdio_irq *irq_ptr; | 1130 | struct qdio_irq *irq_ptr; |
1131 | char dbf_text[15]; | ||
1127 | 1132 | ||
1128 | QDIO_DBF_TEXT0(0, setup, "getssqd"); | 1133 | sprintf(dbf_text, "qssq%4x", cdev->private->schid.sch_no); |
1134 | QDIO_DBF_TEXT0(0, setup, dbf_text); | ||
1129 | 1135 | ||
1130 | irq_ptr = cdev->private->qdio_data; | 1136 | irq_ptr = cdev->private->qdio_data; |
1131 | if (!irq_ptr) | 1137 | if (!irq_ptr) |
@@ -1149,14 +1155,13 @@ int qdio_cleanup(struct ccw_device *cdev, int how) | |||
1149 | char dbf_text[15]; | 1155 | char dbf_text[15]; |
1150 | int rc; | 1156 | int rc; |
1151 | 1157 | ||
1158 | sprintf(dbf_text, "qcln%4x", cdev->private->schid.sch_no); | ||
1159 | QDIO_DBF_TEXT0(0, setup, dbf_text); | ||
1160 | |||
1152 | irq_ptr = cdev->private->qdio_data; | 1161 | irq_ptr = cdev->private->qdio_data; |
1153 | if (!irq_ptr) | 1162 | if (!irq_ptr) |
1154 | return -ENODEV; | 1163 | return -ENODEV; |
1155 | 1164 | ||
1156 | sprintf(dbf_text, "qcln%4x", irq_ptr->schid.sch_no); | ||
1157 | QDIO_DBF_TEXT1(0, trace, dbf_text); | ||
1158 | QDIO_DBF_TEXT0(0, setup, dbf_text); | ||
1159 | |||
1160 | rc = qdio_shutdown(cdev, how); | 1165 | rc = qdio_shutdown(cdev, how); |
1161 | if (rc == 0) | 1166 | if (rc == 0) |
1162 | rc = qdio_free(cdev); | 1167 | rc = qdio_free(cdev); |
@@ -1191,6 +1196,9 @@ int qdio_shutdown(struct ccw_device *cdev, int how) | |||
1191 | unsigned long flags; | 1196 | unsigned long flags; |
1192 | char dbf_text[15]; | 1197 | char dbf_text[15]; |
1193 | 1198 | ||
1199 | sprintf(dbf_text, "qshu%4x", cdev->private->schid.sch_no); | ||
1200 | QDIO_DBF_TEXT0(0, setup, dbf_text); | ||
1201 | |||
1194 | irq_ptr = cdev->private->qdio_data; | 1202 | irq_ptr = cdev->private->qdio_data; |
1195 | if (!irq_ptr) | 1203 | if (!irq_ptr) |
1196 | return -ENODEV; | 1204 | return -ENODEV; |
@@ -1205,10 +1213,6 @@ int qdio_shutdown(struct ccw_device *cdev, int how) | |||
1205 | return 0; | 1213 | return 0; |
1206 | } | 1214 | } |
1207 | 1215 | ||
1208 | sprintf(dbf_text, "qsqs%4x", irq_ptr->schid.sch_no); | ||
1209 | QDIO_DBF_TEXT1(0, trace, dbf_text); | ||
1210 | QDIO_DBF_TEXT0(0, setup, dbf_text); | ||
1211 | |||
1212 | tiqdio_remove_input_queues(irq_ptr); | 1216 | tiqdio_remove_input_queues(irq_ptr); |
1213 | qdio_shutdown_queues(cdev); | 1217 | qdio_shutdown_queues(cdev); |
1214 | qdio_shutdown_debug_entries(irq_ptr, cdev); | 1218 | qdio_shutdown_debug_entries(irq_ptr, cdev); |
@@ -1247,7 +1251,6 @@ no_cleanup: | |||
1247 | 1251 | ||
1248 | qdio_set_state(irq_ptr, QDIO_IRQ_STATE_INACTIVE); | 1252 | qdio_set_state(irq_ptr, QDIO_IRQ_STATE_INACTIVE); |
1249 | mutex_unlock(&irq_ptr->setup_mutex); | 1253 | mutex_unlock(&irq_ptr->setup_mutex); |
1250 | module_put(THIS_MODULE); | ||
1251 | if (rc) | 1254 | if (rc) |
1252 | return rc; | 1255 | return rc; |
1253 | return 0; | 1256 | return 0; |
@@ -1263,16 +1266,14 @@ int qdio_free(struct ccw_device *cdev) | |||
1263 | struct qdio_irq *irq_ptr; | 1266 | struct qdio_irq *irq_ptr; |
1264 | char dbf_text[15]; | 1267 | char dbf_text[15]; |
1265 | 1268 | ||
1269 | sprintf(dbf_text, "qfre%4x", cdev->private->schid.sch_no); | ||
1270 | QDIO_DBF_TEXT0(0, setup, dbf_text); | ||
1271 | |||
1266 | irq_ptr = cdev->private->qdio_data; | 1272 | irq_ptr = cdev->private->qdio_data; |
1267 | if (!irq_ptr) | 1273 | if (!irq_ptr) |
1268 | return -ENODEV; | 1274 | return -ENODEV; |
1269 | 1275 | ||
1270 | mutex_lock(&irq_ptr->setup_mutex); | 1276 | mutex_lock(&irq_ptr->setup_mutex); |
1271 | |||
1272 | sprintf(dbf_text, "qfqs%4x", irq_ptr->schid.sch_no); | ||
1273 | QDIO_DBF_TEXT1(0, trace, dbf_text); | ||
1274 | QDIO_DBF_TEXT0(0, setup, dbf_text); | ||
1275 | |||
1276 | cdev->private->qdio_data = NULL; | 1277 | cdev->private->qdio_data = NULL; |
1277 | mutex_unlock(&irq_ptr->setup_mutex); | 1278 | mutex_unlock(&irq_ptr->setup_mutex); |
1278 | 1279 | ||
@@ -1295,7 +1296,6 @@ int qdio_initialize(struct qdio_initialize *init_data) | |||
1295 | 1296 | ||
1296 | sprintf(dbf_text, "qini%4x", init_data->cdev->private->schid.sch_no); | 1297 | sprintf(dbf_text, "qini%4x", init_data->cdev->private->schid.sch_no); |
1297 | QDIO_DBF_TEXT0(0, setup, dbf_text); | 1298 | QDIO_DBF_TEXT0(0, setup, dbf_text); |
1298 | QDIO_DBF_TEXT0(0, trace, dbf_text); | ||
1299 | 1299 | ||
1300 | rc = qdio_allocate(init_data); | 1300 | rc = qdio_allocate(init_data); |
1301 | if (rc) | 1301 | if (rc) |
@@ -1319,7 +1319,6 @@ int qdio_allocate(struct qdio_initialize *init_data) | |||
1319 | 1319 | ||
1320 | sprintf(dbf_text, "qalc%4x", init_data->cdev->private->schid.sch_no); | 1320 | sprintf(dbf_text, "qalc%4x", init_data->cdev->private->schid.sch_no); |
1321 | QDIO_DBF_TEXT0(0, setup, dbf_text); | 1321 | QDIO_DBF_TEXT0(0, setup, dbf_text); |
1322 | QDIO_DBF_TEXT0(0, trace, dbf_text); | ||
1323 | 1322 | ||
1324 | if ((init_data->no_input_qs && !init_data->input_handler) || | 1323 | if ((init_data->no_input_qs && !init_data->input_handler) || |
1325 | (init_data->no_output_qs && !init_data->output_handler)) | 1324 | (init_data->no_output_qs && !init_data->output_handler)) |
@@ -1389,6 +1388,9 @@ int qdio_establish(struct qdio_initialize *init_data) | |||
1389 | unsigned long saveflags; | 1388 | unsigned long saveflags; |
1390 | int rc; | 1389 | int rc; |
1391 | 1390 | ||
1391 | sprintf(dbf_text, "qest%4x", cdev->private->schid.sch_no); | ||
1392 | QDIO_DBF_TEXT0(0, setup, dbf_text); | ||
1393 | |||
1392 | irq_ptr = cdev->private->qdio_data; | 1394 | irq_ptr = cdev->private->qdio_data; |
1393 | if (!irq_ptr) | 1395 | if (!irq_ptr) |
1394 | return -ENODEV; | 1396 | return -ENODEV; |
@@ -1396,13 +1398,6 @@ int qdio_establish(struct qdio_initialize *init_data) | |||
1396 | if (cdev->private->state != DEV_STATE_ONLINE) | 1398 | if (cdev->private->state != DEV_STATE_ONLINE) |
1397 | return -EINVAL; | 1399 | return -EINVAL; |
1398 | 1400 | ||
1399 | if (!try_module_get(THIS_MODULE)) | ||
1400 | return -EINVAL; | ||
1401 | |||
1402 | sprintf(dbf_text, "qest%4x", cdev->private->schid.sch_no); | ||
1403 | QDIO_DBF_TEXT0(0, setup, dbf_text); | ||
1404 | QDIO_DBF_TEXT0(0, trace, dbf_text); | ||
1405 | |||
1406 | mutex_lock(&irq_ptr->setup_mutex); | 1401 | mutex_lock(&irq_ptr->setup_mutex); |
1407 | qdio_setup_irq(init_data); | 1402 | qdio_setup_irq(init_data); |
1408 | 1403 | ||
@@ -1472,6 +1467,9 @@ int qdio_activate(struct ccw_device *cdev) | |||
1472 | unsigned long saveflags; | 1467 | unsigned long saveflags; |
1473 | char dbf_text[20]; | 1468 | char dbf_text[20]; |
1474 | 1469 | ||
1470 | sprintf(dbf_text, "qact%4x", cdev->private->schid.sch_no); | ||
1471 | QDIO_DBF_TEXT0(0, setup, dbf_text); | ||
1472 | |||
1475 | irq_ptr = cdev->private->qdio_data; | 1473 | irq_ptr = cdev->private->qdio_data; |
1476 | if (!irq_ptr) | 1474 | if (!irq_ptr) |
1477 | return -ENODEV; | 1475 | return -ENODEV; |
@@ -1485,10 +1483,6 @@ int qdio_activate(struct ccw_device *cdev) | |||
1485 | goto out; | 1483 | goto out; |
1486 | } | 1484 | } |
1487 | 1485 | ||
1488 | sprintf(dbf_text, "qact%4x", irq_ptr->schid.sch_no); | ||
1489 | QDIO_DBF_TEXT2(0, setup, dbf_text); | ||
1490 | QDIO_DBF_TEXT2(0, trace, dbf_text); | ||
1491 | |||
1492 | irq_ptr->ccw.cmd_code = irq_ptr->aqueue.cmd; | 1486 | irq_ptr->ccw.cmd_code = irq_ptr->aqueue.cmd; |
1493 | irq_ptr->ccw.flags = CCW_FLAG_SLI; | 1487 | irq_ptr->ccw.flags = CCW_FLAG_SLI; |
1494 | irq_ptr->ccw.count = irq_ptr->aqueue.count; | 1488 | irq_ptr->ccw.count = irq_ptr->aqueue.count; |
@@ -1663,7 +1657,7 @@ int do_QDIO(struct ccw_device *cdev, unsigned int callflags, | |||
1663 | #ifdef CONFIG_QDIO_DEBUG | 1657 | #ifdef CONFIG_QDIO_DEBUG |
1664 | char dbf_text[20]; | 1658 | char dbf_text[20]; |
1665 | 1659 | ||
1666 | sprintf(dbf_text, "doQD%04x", cdev->private->schid.sch_no); | 1660 | sprintf(dbf_text, "doQD%4x", cdev->private->schid.sch_no); |
1667 | QDIO_DBF_TEXT3(0, trace, dbf_text); | 1661 | QDIO_DBF_TEXT3(0, trace, dbf_text); |
1668 | #endif /* CONFIG_QDIO_DEBUG */ | 1662 | #endif /* CONFIG_QDIO_DEBUG */ |
1669 | 1663 | ||