diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-07 20:08:02 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-07 20:08:02 -0400 |
commit | 3cc08fc35db75b059118626c30b60b0f56583802 (patch) | |
tree | 704d71199c8be8d5b822ca424675291e8cec7bde /drivers/infiniband/hw/ehca | |
parent | faa38b5e0e092914764cdba9f83d31a3f794d182 (diff) | |
parent | 03b37ecdb3975f09832747600853d3818a50eda3 (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband: (42 commits)
IB/qib: Add missing <linux/slab.h> include
IB/ehca: Drop unnecessary NULL test
RDMA/nes: Fix confusing if statement indentation
IB/ehca: Init irq tasklet before irq can happen
RDMA/nes: Fix misindented code
RDMA/nes: Fix showing wqm_quanta
RDMA/nes: Get rid of "set but not used" variables
RDMA/nes: Read firmware version from correct place
IB/srp: Export req_lim via sysfs
IB/srp: Make receive buffer handling more robust
IB/srp: Use print_hex_dump()
IB: Rename RAW_ETY to RAW_ETHERTYPE
RDMA/nes: Fix two sparse warnings
RDMA/cxgb3: Make needlessly global iwch_l2t_send() static
IB/iser: Make needlessly global iser_alloc_rx_descriptors() static
RDMA/cxgb4: Add timeouts when waiting for FW responses
IB/qib: Fix race between qib_error_qp() and receive packet processing
IB/qib: Limit the number of packets processed per interrupt
IB/qib: Allow writes to the diag_counters to be able to clear them
IB/qib: Set cfgctxts to number of CPUs by default
...
Diffstat (limited to 'drivers/infiniband/hw/ehca')
-rw-r--r-- | drivers/infiniband/hw/ehca/ehca_eq.c | 8 | ||||
-rw-r--r-- | drivers/infiniband/hw/ehca/ehca_main.c | 3 | ||||
-rw-r--r-- | drivers/infiniband/hw/ehca/ehca_mrmw.c | 5 | ||||
-rw-r--r-- | drivers/infiniband/hw/ehca/ehca_qp.c | 2 | ||||
-rw-r--r-- | drivers/infiniband/hw/ehca/hcp_if.c | 32 | ||||
-rw-r--r-- | drivers/infiniband/hw/ehca/hcp_phyp.c | 11 | ||||
-rw-r--r-- | drivers/infiniband/hw/ehca/hcp_phyp.h | 2 |
7 files changed, 41 insertions, 22 deletions
diff --git a/drivers/infiniband/hw/ehca/ehca_eq.c b/drivers/infiniband/hw/ehca/ehca_eq.c index 3b87589b8ea0..d9b1bb40f480 100644 --- a/drivers/infiniband/hw/ehca/ehca_eq.c +++ b/drivers/infiniband/hw/ehca/ehca_eq.c | |||
@@ -122,21 +122,21 @@ int ehca_create_eq(struct ehca_shca *shca, | |||
122 | 122 | ||
123 | /* register interrupt handlers and initialize work queues */ | 123 | /* register interrupt handlers and initialize work queues */ |
124 | if (type == EHCA_EQ) { | 124 | if (type == EHCA_EQ) { |
125 | tasklet_init(&eq->interrupt_task, ehca_tasklet_eq, (long)shca); | ||
126 | |||
125 | ret = ibmebus_request_irq(eq->ist, ehca_interrupt_eq, | 127 | ret = ibmebus_request_irq(eq->ist, ehca_interrupt_eq, |
126 | IRQF_DISABLED, "ehca_eq", | 128 | IRQF_DISABLED, "ehca_eq", |
127 | (void *)shca); | 129 | (void *)shca); |
128 | if (ret < 0) | 130 | if (ret < 0) |
129 | ehca_err(ib_dev, "Can't map interrupt handler."); | 131 | ehca_err(ib_dev, "Can't map interrupt handler."); |
130 | |||
131 | tasklet_init(&eq->interrupt_task, ehca_tasklet_eq, (long)shca); | ||
132 | } else if (type == EHCA_NEQ) { | 132 | } else if (type == EHCA_NEQ) { |
133 | tasklet_init(&eq->interrupt_task, ehca_tasklet_neq, (long)shca); | ||
134 | |||
133 | ret = ibmebus_request_irq(eq->ist, ehca_interrupt_neq, | 135 | ret = ibmebus_request_irq(eq->ist, ehca_interrupt_neq, |
134 | IRQF_DISABLED, "ehca_neq", | 136 | IRQF_DISABLED, "ehca_neq", |
135 | (void *)shca); | 137 | (void *)shca); |
136 | if (ret < 0) | 138 | if (ret < 0) |
137 | ehca_err(ib_dev, "Can't map interrupt handler."); | 139 | ehca_err(ib_dev, "Can't map interrupt handler."); |
138 | |||
139 | tasklet_init(&eq->interrupt_task, ehca_tasklet_neq, (long)shca); | ||
140 | } | 140 | } |
141 | 141 | ||
142 | eq->is_initialized = 1; | 142 | eq->is_initialized = 1; |
diff --git a/drivers/infiniband/hw/ehca/ehca_main.c b/drivers/infiniband/hw/ehca/ehca_main.c index ecb51b396c42..cfc4de7a5da4 100644 --- a/drivers/infiniband/hw/ehca/ehca_main.c +++ b/drivers/infiniband/hw/ehca/ehca_main.c | |||
@@ -360,7 +360,8 @@ static int ehca_sense_attributes(struct ehca_shca *shca) | |||
360 | * a firmware property, so it's valid across all adapters | 360 | * a firmware property, so it's valid across all adapters |
361 | */ | 361 | */ |
362 | if (ehca_lock_hcalls == -1) | 362 | if (ehca_lock_hcalls == -1) |
363 | ehca_lock_hcalls = !(shca->hca_cap & HCA_CAP_H_ALLOC_RES_SYNC); | 363 | ehca_lock_hcalls = !EHCA_BMASK_GET(HCA_CAP_H_ALLOC_RES_SYNC, |
364 | shca->hca_cap); | ||
364 | 365 | ||
365 | /* translate supported MR page sizes; always support 4K */ | 366 | /* translate supported MR page sizes; always support 4K */ |
366 | shca->hca_cap_mr_pgsize = EHCA_PAGESIZE; | 367 | shca->hca_cap_mr_pgsize = EHCA_PAGESIZE; |
diff --git a/drivers/infiniband/hw/ehca/ehca_mrmw.c b/drivers/infiniband/hw/ehca/ehca_mrmw.c index 31a68b9c52d0..53f4cd4fc19a 100644 --- a/drivers/infiniband/hw/ehca/ehca_mrmw.c +++ b/drivers/infiniband/hw/ehca/ehca_mrmw.c | |||
@@ -933,11 +933,6 @@ int ehca_unmap_fmr(struct list_head *fmr_list) | |||
933 | /* check all FMR belong to same SHCA, and check internal flag */ | 933 | /* check all FMR belong to same SHCA, and check internal flag */ |
934 | list_for_each_entry(ib_fmr, fmr_list, list) { | 934 | list_for_each_entry(ib_fmr, fmr_list, list) { |
935 | prev_shca = shca; | 935 | prev_shca = shca; |
936 | if (!ib_fmr) { | ||
937 | ehca_gen_err("bad fmr=%p in list", ib_fmr); | ||
938 | ret = -EINVAL; | ||
939 | goto unmap_fmr_exit0; | ||
940 | } | ||
941 | shca = container_of(ib_fmr->device, struct ehca_shca, | 936 | shca = container_of(ib_fmr->device, struct ehca_shca, |
942 | ib_device); | 937 | ib_device); |
943 | e_fmr = container_of(ib_fmr, struct ehca_mr, ib.ib_fmr); | 938 | e_fmr = container_of(ib_fmr, struct ehca_mr, ib.ib_fmr); |
diff --git a/drivers/infiniband/hw/ehca/ehca_qp.c b/drivers/infiniband/hw/ehca/ehca_qp.c index 47d388ec1cde..32fb34201aba 100644 --- a/drivers/infiniband/hw/ehca/ehca_qp.c +++ b/drivers/infiniband/hw/ehca/ehca_qp.c | |||
@@ -251,7 +251,7 @@ static inline int ibqptype2servicetype(enum ib_qp_type ibqptype) | |||
251 | return ST_UD; | 251 | return ST_UD; |
252 | case IB_QPT_RAW_IPV6: | 252 | case IB_QPT_RAW_IPV6: |
253 | return -EINVAL; | 253 | return -EINVAL; |
254 | case IB_QPT_RAW_ETY: | 254 | case IB_QPT_RAW_ETHERTYPE: |
255 | return -EINVAL; | 255 | return -EINVAL; |
256 | default: | 256 | default: |
257 | ehca_gen_err("Invalid ibqptype=%x", ibqptype); | 257 | ehca_gen_err("Invalid ibqptype=%x", ibqptype); |
diff --git a/drivers/infiniband/hw/ehca/hcp_if.c b/drivers/infiniband/hw/ehca/hcp_if.c index 4d5dc3304d42..e6f9cdd94c7a 100644 --- a/drivers/infiniband/hw/ehca/hcp_if.c +++ b/drivers/infiniband/hw/ehca/hcp_if.c | |||
@@ -269,6 +269,7 @@ u64 hipz_h_alloc_resource_cq(const struct ipz_adapter_handle adapter_handle, | |||
269 | struct ehca_cq *cq, | 269 | struct ehca_cq *cq, |
270 | struct ehca_alloc_cq_parms *param) | 270 | struct ehca_alloc_cq_parms *param) |
271 | { | 271 | { |
272 | int rc; | ||
272 | u64 ret; | 273 | u64 ret; |
273 | unsigned long outs[PLPAR_HCALL9_BUFSIZE]; | 274 | unsigned long outs[PLPAR_HCALL9_BUFSIZE]; |
274 | 275 | ||
@@ -283,8 +284,19 @@ u64 hipz_h_alloc_resource_cq(const struct ipz_adapter_handle adapter_handle, | |||
283 | param->act_nr_of_entries = (u32)outs[3]; | 284 | param->act_nr_of_entries = (u32)outs[3]; |
284 | param->act_pages = (u32)outs[4]; | 285 | param->act_pages = (u32)outs[4]; |
285 | 286 | ||
286 | if (ret == H_SUCCESS) | 287 | if (ret == H_SUCCESS) { |
287 | hcp_galpas_ctor(&cq->galpas, 0, outs[5], outs[6]); | 288 | rc = hcp_galpas_ctor(&cq->galpas, 0, outs[5], outs[6]); |
289 | if (rc) { | ||
290 | ehca_gen_err("Could not establish HW access. rc=%d paddr=%#lx", | ||
291 | rc, outs[5]); | ||
292 | |||
293 | ehca_plpar_hcall_norets(H_FREE_RESOURCE, | ||
294 | adapter_handle.handle, /* r4 */ | ||
295 | cq->ipz_cq_handle.handle, /* r5 */ | ||
296 | 0, 0, 0, 0, 0); | ||
297 | ret = H_NO_MEM; | ||
298 | } | ||
299 | } | ||
288 | 300 | ||
289 | if (ret == H_NOT_ENOUGH_RESOURCES) | 301 | if (ret == H_NOT_ENOUGH_RESOURCES) |
290 | ehca_gen_err("Not enough resources. ret=%lli", ret); | 302 | ehca_gen_err("Not enough resources. ret=%lli", ret); |
@@ -295,6 +307,7 @@ u64 hipz_h_alloc_resource_cq(const struct ipz_adapter_handle adapter_handle, | |||
295 | u64 hipz_h_alloc_resource_qp(const struct ipz_adapter_handle adapter_handle, | 307 | u64 hipz_h_alloc_resource_qp(const struct ipz_adapter_handle adapter_handle, |
296 | struct ehca_alloc_qp_parms *parms, int is_user) | 308 | struct ehca_alloc_qp_parms *parms, int is_user) |
297 | { | 309 | { |
310 | int rc; | ||
298 | u64 ret; | 311 | u64 ret; |
299 | u64 allocate_controls, max_r10_reg, r11, r12; | 312 | u64 allocate_controls, max_r10_reg, r11, r12; |
300 | unsigned long outs[PLPAR_HCALL9_BUFSIZE]; | 313 | unsigned long outs[PLPAR_HCALL9_BUFSIZE]; |
@@ -358,8 +371,19 @@ u64 hipz_h_alloc_resource_qp(const struct ipz_adapter_handle adapter_handle, | |||
358 | parms->rqueue.queue_size = | 371 | parms->rqueue.queue_size = |
359 | (u32)EHCA_BMASK_GET(H_ALL_RES_QP_RQUEUE_SIZE_PAGES, outs[4]); | 372 | (u32)EHCA_BMASK_GET(H_ALL_RES_QP_RQUEUE_SIZE_PAGES, outs[4]); |
360 | 373 | ||
361 | if (ret == H_SUCCESS) | 374 | if (ret == H_SUCCESS) { |
362 | hcp_galpas_ctor(&parms->galpas, is_user, outs[6], outs[6]); | 375 | rc = hcp_galpas_ctor(&parms->galpas, is_user, outs[6], outs[6]); |
376 | if (rc) { | ||
377 | ehca_gen_err("Could not establish HW access. rc=%d paddr=%#lx", | ||
378 | rc, outs[6]); | ||
379 | |||
380 | ehca_plpar_hcall_norets(H_FREE_RESOURCE, | ||
381 | adapter_handle.handle, /* r4 */ | ||
382 | parms->qp_handle.handle, /* r5 */ | ||
383 | 0, 0, 0, 0, 0); | ||
384 | ret = H_NO_MEM; | ||
385 | } | ||
386 | } | ||
363 | 387 | ||
364 | if (ret == H_NOT_ENOUGH_RESOURCES) | 388 | if (ret == H_NOT_ENOUGH_RESOURCES) |
365 | ehca_gen_err("Not enough resources. ret=%lli", ret); | 389 | ehca_gen_err("Not enough resources. ret=%lli", ret); |
diff --git a/drivers/infiniband/hw/ehca/hcp_phyp.c b/drivers/infiniband/hw/ehca/hcp_phyp.c index b3e0e72e8a73..077376ff3d28 100644 --- a/drivers/infiniband/hw/ehca/hcp_phyp.c +++ b/drivers/infiniband/hw/ehca/hcp_phyp.c | |||
@@ -42,10 +42,9 @@ | |||
42 | #include "ehca_classes.h" | 42 | #include "ehca_classes.h" |
43 | #include "hipz_hw.h" | 43 | #include "hipz_hw.h" |
44 | 44 | ||
45 | int hcall_map_page(u64 physaddr, u64 *mapaddr) | 45 | u64 hcall_map_page(u64 physaddr) |
46 | { | 46 | { |
47 | *mapaddr = (u64)(ioremap(physaddr, EHCA_PAGESIZE)); | 47 | return (u64)ioremap(physaddr, EHCA_PAGESIZE); |
48 | return 0; | ||
49 | } | 48 | } |
50 | 49 | ||
51 | int hcall_unmap_page(u64 mapaddr) | 50 | int hcall_unmap_page(u64 mapaddr) |
@@ -58,9 +57,9 @@ int hcp_galpas_ctor(struct h_galpas *galpas, int is_user, | |||
58 | u64 paddr_kernel, u64 paddr_user) | 57 | u64 paddr_kernel, u64 paddr_user) |
59 | { | 58 | { |
60 | if (!is_user) { | 59 | if (!is_user) { |
61 | int ret = hcall_map_page(paddr_kernel, &galpas->kernel.fw_handle); | 60 | galpas->kernel.fw_handle = hcall_map_page(paddr_kernel); |
62 | if (ret) | 61 | if (!galpas->kernel.fw_handle) |
63 | return ret; | 62 | return -ENOMEM; |
64 | } else | 63 | } else |
65 | galpas->kernel.fw_handle = 0; | 64 | galpas->kernel.fw_handle = 0; |
66 | 65 | ||
diff --git a/drivers/infiniband/hw/ehca/hcp_phyp.h b/drivers/infiniband/hw/ehca/hcp_phyp.h index 204227d5303a..d1b029910249 100644 --- a/drivers/infiniband/hw/ehca/hcp_phyp.h +++ b/drivers/infiniband/hw/ehca/hcp_phyp.h | |||
@@ -83,7 +83,7 @@ int hcp_galpas_ctor(struct h_galpas *galpas, int is_user, | |||
83 | 83 | ||
84 | int hcp_galpas_dtor(struct h_galpas *galpas); | 84 | int hcp_galpas_dtor(struct h_galpas *galpas); |
85 | 85 | ||
86 | int hcall_map_page(u64 physaddr, u64 * mapaddr); | 86 | u64 hcall_map_page(u64 physaddr); |
87 | 87 | ||
88 | int hcall_unmap_page(u64 mapaddr); | 88 | int hcall_unmap_page(u64 mapaddr); |
89 | 89 | ||