aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ehea/ehea_qmr.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2010-12-06 23:45:28 -0500
committerDavid S. Miller <davem@davemloft.net>2010-12-06 23:45:28 -0500
commitcfa969e385a23e4c85f50e0ed5de25a2e18bf9d4 (patch)
treefccb9ec6086ce79db860678a77d72269d197ef6e /drivers/net/ehea/ehea_qmr.c
parent40fe7d88ab3eb711b307fab1b92aa6870914c975 (diff)
Revert "ehea: Use the standard logging functions"
This reverts commit 539995d18649023199986424d140f1d620372ce5. As reported by Stephen Rothwell, this breaks the build. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ehea/ehea_qmr.c')
-rw-r--r--drivers/net/ehea/ehea_qmr.c89
1 files changed, 44 insertions, 45 deletions
diff --git a/drivers/net/ehea/ehea_qmr.c b/drivers/net/ehea/ehea_qmr.c
index cd44bb8017d9..89128b6373e3 100644
--- a/drivers/net/ehea/ehea_qmr.c
+++ b/drivers/net/ehea/ehea_qmr.c
@@ -26,8 +26,6 @@
26 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 26 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
27 */ 27 */
28 28
29#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
30
31#include <linux/mm.h> 29#include <linux/mm.h>
32#include <linux/slab.h> 30#include <linux/slab.h>
33#include "ehea.h" 31#include "ehea.h"
@@ -47,7 +45,7 @@ static void *hw_qpageit_get_inc(struct hw_queue *queue)
47 queue->current_q_offset -= queue->pagesize; 45 queue->current_q_offset -= queue->pagesize;
48 retvalue = NULL; 46 retvalue = NULL;
49 } else if (((u64) retvalue) & (EHEA_PAGESIZE-1)) { 47 } else if (((u64) retvalue) & (EHEA_PAGESIZE-1)) {
50 pr_err("not on pageboundary\n"); 48 ehea_error("not on pageboundary");
51 retvalue = NULL; 49 retvalue = NULL;
52 } 50 }
53 return retvalue; 51 return retvalue;
@@ -60,15 +58,15 @@ static int hw_queue_ctor(struct hw_queue *queue, const u32 nr_of_pages,
60 int i, k; 58 int i, k;
61 59
62 if ((pagesize > PAGE_SIZE) || (!pages_per_kpage)) { 60 if ((pagesize > PAGE_SIZE) || (!pages_per_kpage)) {
63 pr_err("pagesize conflict! kernel pagesize=%d, ehea pagesize=%d\n", 61 ehea_error("pagesize conflict! kernel pagesize=%d, "
64 (int)PAGE_SIZE, (int)pagesize); 62 "ehea pagesize=%d", (int)PAGE_SIZE, (int)pagesize);
65 return -EINVAL; 63 return -EINVAL;
66 } 64 }
67 65
68 queue->queue_length = nr_of_pages * pagesize; 66 queue->queue_length = nr_of_pages * pagesize;
69 queue->queue_pages = kmalloc(nr_of_pages * sizeof(void *), GFP_KERNEL); 67 queue->queue_pages = kmalloc(nr_of_pages * sizeof(void *), GFP_KERNEL);
70 if (!queue->queue_pages) { 68 if (!queue->queue_pages) {
71 pr_err("no mem for queue_pages\n"); 69 ehea_error("no mem for queue_pages");
72 return -ENOMEM; 70 return -ENOMEM;
73 } 71 }
74 72
@@ -132,7 +130,7 @@ struct ehea_cq *ehea_create_cq(struct ehea_adapter *adapter,
132 130
133 cq = kzalloc(sizeof(*cq), GFP_KERNEL); 131 cq = kzalloc(sizeof(*cq), GFP_KERNEL);
134 if (!cq) { 132 if (!cq) {
135 pr_err("no mem for cq\n"); 133 ehea_error("no mem for cq");
136 goto out_nomem; 134 goto out_nomem;
137 } 135 }
138 136
@@ -149,7 +147,7 @@ struct ehea_cq *ehea_create_cq(struct ehea_adapter *adapter,
149 hret = ehea_h_alloc_resource_cq(adapter->handle, &cq->attr, 147 hret = ehea_h_alloc_resource_cq(adapter->handle, &cq->attr,
150 &cq->fw_handle, &cq->epas); 148 &cq->fw_handle, &cq->epas);
151 if (hret != H_SUCCESS) { 149 if (hret != H_SUCCESS) {
152 pr_err("alloc_resource_cq failed\n"); 150 ehea_error("alloc_resource_cq failed");
153 goto out_freemem; 151 goto out_freemem;
154 } 152 }
155 153
@@ -161,7 +159,7 @@ struct ehea_cq *ehea_create_cq(struct ehea_adapter *adapter,
161 for (counter = 0; counter < cq->attr.nr_pages; counter++) { 159 for (counter = 0; counter < cq->attr.nr_pages; counter++) {
162 vpage = hw_qpageit_get_inc(&cq->hw_queue); 160 vpage = hw_qpageit_get_inc(&cq->hw_queue);
163 if (!vpage) { 161 if (!vpage) {
164 pr_err("hw_qpageit_get_inc failed\n"); 162 ehea_error("hw_qpageit_get_inc failed");
165 goto out_kill_hwq; 163 goto out_kill_hwq;
166 } 164 }
167 165
@@ -170,8 +168,9 @@ struct ehea_cq *ehea_create_cq(struct ehea_adapter *adapter,
170 0, EHEA_CQ_REGISTER_ORIG, 168 0, EHEA_CQ_REGISTER_ORIG,
171 cq->fw_handle, rpage, 1); 169 cq->fw_handle, rpage, 1);
172 if (hret < H_SUCCESS) { 170 if (hret < H_SUCCESS) {
173 pr_err("register_rpage_cq failed ehea_cq=%p hret=%llx counter=%i act_pages=%i\n", 171 ehea_error("register_rpage_cq failed ehea_cq=%p "
174 cq, hret, counter, cq->attr.nr_pages); 172 "hret=%llx counter=%i act_pages=%i",
173 cq, hret, counter, cq->attr.nr_pages);
175 goto out_kill_hwq; 174 goto out_kill_hwq;
176 } 175 }
177 176
@@ -179,14 +178,14 @@ struct ehea_cq *ehea_create_cq(struct ehea_adapter *adapter,
179 vpage = hw_qpageit_get_inc(&cq->hw_queue); 178 vpage = hw_qpageit_get_inc(&cq->hw_queue);
180 179
181 if ((hret != H_SUCCESS) || (vpage)) { 180 if ((hret != H_SUCCESS) || (vpage)) {
182 pr_err("registration of pages not complete hret=%llx\n", 181 ehea_error("registration of pages not "
183 hret); 182 "complete hret=%llx\n", hret);
184 goto out_kill_hwq; 183 goto out_kill_hwq;
185 } 184 }
186 } else { 185 } else {
187 if (hret != H_PAGE_REGISTERED) { 186 if (hret != H_PAGE_REGISTERED) {
188 pr_err("CQ: registration of page failed hret=%llx\n", 187 ehea_error("CQ: registration of page failed "
189 hret); 188 "hret=%llx\n", hret);
190 goto out_kill_hwq; 189 goto out_kill_hwq;
191 } 190 }
192 } 191 }
@@ -242,7 +241,7 @@ int ehea_destroy_cq(struct ehea_cq *cq)
242 } 241 }
243 242
244 if (hret != H_SUCCESS) { 243 if (hret != H_SUCCESS) {
245 pr_err("destroy CQ failed\n"); 244 ehea_error("destroy CQ failed");
246 return -EIO; 245 return -EIO;
247 } 246 }
248 247
@@ -260,7 +259,7 @@ struct ehea_eq *ehea_create_eq(struct ehea_adapter *adapter,
260 259
261 eq = kzalloc(sizeof(*eq), GFP_KERNEL); 260 eq = kzalloc(sizeof(*eq), GFP_KERNEL);
262 if (!eq) { 261 if (!eq) {
263 pr_err("no mem for eq\n"); 262 ehea_error("no mem for eq");
264 return NULL; 263 return NULL;
265 } 264 }
266 265
@@ -273,21 +272,21 @@ struct ehea_eq *ehea_create_eq(struct ehea_adapter *adapter,
273 hret = ehea_h_alloc_resource_eq(adapter->handle, 272 hret = ehea_h_alloc_resource_eq(adapter->handle,
274 &eq->attr, &eq->fw_handle); 273 &eq->attr, &eq->fw_handle);
275 if (hret != H_SUCCESS) { 274 if (hret != H_SUCCESS) {
276 pr_err("alloc_resource_eq failed\n"); 275 ehea_error("alloc_resource_eq failed");
277 goto out_freemem; 276 goto out_freemem;
278 } 277 }
279 278
280 ret = hw_queue_ctor(&eq->hw_queue, eq->attr.nr_pages, 279 ret = hw_queue_ctor(&eq->hw_queue, eq->attr.nr_pages,
281 EHEA_PAGESIZE, sizeof(struct ehea_eqe)); 280 EHEA_PAGESIZE, sizeof(struct ehea_eqe));
282 if (ret) { 281 if (ret) {
283 pr_err("can't allocate eq pages\n"); 282 ehea_error("can't allocate eq pages");
284 goto out_freeres; 283 goto out_freeres;
285 } 284 }
286 285
287 for (i = 0; i < eq->attr.nr_pages; i++) { 286 for (i = 0; i < eq->attr.nr_pages; i++) {
288 vpage = hw_qpageit_get_inc(&eq->hw_queue); 287 vpage = hw_qpageit_get_inc(&eq->hw_queue);
289 if (!vpage) { 288 if (!vpage) {
290 pr_err("hw_qpageit_get_inc failed\n"); 289 ehea_error("hw_qpageit_get_inc failed");
291 hret = H_RESOURCE; 290 hret = H_RESOURCE;
292 goto out_kill_hwq; 291 goto out_kill_hwq;
293 } 292 }
@@ -371,7 +370,7 @@ int ehea_destroy_eq(struct ehea_eq *eq)
371 } 370 }
372 371
373 if (hret != H_SUCCESS) { 372 if (hret != H_SUCCESS) {
374 pr_err("destroy EQ failed\n"); 373 ehea_error("destroy EQ failed");
375 return -EIO; 374 return -EIO;
376 } 375 }
377 376
@@ -396,7 +395,7 @@ int ehea_qp_alloc_register(struct ehea_qp *qp, struct hw_queue *hw_queue,
396 for (cnt = 0; cnt < nr_pages; cnt++) { 395 for (cnt = 0; cnt < nr_pages; cnt++) {
397 vpage = hw_qpageit_get_inc(hw_queue); 396 vpage = hw_qpageit_get_inc(hw_queue);
398 if (!vpage) { 397 if (!vpage) {
399 pr_err("hw_qpageit_get_inc failed\n"); 398 ehea_error("hw_qpageit_get_inc failed");
400 goto out_kill_hwq; 399 goto out_kill_hwq;
401 } 400 }
402 rpage = virt_to_abs(vpage); 401 rpage = virt_to_abs(vpage);
@@ -404,7 +403,7 @@ int ehea_qp_alloc_register(struct ehea_qp *qp, struct hw_queue *hw_queue,
404 0, h_call_q_selector, 403 0, h_call_q_selector,
405 qp->fw_handle, rpage, 1); 404 qp->fw_handle, rpage, 1);
406 if (hret < H_SUCCESS) { 405 if (hret < H_SUCCESS) {
407 pr_err("register_rpage_qp failed\n"); 406 ehea_error("register_rpage_qp failed");
408 goto out_kill_hwq; 407 goto out_kill_hwq;
409 } 408 }
410 } 409 }
@@ -433,7 +432,7 @@ struct ehea_qp *ehea_create_qp(struct ehea_adapter *adapter,
433 432
434 qp = kzalloc(sizeof(*qp), GFP_KERNEL); 433 qp = kzalloc(sizeof(*qp), GFP_KERNEL);
435 if (!qp) { 434 if (!qp) {
436 pr_err("no mem for qp\n"); 435 ehea_error("no mem for qp");
437 return NULL; 436 return NULL;
438 } 437 }
439 438
@@ -442,7 +441,7 @@ struct ehea_qp *ehea_create_qp(struct ehea_adapter *adapter,
442 hret = ehea_h_alloc_resource_qp(adapter->handle, init_attr, pd, 441 hret = ehea_h_alloc_resource_qp(adapter->handle, init_attr, pd,
443 &qp->fw_handle, &qp->epas); 442 &qp->fw_handle, &qp->epas);
444 if (hret != H_SUCCESS) { 443 if (hret != H_SUCCESS) {
445 pr_err("ehea_h_alloc_resource_qp failed\n"); 444 ehea_error("ehea_h_alloc_resource_qp failed");
446 goto out_freemem; 445 goto out_freemem;
447 } 446 }
448 447
@@ -456,7 +455,7 @@ struct ehea_qp *ehea_create_qp(struct ehea_adapter *adapter,
456 init_attr->act_wqe_size_enc_sq, adapter, 455 init_attr->act_wqe_size_enc_sq, adapter,
457 0); 456 0);
458 if (ret) { 457 if (ret) {
459 pr_err("can't register for sq ret=%x\n", ret); 458 ehea_error("can't register for sq ret=%x", ret);
460 goto out_freeres; 459 goto out_freeres;
461 } 460 }
462 461
@@ -466,7 +465,7 @@ struct ehea_qp *ehea_create_qp(struct ehea_adapter *adapter,
466 init_attr->act_wqe_size_enc_rq1, 465 init_attr->act_wqe_size_enc_rq1,
467 adapter, 1); 466 adapter, 1);
468 if (ret) { 467 if (ret) {
469 pr_err("can't register for rq1 ret=%x\n", ret); 468 ehea_error("can't register for rq1 ret=%x", ret);
470 goto out_kill_hwsq; 469 goto out_kill_hwsq;
471 } 470 }
472 471
@@ -477,7 +476,7 @@ struct ehea_qp *ehea_create_qp(struct ehea_adapter *adapter,
477 init_attr->act_wqe_size_enc_rq2, 476 init_attr->act_wqe_size_enc_rq2,
478 adapter, 2); 477 adapter, 2);
479 if (ret) { 478 if (ret) {
480 pr_err("can't register for rq2 ret=%x\n", ret); 479 ehea_error("can't register for rq2 ret=%x", ret);
481 goto out_kill_hwr1q; 480 goto out_kill_hwr1q;
482 } 481 }
483 } 482 }
@@ -489,7 +488,7 @@ struct ehea_qp *ehea_create_qp(struct ehea_adapter *adapter,
489 init_attr->act_wqe_size_enc_rq3, 488 init_attr->act_wqe_size_enc_rq3,
490 adapter, 3); 489 adapter, 3);
491 if (ret) { 490 if (ret) {
492 pr_err("can't register for rq3 ret=%x\n", ret); 491 ehea_error("can't register for rq3 ret=%x", ret);
493 goto out_kill_hwr2q; 492 goto out_kill_hwr2q;
494 } 493 }
495 } 494 }
@@ -554,7 +553,7 @@ int ehea_destroy_qp(struct ehea_qp *qp)
554 } 553 }
555 554
556 if (hret != H_SUCCESS) { 555 if (hret != H_SUCCESS) {
557 pr_err("destroy QP failed\n"); 556 ehea_error("destroy QP failed");
558 return -EIO; 557 return -EIO;
559 } 558 }
560 559
@@ -843,7 +842,7 @@ static u64 ehea_reg_mr_section(int top, int dir, int idx, u64 *pt,
843 (hret != H_PAGE_REGISTERED)) { 842 (hret != H_PAGE_REGISTERED)) {
844 ehea_h_free_resource(adapter->handle, mr->handle, 843 ehea_h_free_resource(adapter->handle, mr->handle,
845 FORCE_FREE); 844 FORCE_FREE);
846 pr_err("register_rpage_mr failed\n"); 845 ehea_error("register_rpage_mr failed");
847 return hret; 846 return hret;
848 } 847 }
849 } 848 }
@@ -897,7 +896,7 @@ int ehea_reg_kernel_mr(struct ehea_adapter *adapter, struct ehea_mr *mr)
897 896
898 pt = (void *)get_zeroed_page(GFP_KERNEL); 897 pt = (void *)get_zeroed_page(GFP_KERNEL);
899 if (!pt) { 898 if (!pt) {
900 pr_err("no mem\n"); 899 ehea_error("no mem");
901 ret = -ENOMEM; 900 ret = -ENOMEM;
902 goto out; 901 goto out;
903 } 902 }
@@ -907,14 +906,14 @@ int ehea_reg_kernel_mr(struct ehea_adapter *adapter, struct ehea_mr *mr)
907 &mr->handle, &mr->lkey); 906 &mr->handle, &mr->lkey);
908 907
909 if (hret != H_SUCCESS) { 908 if (hret != H_SUCCESS) {
910 pr_err("alloc_resource_mr failed\n"); 909 ehea_error("alloc_resource_mr failed");
911 ret = -EIO; 910 ret = -EIO;
912 goto out; 911 goto out;
913 } 912 }
914 913
915 if (!ehea_bmap) { 914 if (!ehea_bmap) {
916 ehea_h_free_resource(adapter->handle, mr->handle, FORCE_FREE); 915 ehea_h_free_resource(adapter->handle, mr->handle, FORCE_FREE);
917 pr_err("no busmap available\n"); 916 ehea_error("no busmap available");
918 ret = -EIO; 917 ret = -EIO;
919 goto out; 918 goto out;
920 } 919 }
@@ -930,7 +929,7 @@ int ehea_reg_kernel_mr(struct ehea_adapter *adapter, struct ehea_mr *mr)
930 929
931 if (hret != H_SUCCESS) { 930 if (hret != H_SUCCESS) {
932 ehea_h_free_resource(adapter->handle, mr->handle, FORCE_FREE); 931 ehea_h_free_resource(adapter->handle, mr->handle, FORCE_FREE);
933 pr_err("registering mr failed\n"); 932 ehea_error("registering mr failed");
934 ret = -EIO; 933 ret = -EIO;
935 goto out; 934 goto out;
936 } 935 }
@@ -953,7 +952,7 @@ int ehea_rem_mr(struct ehea_mr *mr)
953 hret = ehea_h_free_resource(mr->adapter->handle, mr->handle, 952 hret = ehea_h_free_resource(mr->adapter->handle, mr->handle,
954 FORCE_FREE); 953 FORCE_FREE);
955 if (hret != H_SUCCESS) { 954 if (hret != H_SUCCESS) {
956 pr_err("destroy MR failed\n"); 955 ehea_error("destroy MR failed");
957 return -EIO; 956 return -EIO;
958 } 957 }
959 958
@@ -988,14 +987,14 @@ void print_error_data(u64 *data)
988 length = EHEA_PAGESIZE; 987 length = EHEA_PAGESIZE;
989 988
990 if (type == EHEA_AER_RESTYPE_QP) 989 if (type == EHEA_AER_RESTYPE_QP)
991 pr_err("QP (resource=%llX) state: AER=0x%llX, AERR=0x%llX, port=%llX\n", 990 ehea_error("QP (resource=%llX) state: AER=0x%llX, AERR=0x%llX, "
992 resource, data[6], data[12], data[22]); 991 "port=%llX", resource, data[6], data[12], data[22]);
993 else if (type == EHEA_AER_RESTYPE_CQ) 992 else if (type == EHEA_AER_RESTYPE_CQ)
994 pr_err("CQ (resource=%llX) state: AER=0x%llX\n", 993 ehea_error("CQ (resource=%llX) state: AER=0x%llX", resource,
995 resource, data[6]); 994 data[6]);
996 else if (type == EHEA_AER_RESTYPE_EQ) 995 else if (type == EHEA_AER_RESTYPE_EQ)
997 pr_err("EQ (resource=%llX) state: AER=0x%llX\n", 996 ehea_error("EQ (resource=%llX) state: AER=0x%llX", resource,
998 resource, data[6]); 997 data[6]);
999 998
1000 ehea_dump(data, length, "error data"); 999 ehea_dump(data, length, "error data");
1001} 1000}
@@ -1009,7 +1008,7 @@ u64 ehea_error_data(struct ehea_adapter *adapter, u64 res_handle,
1009 1008
1010 rblock = (void *)get_zeroed_page(GFP_KERNEL); 1009 rblock = (void *)get_zeroed_page(GFP_KERNEL);
1011 if (!rblock) { 1010 if (!rblock) {
1012 pr_err("Cannot allocate rblock memory\n"); 1011 ehea_error("Cannot allocate rblock memory.");
1013 goto out; 1012 goto out;
1014 } 1013 }
1015 1014
@@ -1021,9 +1020,9 @@ u64 ehea_error_data(struct ehea_adapter *adapter, u64 res_handle,
1021 *aerr = rblock[12]; 1020 *aerr = rblock[12];
1022 print_error_data(rblock); 1021 print_error_data(rblock);
1023 } else if (ret == H_R_STATE) { 1022 } else if (ret == H_R_STATE) {
1024 pr_err("No error data available: %llX\n", res_handle); 1023 ehea_error("No error data available: %llX.", res_handle);
1025 } else 1024 } else
1026 pr_err("Error data could not be fetched: %llX\n", res_handle); 1025 ehea_error("Error data could not be fetched: %llX", res_handle);
1027 1026
1028 free_page((unsigned long)rblock); 1027 free_page((unsigned long)rblock);
1029out: 1028out: