[ewg] [PATCH OFED-153] ehca: fixes
Alexander Schmidt
alexs at linux.vnet.ibm.com
Mon Jan 3 05:10:14 PST 2011
Hi Vlad,
please apply the following fixes + backport adjustments for OFED-1.5.3.
The changes are tested with ./ofed_scripts/ofed_makedist.sh
Signed-off-by: Alexander Schmidt <alexs at linux.vnet.ibm.com>
diff --git a/kernel_patches/backport/2.6.16_sles10_sp2/ehca-030-ibmebus_loc_code.patch b/kernel_patches/backport/2.6.16_sles10_sp2/ehca-030-ibmebus_loc_code.patch
index 23a7f1e..2fea541 100644
--- a/kernel_patches/backport/2.6.16_sles10_sp2/ehca-030-ibmebus_loc_code.patch
+++ b/kernel_patches/backport/2.6.16_sles10_sp2/ehca-030-ibmebus_loc_code.patch
@@ -4,10 +4,10 @@
drivers/infiniband/hw/ehca/ehca_main.c | 49 ++++++++++++++----------------
3 files changed, 27 insertions(+), 30 deletions(-)
-Index: ofa_kernel-1.5/drivers/infiniband/hw/ehca/ehca_classes.h
+Index: ofed_kernel-2.6.16_sles10_sp2/drivers/infiniband/hw/ehca/ehca_classes.h
===================================================================
---- ofa_kernel-1.5.orig/drivers/infiniband/hw/ehca/ehca_classes.h 2009-09-23 15:08:25.000000000 +0200
-+++ ofa_kernel-1.5/drivers/infiniband/hw/ehca/ehca_classes.h 2009-09-25 12:43:39.000000000 +0200
+--- ofed_kernel-2.6.16_sles10_sp2.orig/drivers/infiniband/hw/ehca/ehca_classes.h 2011-01-03 05:15:26.000000000 -0500
++++ ofed_kernel-2.6.16_sles10_sp2/drivers/infiniband/hw/ehca/ehca_classes.h 2011-01-03 05:20:26.000000000 -0500
@@ -112,7 +112,7 @@
struct ehca_shca {
@@ -17,41 +17,41 @@ Index: ofa_kernel-1.5/drivers/infiniband/hw/ehca/ehca_classes.h
u8 num_ports;
int hw_level;
struct list_head shca_list;
-Index: ofa_kernel-1.5/drivers/infiniband/hw/ehca/ehca_eq.c
+Index: ofed_kernel-2.6.16_sles10_sp2/drivers/infiniband/hw/ehca/ehca_eq.c
===================================================================
---- ofa_kernel-1.5.orig/drivers/infiniband/hw/ehca/ehca_eq.c 2009-09-23 15:08:25.000000000 +0200
-+++ ofa_kernel-1.5/drivers/infiniband/hw/ehca/ehca_eq.c 2009-09-25 12:43:39.000000000 +0200
-@@ -122,7 +122,7 @@
-
- /* register interrupt handlers and initialize work queues */
+--- ofed_kernel-2.6.16_sles10_sp2.orig/drivers/infiniband/hw/ehca/ehca_eq.c 2011-01-03 05:15:27.000000000 -0500
++++ ofed_kernel-2.6.16_sles10_sp2/drivers/infiniband/hw/ehca/ehca_eq.c 2011-01-03 05:21:46.000000000 -0500
+@@ -124,7 +124,7 @@
if (type == EHCA_EQ) {
+ tasklet_init(&eq->interrupt_task, ehca_tasklet_eq, (long)shca);
+
- ret = ibmebus_request_irq(eq->ist, ehca_interrupt_eq,
+ ret = ibmebus_request_irq(NULL, eq->ist, ehca_interrupt_eq,
IRQF_DISABLED, "ehca_eq",
(void *)shca);
if (ret < 0)
-@@ -130,7 +130,7 @@
-
- tasklet_init(&eq->interrupt_task, ehca_tasklet_eq, (long)shca);
+@@ -132,7 +132,7 @@
} else if (type == EHCA_NEQ) {
+ tasklet_init(&eq->interrupt_task, ehca_tasklet_neq, (long)shca);
+
- ret = ibmebus_request_irq(eq->ist, ehca_interrupt_neq,
+ ret = ibmebus_request_irq(NULL, eq->ist, ehca_interrupt_neq,
IRQF_DISABLED, "ehca_neq",
(void *)shca);
if (ret < 0)
-@@ -169,7 +169,7 @@ int ehca_destroy_eq(struct ehca_shca *sh
- unsigned long flags;
- u64 h_ret;
-
-- ibmebus_free_irq(eq->ist, (void *)shca);
-+ ibmebus_free_irq(NULL, eq->ist, (void *)shca);
-
- spin_lock_irqsave(&shca_list_lock, flags);
- eq->is_initialized = 0;
-Index: ofa_kernel-1.5/drivers/infiniband/hw/ehca/ehca_main.c
+@@ -169,7 +169,7 @@
+ unsigned long flags;
+ u64 h_ret;
+
+- ibmebus_free_irq(eq->ist, (void *)shca);
++ ibmebus_free_irq(NULL, eq->ist, (void *)shca);
+
+ spin_lock_irqsave(&shca_list_lock, flags);
+ eq->is_initialized = 0;
+Index: ofed_kernel-2.6.16_sles10_sp2/drivers/infiniband/hw/ehca/ehca_main.c
===================================================================
---- ofa_kernel-1.5.orig/drivers/infiniband/hw/ehca/ehca_main.c 2009-09-25 12:42:48.000000000 +0200
-+++ ofa_kernel-1.5/drivers/infiniband/hw/ehca/ehca_main.c 2009-09-25 12:45:40.000000000 +0200
+--- ofed_kernel-2.6.16_sles10_sp2.orig/drivers/infiniband/hw/ehca/ehca_main.c 2011-01-03 05:16:09.000000000 -0500
++++ ofed_kernel-2.6.16_sles10_sp2/drivers/infiniband/hw/ehca/ehca_main.c 2011-01-03 05:20:26.000000000 -0500
@@ -289,8 +289,8 @@
};
@@ -63,7 +63,7 @@ Index: ofa_kernel-1.5/drivers/infiniband/hw/ehca/ehca_main.c
if (loc_code)
ehca_gen_dbg(" ... location lode=%s", loc_code);
-@@ -459,7 +459,7 @@
+@@ -460,7 +460,7 @@
shca->ib_device.node_type = RDMA_NODE_IB_CA;
shca->ib_device.phys_port_cnt = shca->num_ports;
shca->ib_device.num_comp_vectors = 1;
@@ -72,7 +72,7 @@ Index: ofa_kernel-1.5/drivers/infiniband/hw/ehca/ehca_main.c
shca->ib_device.query_device = ehca_query_device;
shca->ib_device.query_port = ehca_query_port;
shca->ib_device.query_gid = ehca_query_gid;
-@@ -620,11 +620,6 @@
+@@ -621,11 +621,6 @@
.attrs = ehca_drv_attrs
};
@@ -84,7 +84,7 @@ Index: ofa_kernel-1.5/drivers/infiniband/hw/ehca/ehca_main.c
#define EHCA_RESOURCE_ATTR(name) \
static ssize_t ehca_show_##name(struct device *dev, \
struct device_attribute *attr, \
-@@ -708,7 +703,7 @@
+@@ -709,7 +704,7 @@
.attrs = ehca_dev_attrs
};
@@ -93,7 +93,7 @@ Index: ofa_kernel-1.5/drivers/infiniband/hw/ehca/ehca_main.c
const struct of_device_id *id)
{
struct ehca_shca *shca;
-@@ -717,16 +712,16 @@
+@@ -718,16 +713,16 @@
int ret, i, eq_size;
unsigned long flags;
@@ -113,7 +113,7 @@ Index: ofa_kernel-1.5/drivers/infiniband/hw/ehca/ehca_main.c
return -ENODEV;
}
-@@ -745,9 +740,9 @@
+@@ -746,9 +741,9 @@
for (i = 0; i < ARRAY_SIZE(shca->sport); i++)
spin_lock_init(&shca->sport[i].mod_sqp_lock);
@@ -125,7 +125,7 @@ Index: ofa_kernel-1.5/drivers/infiniband/hw/ehca/ehca_main.c
ret = ehca_sense_attributes(shca);
if (ret < 0) {
-@@ -824,7 +819,7 @@
+@@ -825,7 +820,7 @@
}
}
@@ -134,7 +134,7 @@ Index: ofa_kernel-1.5/drivers/infiniband/hw/ehca/ehca_main.c
if (ret) /* only complain; we can live without attributes */
ehca_err(&shca->ib_device,
"Cannot create device attributes ret=%d", ret);
-@@ -874,13 +869,13 @@
+@@ -875,13 +870,13 @@
return -EINVAL;
}
@@ -151,7 +151,7 @@ Index: ofa_kernel-1.5/drivers/infiniband/hw/ehca/ehca_main.c
if (ehca_open_aqp1 == 1) {
int i;
-@@ -932,14 +927,11 @@
+@@ -933,14 +928,11 @@
};
MODULE_DEVICE_TABLE(of, ehca_device_table);
@@ -171,7 +171,7 @@ Index: ofa_kernel-1.5/drivers/infiniband/hw/ehca/ehca_main.c
};
void ehca_poll_eqs(unsigned long data)
-@@ -998,6 +990,10 @@
+@@ -999,6 +991,10 @@
goto module_init2;
}
@@ -182,7 +182,7 @@ Index: ofa_kernel-1.5/drivers/infiniband/hw/ehca/ehca_main.c
if (ehca_poll_all_eqs != 1) {
ehca_gen_err("WARNING!!!");
ehca_gen_err("It is possible to lose interrupts.");
-@@ -1023,6 +1019,7 @@
+@@ -1024,6 +1020,7 @@
if (ehca_poll_all_eqs == 1)
del_timer_sync(&poll_eqs_timer);
diff --git a/kernel_patches/backport/2.6.16_sles10_sp3/ehca-030-ibmebus_loc_code.patch b/kernel_patches/backport/2.6.16_sles10_sp3/ehca-030-ibmebus_loc_code.patch
index cf9b5bb..dc3c9d9 100644
--- a/kernel_patches/backport/2.6.16_sles10_sp3/ehca-030-ibmebus_loc_code.patch
+++ b/kernel_patches/backport/2.6.16_sles10_sp3/ehca-030-ibmebus_loc_code.patch
@@ -4,10 +4,10 @@
drivers/infiniband/hw/ehca/ehca_main.c | 49 ++++++++++++++----------------
3 files changed, 27 insertions(+), 30 deletions(-)
-Index: ofa_kernel-1.5/drivers/infiniband/hw/ehca/ehca_classes.h
+Index: ofed_kernel-2.6.16_sles10_sp3/drivers/infiniband/hw/ehca/ehca_classes.h
===================================================================
---- ofa_kernel-1.5.orig/drivers/infiniband/hw/ehca/ehca_classes.h 2009-09-23 15:08:25.000000000 +0200
-+++ ofa_kernel-1.5/drivers/infiniband/hw/ehca/ehca_classes.h 2009-09-25 12:43:39.000000000 +0200
+--- ofed_kernel-2.6.16_sles10_sp3.orig/drivers/infiniband/hw/ehca/ehca_classes.h 2011-01-03 05:25:56.000000000 -0500
++++ ofed_kernel-2.6.16_sles10_sp3/drivers/infiniband/hw/ehca/ehca_classes.h 2011-01-03 05:29:34.000000000 -0500
@@ -112,7 +112,7 @@
struct ehca_shca {
@@ -17,41 +17,41 @@ Index: ofa_kernel-1.5/drivers/infiniband/hw/ehca/ehca_classes.h
u8 num_ports;
int hw_level;
struct list_head shca_list;
-Index: ofa_kernel-1.5/drivers/infiniband/hw/ehca/ehca_eq.c
+Index: ofed_kernel-2.6.16_sles10_sp3/drivers/infiniband/hw/ehca/ehca_eq.c
===================================================================
---- ofa_kernel-1.5.orig/drivers/infiniband/hw/ehca/ehca_eq.c 2009-09-23 15:08:25.000000000 +0200
-+++ ofa_kernel-1.5/drivers/infiniband/hw/ehca/ehca_eq.c 2009-09-25 12:43:39.000000000 +0200
-@@ -122,7 +122,7 @@
-
- /* register interrupt handlers and initialize work queues */
+--- ofed_kernel-2.6.16_sles10_sp3.orig/drivers/infiniband/hw/ehca/ehca_eq.c 2011-01-03 05:25:57.000000000 -0500
++++ ofed_kernel-2.6.16_sles10_sp3/drivers/infiniband/hw/ehca/ehca_eq.c 2011-01-03 05:30:39.000000000 -0500
+@@ -124,7 +124,7 @@
if (type == EHCA_EQ) {
+ tasklet_init(&eq->interrupt_task, ehca_tasklet_eq, (long)shca);
+
- ret = ibmebus_request_irq(eq->ist, ehca_interrupt_eq,
+ ret = ibmebus_request_irq(NULL, eq->ist, ehca_interrupt_eq,
IRQF_DISABLED, "ehca_eq",
(void *)shca);
if (ret < 0)
-@@ -130,7 +130,7 @@
-
- tasklet_init(&eq->interrupt_task, ehca_tasklet_eq, (long)shca);
+@@ -132,7 +132,7 @@
} else if (type == EHCA_NEQ) {
+ tasklet_init(&eq->interrupt_task, ehca_tasklet_neq, (long)shca);
+
- ret = ibmebus_request_irq(eq->ist, ehca_interrupt_neq,
+ ret = ibmebus_request_irq(NULL, eq->ist, ehca_interrupt_neq,
IRQF_DISABLED, "ehca_neq",
(void *)shca);
if (ret < 0)
@@ -169,7 +169,7 @@
- unsigned long flags;
- u64 h_ret;
+ unsigned long flags;
+ u64 h_ret;
-- ibmebus_free_irq(eq->ist, (void *)shca);
-+ ibmebus_free_irq(NULL, eq->ist, (void *)shca);
+- ibmebus_free_irq(eq->ist, (void *)shca);
++ ibmebus_free_irq(NULL, eq->ist, (void *)shca);
- spin_lock_irqsave(&shca_list_lock, flags);
- eq->is_initialized = 0;
-Index: ofa_kernel-1.5/drivers/infiniband/hw/ehca/ehca_main.c
+ spin_lock_irqsave(&shca_list_lock, flags);
+ eq->is_initialized = 0;
+Index: ofed_kernel-2.6.16_sles10_sp3/drivers/infiniband/hw/ehca/ehca_main.c
===================================================================
---- ofa_kernel-1.5.orig/drivers/infiniband/hw/ehca/ehca_main.c 2009-09-25 12:42:48.000000000 +0200
-+++ ofa_kernel-1.5/drivers/infiniband/hw/ehca/ehca_main.c 2009-09-25 12:45:40.000000000 +0200
+--- ofed_kernel-2.6.16_sles10_sp3.orig/drivers/infiniband/hw/ehca/ehca_main.c 2011-01-03 05:26:40.000000000 -0500
++++ ofed_kernel-2.6.16_sles10_sp3/drivers/infiniband/hw/ehca/ehca_main.c 2011-01-03 05:29:34.000000000 -0500
@@ -289,8 +289,8 @@
};
@@ -63,7 +63,7 @@ Index: ofa_kernel-1.5/drivers/infiniband/hw/ehca/ehca_main.c
if (loc_code)
ehca_gen_dbg(" ... location lode=%s", loc_code);
-@@ -459,7 +459,7 @@
+@@ -460,7 +460,7 @@
shca->ib_device.node_type = RDMA_NODE_IB_CA;
shca->ib_device.phys_port_cnt = shca->num_ports;
shca->ib_device.num_comp_vectors = 1;
@@ -72,7 +72,7 @@ Index: ofa_kernel-1.5/drivers/infiniband/hw/ehca/ehca_main.c
shca->ib_device.query_device = ehca_query_device;
shca->ib_device.query_port = ehca_query_port;
shca->ib_device.query_gid = ehca_query_gid;
-@@ -620,11 +620,6 @@
+@@ -621,11 +621,6 @@
.attrs = ehca_drv_attrs
};
@@ -84,7 +84,7 @@ Index: ofa_kernel-1.5/drivers/infiniband/hw/ehca/ehca_main.c
#define EHCA_RESOURCE_ATTR(name) \
static ssize_t ehca_show_##name(struct device *dev, \
struct device_attribute *attr, \
-@@ -708,7 +703,7 @@
+@@ -709,7 +704,7 @@
.attrs = ehca_dev_attrs
};
@@ -93,7 +93,7 @@ Index: ofa_kernel-1.5/drivers/infiniband/hw/ehca/ehca_main.c
const struct of_device_id *id)
{
struct ehca_shca *shca;
-@@ -717,16 +712,16 @@
+@@ -718,16 +713,16 @@
int ret, i, eq_size;
unsigned long flags;
@@ -113,7 +113,7 @@ Index: ofa_kernel-1.5/drivers/infiniband/hw/ehca/ehca_main.c
return -ENODEV;
}
-@@ -745,9 +740,9 @@
+@@ -746,9 +741,9 @@
for (i = 0; i < ARRAY_SIZE(shca->sport); i++)
spin_lock_init(&shca->sport[i].mod_sqp_lock);
@@ -125,7 +125,7 @@ Index: ofa_kernel-1.5/drivers/infiniband/hw/ehca/ehca_main.c
ret = ehca_sense_attributes(shca);
if (ret < 0) {
-@@ -824,7 +819,7 @@
+@@ -825,7 +820,7 @@
}
}
@@ -134,7 +134,7 @@ Index: ofa_kernel-1.5/drivers/infiniband/hw/ehca/ehca_main.c
if (ret) /* only complain; we can live without attributes */
ehca_err(&shca->ib_device,
"Cannot create device attributes ret=%d", ret);
-@@ -874,13 +869,13 @@
+@@ -875,13 +870,13 @@
return -EINVAL;
}
@@ -151,7 +151,7 @@ Index: ofa_kernel-1.5/drivers/infiniband/hw/ehca/ehca_main.c
if (ehca_open_aqp1 == 1) {
int i;
-@@ -932,14 +927,11 @@
+@@ -933,14 +928,11 @@
};
MODULE_DEVICE_TABLE(of, ehca_device_table);
@@ -171,7 +171,7 @@ Index: ofa_kernel-1.5/drivers/infiniband/hw/ehca/ehca_main.c
};
void ehca_poll_eqs(unsigned long data)
-@@ -998,6 +990,10 @@
+@@ -999,6 +991,10 @@
goto module_init2;
}
@@ -182,7 +182,7 @@ Index: ofa_kernel-1.5/drivers/infiniband/hw/ehca/ehca_main.c
if (ehca_poll_all_eqs != 1) {
ehca_gen_err("WARNING!!!");
ehca_gen_err("It is possible to lose interrupts.");
-@@ -1023,6 +1019,7 @@
+@@ -1024,6 +1020,7 @@
if (ehca_poll_all_eqs == 1)
del_timer_sync(&poll_eqs_timer);
diff --git a/kernel_patches/backport/2.6.18-EL5.3/ehca-030-ibmebus_loc_code.patch b/kernel_patches/backport/2.6.18-EL5.3/ehca-030-ibmebus_loc_code.patch
index cfc1595..8550a43 100644
--- a/kernel_patches/backport/2.6.18-EL5.3/ehca-030-ibmebus_loc_code.patch
+++ b/kernel_patches/backport/2.6.18-EL5.3/ehca-030-ibmebus_loc_code.patch
@@ -4,10 +4,10 @@
drivers/infiniband/hw/ehca/ehca_main.c | 49 ++++++++++++++----------------
3 files changed, 27 insertions(+), 30 deletions(-)
-Index: ofa_kernel-1.5/drivers/infiniband/hw/ehca/ehca_classes.h
+Index: ofed_kernel-2.6.18-EL5.3/drivers/infiniband/hw/ehca/ehca_classes.h
===================================================================
---- ofa_kernel-1.5.orig/drivers/infiniband/hw/ehca/ehca_classes.h 2009-09-23 15:08:25.000000000 +0200
-+++ ofa_kernel-1.5/drivers/infiniband/hw/ehca/ehca_classes.h 2009-09-25 12:43:39.000000000 +0200
+--- ofed_kernel-2.6.18-EL5.3.orig/drivers/infiniband/hw/ehca/ehca_classes.h 2011-01-03 07:04:10.000000000 -0500
++++ ofed_kernel-2.6.18-EL5.3/drivers/infiniband/hw/ehca/ehca_classes.h 2011-01-03 07:11:26.000000000 -0500
@@ -112,7 +112,7 @@
struct ehca_shca {
@@ -17,41 +17,41 @@ Index: ofa_kernel-1.5/drivers/infiniband/hw/ehca/ehca_classes.h
u8 num_ports;
int hw_level;
struct list_head shca_list;
-Index: ofa_kernel-1.5/drivers/infiniband/hw/ehca/ehca_eq.c
+Index: ofed_kernel-2.6.18-EL5.3/drivers/infiniband/hw/ehca/ehca_eq.c
===================================================================
---- ofa_kernel-1.5.orig/drivers/infiniband/hw/ehca/ehca_eq.c 2009-09-23 15:08:25.000000000 +0200
-+++ ofa_kernel-1.5/drivers/infiniband/hw/ehca/ehca_eq.c 2009-09-25 12:43:39.000000000 +0200
-@@ -122,7 +122,7 @@
-
- /* register interrupt handlers and initialize work queues */
+--- ofed_kernel-2.6.18-EL5.3.orig/drivers/infiniband/hw/ehca/ehca_eq.c 2011-01-03 07:04:11.000000000 -0500
++++ ofed_kernel-2.6.18-EL5.3/drivers/infiniband/hw/ehca/ehca_eq.c 2011-01-03 07:12:11.000000000 -0500
+@@ -124,7 +124,7 @@
if (type == EHCA_EQ) {
+ tasklet_init(&eq->interrupt_task, ehca_tasklet_eq, (long)shca);
+
- ret = ibmebus_request_irq(eq->ist, ehca_interrupt_eq,
+ ret = ibmebus_request_irq(NULL, eq->ist, ehca_interrupt_eq,
IRQF_DISABLED, "ehca_eq",
(void *)shca);
if (ret < 0)
-@@ -130,7 +130,7 @@
-
- tasklet_init(&eq->interrupt_task, ehca_tasklet_eq, (long)shca);
+@@ -132,7 +132,7 @@
} else if (type == EHCA_NEQ) {
+ tasklet_init(&eq->interrupt_task, ehca_tasklet_neq, (long)shca);
+
- ret = ibmebus_request_irq(eq->ist, ehca_interrupt_neq,
+ ret = ibmebus_request_irq(NULL, eq->ist, ehca_interrupt_neq,
IRQF_DISABLED, "ehca_neq",
(void *)shca);
if (ret < 0)
@@ -169,7 +169,7 @@
- unsigned long flags;
- u64 h_ret;
-
-- ibmebus_free_irq(eq->ist, (void *)shca);
-+ ibmebus_free_irq(NULL, eq->ist, (void *)shca);
-
- spin_lock_irqsave(&shca_list_lock, flags);
- eq->is_initialized = 0;
-Index: ofa_kernel-1.5/drivers/infiniband/hw/ehca/ehca_main.c
+ unsigned long flags;
+ u64 h_ret;
+
+- ibmebus_free_irq(eq->ist, (void *)shca);
++ ibmebus_free_irq(NULL, eq->ist, (void *)shca);
+
+ spin_lock_irqsave(&shca_list_lock, flags);
+ eq->is_initialized = 0;
+Index: ofed_kernel-2.6.18-EL5.3/drivers/infiniband/hw/ehca/ehca_main.c
===================================================================
---- ofa_kernel-1.5.orig/drivers/infiniband/hw/ehca/ehca_main.c 2009-09-25 12:42:48.000000000 +0200
-+++ ofa_kernel-1.5/drivers/infiniband/hw/ehca/ehca_main.c 2009-09-25 12:45:40.000000000 +0200
+--- ofed_kernel-2.6.18-EL5.3.orig/drivers/infiniband/hw/ehca/ehca_main.c 2011-01-03 07:04:54.000000000 -0500
++++ ofed_kernel-2.6.18-EL5.3/drivers/infiniband/hw/ehca/ehca_main.c 2011-01-03 07:11:26.000000000 -0500
@@ -289,8 +289,8 @@
};
@@ -63,7 +63,7 @@ Index: ofa_kernel-1.5/drivers/infiniband/hw/ehca/ehca_main.c
if (loc_code)
ehca_gen_dbg(" ... location lode=%s", loc_code);
-@@ -459,7 +459,7 @@
+@@ -460,7 +460,7 @@
shca->ib_device.node_type = RDMA_NODE_IB_CA;
shca->ib_device.phys_port_cnt = shca->num_ports;
shca->ib_device.num_comp_vectors = 1;
@@ -72,7 +72,7 @@ Index: ofa_kernel-1.5/drivers/infiniband/hw/ehca/ehca_main.c
shca->ib_device.query_device = ehca_query_device;
shca->ib_device.query_port = ehca_query_port;
shca->ib_device.query_gid = ehca_query_gid;
-@@ -620,11 +620,6 @@
+@@ -621,11 +621,6 @@
.attrs = ehca_drv_attrs
};
@@ -84,7 +84,7 @@ Index: ofa_kernel-1.5/drivers/infiniband/hw/ehca/ehca_main.c
#define EHCA_RESOURCE_ATTR(name) \
static ssize_t ehca_show_##name(struct device *dev, \
struct device_attribute *attr, \
-@@ -708,7 +703,7 @@
+@@ -709,7 +704,7 @@
.attrs = ehca_dev_attrs
};
@@ -93,7 +93,7 @@ Index: ofa_kernel-1.5/drivers/infiniband/hw/ehca/ehca_main.c
const struct of_device_id *id)
{
struct ehca_shca *shca;
-@@ -717,16 +712,16 @@
+@@ -718,16 +713,16 @@
int ret, i, eq_size;
unsigned long flags;
@@ -113,7 +113,7 @@ Index: ofa_kernel-1.5/drivers/infiniband/hw/ehca/ehca_main.c
return -ENODEV;
}
-@@ -745,9 +740,9 @@
+@@ -746,9 +741,9 @@
for (i = 0; i < ARRAY_SIZE(shca->sport); i++)
spin_lock_init(&shca->sport[i].mod_sqp_lock);
@@ -125,7 +125,7 @@ Index: ofa_kernel-1.5/drivers/infiniband/hw/ehca/ehca_main.c
ret = ehca_sense_attributes(shca);
if (ret < 0) {
-@@ -824,7 +819,7 @@
+@@ -825,7 +820,7 @@
}
}
@@ -134,7 +134,7 @@ Index: ofa_kernel-1.5/drivers/infiniband/hw/ehca/ehca_main.c
if (ret) /* only complain; we can live without attributes */
ehca_err(&shca->ib_device,
"Cannot create device attributes ret=%d", ret);
-@@ -874,13 +869,13 @@
+@@ -875,13 +870,13 @@
return -EINVAL;
}
@@ -151,7 +151,7 @@ Index: ofa_kernel-1.5/drivers/infiniband/hw/ehca/ehca_main.c
if (ehca_open_aqp1 == 1) {
int i;
-@@ -932,14 +927,11 @@
+@@ -933,14 +928,11 @@
};
MODULE_DEVICE_TABLE(of, ehca_device_table);
@@ -171,7 +171,7 @@ Index: ofa_kernel-1.5/drivers/infiniband/hw/ehca/ehca_main.c
};
void ehca_poll_eqs(unsigned long data)
-@@ -998,6 +990,10 @@
+@@ -999,6 +991,10 @@
goto module_init2;
}
@@ -182,7 +182,7 @@ Index: ofa_kernel-1.5/drivers/infiniband/hw/ehca/ehca_main.c
if (ehca_poll_all_eqs != 1) {
ehca_gen_err("WARNING!!!");
ehca_gen_err("It is possible to lose interrupts.");
-@@ -1023,6 +1019,7 @@
+@@ -1024,6 +1020,7 @@
if (ehca_poll_all_eqs == 1)
del_timer_sync(&poll_eqs_timer);
diff --git a/kernel_patches/backport/2.6.18-EL5.4/ehca-030-ibmebus_loc_code.patch b/kernel_patches/backport/2.6.18-EL5.4/ehca-030-ibmebus_loc_code.patch
index cfc1595..8550a43 100644
--- a/kernel_patches/backport/2.6.18-EL5.4/ehca-030-ibmebus_loc_code.patch
+++ b/kernel_patches/backport/2.6.18-EL5.4/ehca-030-ibmebus_loc_code.patch
@@ -4,10 +4,10 @@
drivers/infiniband/hw/ehca/ehca_main.c | 49 ++++++++++++++----------------
3 files changed, 27 insertions(+), 30 deletions(-)
-Index: ofa_kernel-1.5/drivers/infiniband/hw/ehca/ehca_classes.h
+Index: ofed_kernel-2.6.18-EL5.3/drivers/infiniband/hw/ehca/ehca_classes.h
===================================================================
---- ofa_kernel-1.5.orig/drivers/infiniband/hw/ehca/ehca_classes.h 2009-09-23 15:08:25.000000000 +0200
-+++ ofa_kernel-1.5/drivers/infiniband/hw/ehca/ehca_classes.h 2009-09-25 12:43:39.000000000 +0200
+--- ofed_kernel-2.6.18-EL5.3.orig/drivers/infiniband/hw/ehca/ehca_classes.h 2011-01-03 07:04:10.000000000 -0500
++++ ofed_kernel-2.6.18-EL5.3/drivers/infiniband/hw/ehca/ehca_classes.h 2011-01-03 07:11:26.000000000 -0500
@@ -112,7 +112,7 @@
struct ehca_shca {
@@ -17,41 +17,41 @@ Index: ofa_kernel-1.5/drivers/infiniband/hw/ehca/ehca_classes.h
u8 num_ports;
int hw_level;
struct list_head shca_list;
-Index: ofa_kernel-1.5/drivers/infiniband/hw/ehca/ehca_eq.c
+Index: ofed_kernel-2.6.18-EL5.3/drivers/infiniband/hw/ehca/ehca_eq.c
===================================================================
---- ofa_kernel-1.5.orig/drivers/infiniband/hw/ehca/ehca_eq.c 2009-09-23 15:08:25.000000000 +0200
-+++ ofa_kernel-1.5/drivers/infiniband/hw/ehca/ehca_eq.c 2009-09-25 12:43:39.000000000 +0200
-@@ -122,7 +122,7 @@
-
- /* register interrupt handlers and initialize work queues */
+--- ofed_kernel-2.6.18-EL5.3.orig/drivers/infiniband/hw/ehca/ehca_eq.c 2011-01-03 07:04:11.000000000 -0500
++++ ofed_kernel-2.6.18-EL5.3/drivers/infiniband/hw/ehca/ehca_eq.c 2011-01-03 07:12:11.000000000 -0500
+@@ -124,7 +124,7 @@
if (type == EHCA_EQ) {
+ tasklet_init(&eq->interrupt_task, ehca_tasklet_eq, (long)shca);
+
- ret = ibmebus_request_irq(eq->ist, ehca_interrupt_eq,
+ ret = ibmebus_request_irq(NULL, eq->ist, ehca_interrupt_eq,
IRQF_DISABLED, "ehca_eq",
(void *)shca);
if (ret < 0)
-@@ -130,7 +130,7 @@
-
- tasklet_init(&eq->interrupt_task, ehca_tasklet_eq, (long)shca);
+@@ -132,7 +132,7 @@
} else if (type == EHCA_NEQ) {
+ tasklet_init(&eq->interrupt_task, ehca_tasklet_neq, (long)shca);
+
- ret = ibmebus_request_irq(eq->ist, ehca_interrupt_neq,
+ ret = ibmebus_request_irq(NULL, eq->ist, ehca_interrupt_neq,
IRQF_DISABLED, "ehca_neq",
(void *)shca);
if (ret < 0)
@@ -169,7 +169,7 @@
- unsigned long flags;
- u64 h_ret;
-
-- ibmebus_free_irq(eq->ist, (void *)shca);
-+ ibmebus_free_irq(NULL, eq->ist, (void *)shca);
-
- spin_lock_irqsave(&shca_list_lock, flags);
- eq->is_initialized = 0;
-Index: ofa_kernel-1.5/drivers/infiniband/hw/ehca/ehca_main.c
+ unsigned long flags;
+ u64 h_ret;
+
+- ibmebus_free_irq(eq->ist, (void *)shca);
++ ibmebus_free_irq(NULL, eq->ist, (void *)shca);
+
+ spin_lock_irqsave(&shca_list_lock, flags);
+ eq->is_initialized = 0;
+Index: ofed_kernel-2.6.18-EL5.3/drivers/infiniband/hw/ehca/ehca_main.c
===================================================================
---- ofa_kernel-1.5.orig/drivers/infiniband/hw/ehca/ehca_main.c 2009-09-25 12:42:48.000000000 +0200
-+++ ofa_kernel-1.5/drivers/infiniband/hw/ehca/ehca_main.c 2009-09-25 12:45:40.000000000 +0200
+--- ofed_kernel-2.6.18-EL5.3.orig/drivers/infiniband/hw/ehca/ehca_main.c 2011-01-03 07:04:54.000000000 -0500
++++ ofed_kernel-2.6.18-EL5.3/drivers/infiniband/hw/ehca/ehca_main.c 2011-01-03 07:11:26.000000000 -0500
@@ -289,8 +289,8 @@
};
@@ -63,7 +63,7 @@ Index: ofa_kernel-1.5/drivers/infiniband/hw/ehca/ehca_main.c
if (loc_code)
ehca_gen_dbg(" ... location lode=%s", loc_code);
-@@ -459,7 +459,7 @@
+@@ -460,7 +460,7 @@
shca->ib_device.node_type = RDMA_NODE_IB_CA;
shca->ib_device.phys_port_cnt = shca->num_ports;
shca->ib_device.num_comp_vectors = 1;
@@ -72,7 +72,7 @@ Index: ofa_kernel-1.5/drivers/infiniband/hw/ehca/ehca_main.c
shca->ib_device.query_device = ehca_query_device;
shca->ib_device.query_port = ehca_query_port;
shca->ib_device.query_gid = ehca_query_gid;
-@@ -620,11 +620,6 @@
+@@ -621,11 +621,6 @@
.attrs = ehca_drv_attrs
};
@@ -84,7 +84,7 @@ Index: ofa_kernel-1.5/drivers/infiniband/hw/ehca/ehca_main.c
#define EHCA_RESOURCE_ATTR(name) \
static ssize_t ehca_show_##name(struct device *dev, \
struct device_attribute *attr, \
-@@ -708,7 +703,7 @@
+@@ -709,7 +704,7 @@
.attrs = ehca_dev_attrs
};
@@ -93,7 +93,7 @@ Index: ofa_kernel-1.5/drivers/infiniband/hw/ehca/ehca_main.c
const struct of_device_id *id)
{
struct ehca_shca *shca;
-@@ -717,16 +712,16 @@
+@@ -718,16 +713,16 @@
int ret, i, eq_size;
unsigned long flags;
@@ -113,7 +113,7 @@ Index: ofa_kernel-1.5/drivers/infiniband/hw/ehca/ehca_main.c
return -ENODEV;
}
-@@ -745,9 +740,9 @@
+@@ -746,9 +741,9 @@
for (i = 0; i < ARRAY_SIZE(shca->sport); i++)
spin_lock_init(&shca->sport[i].mod_sqp_lock);
@@ -125,7 +125,7 @@ Index: ofa_kernel-1.5/drivers/infiniband/hw/ehca/ehca_main.c
ret = ehca_sense_attributes(shca);
if (ret < 0) {
-@@ -824,7 +819,7 @@
+@@ -825,7 +820,7 @@
}
}
@@ -134,7 +134,7 @@ Index: ofa_kernel-1.5/drivers/infiniband/hw/ehca/ehca_main.c
if (ret) /* only complain; we can live without attributes */
ehca_err(&shca->ib_device,
"Cannot create device attributes ret=%d", ret);
-@@ -874,13 +869,13 @@
+@@ -875,13 +870,13 @@
return -EINVAL;
}
@@ -151,7 +151,7 @@ Index: ofa_kernel-1.5/drivers/infiniband/hw/ehca/ehca_main.c
if (ehca_open_aqp1 == 1) {
int i;
-@@ -932,14 +927,11 @@
+@@ -933,14 +928,11 @@
};
MODULE_DEVICE_TABLE(of, ehca_device_table);
@@ -171,7 +171,7 @@ Index: ofa_kernel-1.5/drivers/infiniband/hw/ehca/ehca_main.c
};
void ehca_poll_eqs(unsigned long data)
-@@ -998,6 +990,10 @@
+@@ -999,6 +991,10 @@
goto module_init2;
}
@@ -182,7 +182,7 @@ Index: ofa_kernel-1.5/drivers/infiniband/hw/ehca/ehca_main.c
if (ehca_poll_all_eqs != 1) {
ehca_gen_err("WARNING!!!");
ehca_gen_err("It is possible to lose interrupts.");
-@@ -1023,6 +1019,7 @@
+@@ -1024,6 +1020,7 @@
if (ehca_poll_all_eqs == 1)
del_timer_sync(&poll_eqs_timer);
diff --git a/kernel_patches/backport/2.6.18-EL5.5/ehca-030-ibmebus_loc_code.patch b/kernel_patches/backport/2.6.18-EL5.5/ehca-030-ibmebus_loc_code.patch
index cfc1595..8550a43 100644
--- a/kernel_patches/backport/2.6.18-EL5.5/ehca-030-ibmebus_loc_code.patch
+++ b/kernel_patches/backport/2.6.18-EL5.5/ehca-030-ibmebus_loc_code.patch
@@ -4,10 +4,10 @@
drivers/infiniband/hw/ehca/ehca_main.c | 49 ++++++++++++++----------------
3 files changed, 27 insertions(+), 30 deletions(-)
-Index: ofa_kernel-1.5/drivers/infiniband/hw/ehca/ehca_classes.h
+Index: ofed_kernel-2.6.18-EL5.3/drivers/infiniband/hw/ehca/ehca_classes.h
===================================================================
---- ofa_kernel-1.5.orig/drivers/infiniband/hw/ehca/ehca_classes.h 2009-09-23 15:08:25.000000000 +0200
-+++ ofa_kernel-1.5/drivers/infiniband/hw/ehca/ehca_classes.h 2009-09-25 12:43:39.000000000 +0200
+--- ofed_kernel-2.6.18-EL5.3.orig/drivers/infiniband/hw/ehca/ehca_classes.h 2011-01-03 07:04:10.000000000 -0500
++++ ofed_kernel-2.6.18-EL5.3/drivers/infiniband/hw/ehca/ehca_classes.h 2011-01-03 07:11:26.000000000 -0500
@@ -112,7 +112,7 @@
struct ehca_shca {
@@ -17,41 +17,41 @@ Index: ofa_kernel-1.5/drivers/infiniband/hw/ehca/ehca_classes.h
u8 num_ports;
int hw_level;
struct list_head shca_list;
-Index: ofa_kernel-1.5/drivers/infiniband/hw/ehca/ehca_eq.c
+Index: ofed_kernel-2.6.18-EL5.3/drivers/infiniband/hw/ehca/ehca_eq.c
===================================================================
---- ofa_kernel-1.5.orig/drivers/infiniband/hw/ehca/ehca_eq.c 2009-09-23 15:08:25.000000000 +0200
-+++ ofa_kernel-1.5/drivers/infiniband/hw/ehca/ehca_eq.c 2009-09-25 12:43:39.000000000 +0200
-@@ -122,7 +122,7 @@
-
- /* register interrupt handlers and initialize work queues */
+--- ofed_kernel-2.6.18-EL5.3.orig/drivers/infiniband/hw/ehca/ehca_eq.c 2011-01-03 07:04:11.000000000 -0500
++++ ofed_kernel-2.6.18-EL5.3/drivers/infiniband/hw/ehca/ehca_eq.c 2011-01-03 07:12:11.000000000 -0500
+@@ -124,7 +124,7 @@
if (type == EHCA_EQ) {
+ tasklet_init(&eq->interrupt_task, ehca_tasklet_eq, (long)shca);
+
- ret = ibmebus_request_irq(eq->ist, ehca_interrupt_eq,
+ ret = ibmebus_request_irq(NULL, eq->ist, ehca_interrupt_eq,
IRQF_DISABLED, "ehca_eq",
(void *)shca);
if (ret < 0)
-@@ -130,7 +130,7 @@
-
- tasklet_init(&eq->interrupt_task, ehca_tasklet_eq, (long)shca);
+@@ -132,7 +132,7 @@
} else if (type == EHCA_NEQ) {
+ tasklet_init(&eq->interrupt_task, ehca_tasklet_neq, (long)shca);
+
- ret = ibmebus_request_irq(eq->ist, ehca_interrupt_neq,
+ ret = ibmebus_request_irq(NULL, eq->ist, ehca_interrupt_neq,
IRQF_DISABLED, "ehca_neq",
(void *)shca);
if (ret < 0)
@@ -169,7 +169,7 @@
- unsigned long flags;
- u64 h_ret;
-
-- ibmebus_free_irq(eq->ist, (void *)shca);
-+ ibmebus_free_irq(NULL, eq->ist, (void *)shca);
-
- spin_lock_irqsave(&shca_list_lock, flags);
- eq->is_initialized = 0;
-Index: ofa_kernel-1.5/drivers/infiniband/hw/ehca/ehca_main.c
+ unsigned long flags;
+ u64 h_ret;
+
+- ibmebus_free_irq(eq->ist, (void *)shca);
++ ibmebus_free_irq(NULL, eq->ist, (void *)shca);
+
+ spin_lock_irqsave(&shca_list_lock, flags);
+ eq->is_initialized = 0;
+Index: ofed_kernel-2.6.18-EL5.3/drivers/infiniband/hw/ehca/ehca_main.c
===================================================================
---- ofa_kernel-1.5.orig/drivers/infiniband/hw/ehca/ehca_main.c 2009-09-25 12:42:48.000000000 +0200
-+++ ofa_kernel-1.5/drivers/infiniband/hw/ehca/ehca_main.c 2009-09-25 12:45:40.000000000 +0200
+--- ofed_kernel-2.6.18-EL5.3.orig/drivers/infiniband/hw/ehca/ehca_main.c 2011-01-03 07:04:54.000000000 -0500
++++ ofed_kernel-2.6.18-EL5.3/drivers/infiniband/hw/ehca/ehca_main.c 2011-01-03 07:11:26.000000000 -0500
@@ -289,8 +289,8 @@
};
@@ -63,7 +63,7 @@ Index: ofa_kernel-1.5/drivers/infiniband/hw/ehca/ehca_main.c
if (loc_code)
ehca_gen_dbg(" ... location lode=%s", loc_code);
-@@ -459,7 +459,7 @@
+@@ -460,7 +460,7 @@
shca->ib_device.node_type = RDMA_NODE_IB_CA;
shca->ib_device.phys_port_cnt = shca->num_ports;
shca->ib_device.num_comp_vectors = 1;
@@ -72,7 +72,7 @@ Index: ofa_kernel-1.5/drivers/infiniband/hw/ehca/ehca_main.c
shca->ib_device.query_device = ehca_query_device;
shca->ib_device.query_port = ehca_query_port;
shca->ib_device.query_gid = ehca_query_gid;
-@@ -620,11 +620,6 @@
+@@ -621,11 +621,6 @@
.attrs = ehca_drv_attrs
};
@@ -84,7 +84,7 @@ Index: ofa_kernel-1.5/drivers/infiniband/hw/ehca/ehca_main.c
#define EHCA_RESOURCE_ATTR(name) \
static ssize_t ehca_show_##name(struct device *dev, \
struct device_attribute *attr, \
-@@ -708,7 +703,7 @@
+@@ -709,7 +704,7 @@
.attrs = ehca_dev_attrs
};
@@ -93,7 +93,7 @@ Index: ofa_kernel-1.5/drivers/infiniband/hw/ehca/ehca_main.c
const struct of_device_id *id)
{
struct ehca_shca *shca;
-@@ -717,16 +712,16 @@
+@@ -718,16 +713,16 @@
int ret, i, eq_size;
unsigned long flags;
@@ -113,7 +113,7 @@ Index: ofa_kernel-1.5/drivers/infiniband/hw/ehca/ehca_main.c
return -ENODEV;
}
-@@ -745,9 +740,9 @@
+@@ -746,9 +741,9 @@
for (i = 0; i < ARRAY_SIZE(shca->sport); i++)
spin_lock_init(&shca->sport[i].mod_sqp_lock);
@@ -125,7 +125,7 @@ Index: ofa_kernel-1.5/drivers/infiniband/hw/ehca/ehca_main.c
ret = ehca_sense_attributes(shca);
if (ret < 0) {
-@@ -824,7 +819,7 @@
+@@ -825,7 +820,7 @@
}
}
@@ -134,7 +134,7 @@ Index: ofa_kernel-1.5/drivers/infiniband/hw/ehca/ehca_main.c
if (ret) /* only complain; we can live without attributes */
ehca_err(&shca->ib_device,
"Cannot create device attributes ret=%d", ret);
-@@ -874,13 +869,13 @@
+@@ -875,13 +870,13 @@
return -EINVAL;
}
@@ -151,7 +151,7 @@ Index: ofa_kernel-1.5/drivers/infiniband/hw/ehca/ehca_main.c
if (ehca_open_aqp1 == 1) {
int i;
-@@ -932,14 +927,11 @@
+@@ -933,14 +928,11 @@
};
MODULE_DEVICE_TABLE(of, ehca_device_table);
@@ -171,7 +171,7 @@ Index: ofa_kernel-1.5/drivers/infiniband/hw/ehca/ehca_main.c
};
void ehca_poll_eqs(unsigned long data)
-@@ -998,6 +990,10 @@
+@@ -999,6 +991,10 @@
goto module_init2;
}
@@ -182,7 +182,7 @@ Index: ofa_kernel-1.5/drivers/infiniband/hw/ehca/ehca_main.c
if (ehca_poll_all_eqs != 1) {
ehca_gen_err("WARNING!!!");
ehca_gen_err("It is possible to lose interrupts.");
-@@ -1023,6 +1019,7 @@
+@@ -1024,6 +1020,7 @@
if (ehca_poll_all_eqs == 1)
del_timer_sync(&poll_eqs_timer);
diff --git a/kernel_patches/fixes/ehca-0160-init_tasklet.patch b/kernel_patches/fixes/ehca-0160-init_tasklet.patch
new file mode 100644
index 0000000..773c5bc
--- /dev/null
+++ b/kernel_patches/fixes/ehca-0160-init_tasklet.patch
@@ -0,0 +1,42 @@
+commit bd5d0ccbef9f2565e76dba4ff291da6a2cb8b1b4
+Author: Alexander Schmidt <alexs at linux.vnet.ibm.com>
+Date: Mon Jul 5 11:41:56 2010 +0000
+
+ IB/ehca: Init irq tasklet before irq can happen
+
+ Initialize tasklet before interrupts are requested to prevent
+ scheduling of an uninitialized tasklet.
+
+ Signed-off-by: Alexander Schmidt <alexs at linux.vnet.ibm.com>
+ Signed-off-by: Roland Dreier <rolandd at cisco.com>
+
+diff --git a/drivers/infiniband/hw/ehca/ehca_eq.c b/drivers/infiniband/hw/ehca/ehca_eq.c
+index 3b87589..d9b1bb4 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,
+
+ /* register interrupt handlers and initialize work queues */
+ if (type == EHCA_EQ) {
++ tasklet_init(&eq->interrupt_task, ehca_tasklet_eq, (long)shca);
++
+ ret = ibmebus_request_irq(eq->ist, ehca_interrupt_eq,
+ IRQF_DISABLED, "ehca_eq",
+ (void *)shca);
+ if (ret < 0)
+ ehca_err(ib_dev, "Can't map interrupt handler.");
+-
+- tasklet_init(&eq->interrupt_task, ehca_tasklet_eq, (long)shca);
+ } else if (type == EHCA_NEQ) {
++ tasklet_init(&eq->interrupt_task, ehca_tasklet_neq, (long)shca);
++
+ ret = ibmebus_request_irq(eq->ist, ehca_interrupt_neq,
+ IRQF_DISABLED, "ehca_neq",
+ (void *)shca);
+ if (ret < 0)
+ ehca_err(ib_dev, "Can't map interrupt handler.");
+-
+- tasklet_init(&eq->interrupt_task, ehca_tasklet_neq, (long)shca);
+ }
+
+ eq->is_initialized = 1;
diff --git a/kernel_patches/fixes/ehca-0170-catch_failing_ioremap.patch b/kernel_patches/fixes/ehca-0170-catch_failing_ioremap.patch
new file mode 100644
index 0000000..d46f723
--- /dev/null
+++ b/kernel_patches/fixes/ehca-0170-catch_failing_ioremap.patch
@@ -0,0 +1,120 @@
+commit e675b6db1245649f91bb1bfb10baef9af6d3f8e6
+Author: Alexander Schmidt <alexs at linux.vnet.ibm.com>
+Date: Mon Jul 5 16:19:25 2010 +0000
+
+ IB/ehca: Catch failing ioremap()
+
+ When ioremap() fails with a NULL pointer, catch the error and pass it
+ to the caller of create_qp() or create_cq() instead of trying to
+ dereference the NULL pointer later on.
+
+ Signed-off-by: Alexander Schmidt <alexs at linux.vnet.ibm.com>
+ Signed-off-by: Roland Dreier <rolandd at cisco.com>
+
+diff --git a/drivers/infiniband/hw/ehca/hcp_if.c b/drivers/infiniband/hw/ehca/hcp_if.c
+index 4d5dc33..e6f9cdd 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,
+ struct ehca_cq *cq,
+ struct ehca_alloc_cq_parms *param)
+ {
++ int rc;
+ u64 ret;
+ unsigned long outs[PLPAR_HCALL9_BUFSIZE];
+
+@@ -283,8 +284,19 @@ u64 hipz_h_alloc_resource_cq(const struct ipz_adapter_handle adapter_handle,
+ param->act_nr_of_entries = (u32)outs[3];
+ param->act_pages = (u32)outs[4];
+
+- if (ret == H_SUCCESS)
+- hcp_galpas_ctor(&cq->galpas, 0, outs[5], outs[6]);
++ if (ret == H_SUCCESS) {
++ rc = hcp_galpas_ctor(&cq->galpas, 0, outs[5], outs[6]);
++ if (rc) {
++ ehca_gen_err("Could not establish HW access. rc=%d paddr=%#lx",
++ rc, outs[5]);
++
++ ehca_plpar_hcall_norets(H_FREE_RESOURCE,
++ adapter_handle.handle, /* r4 */
++ cq->ipz_cq_handle.handle, /* r5 */
++ 0, 0, 0, 0, 0);
++ ret = H_NO_MEM;
++ }
++ }
+
+ if (ret == H_NOT_ENOUGH_RESOURCES)
+ 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,
+ u64 hipz_h_alloc_resource_qp(const struct ipz_adapter_handle adapter_handle,
+ struct ehca_alloc_qp_parms *parms, int is_user)
+ {
++ int rc;
+ u64 ret;
+ u64 allocate_controls, max_r10_reg, r11, r12;
+ unsigned long outs[PLPAR_HCALL9_BUFSIZE];
+@@ -358,8 +371,19 @@ u64 hipz_h_alloc_resource_qp(const struct ipz_adapter_handle adapter_handle,
+ parms->rqueue.queue_size =
+ (u32)EHCA_BMASK_GET(H_ALL_RES_QP_RQUEUE_SIZE_PAGES, outs[4]);
+
+- if (ret == H_SUCCESS)
+- hcp_galpas_ctor(&parms->galpas, is_user, outs[6], outs[6]);
++ if (ret == H_SUCCESS) {
++ rc = hcp_galpas_ctor(&parms->galpas, is_user, outs[6], outs[6]);
++ if (rc) {
++ ehca_gen_err("Could not establish HW access. rc=%d paddr=%#lx",
++ rc, outs[6]);
++
++ ehca_plpar_hcall_norets(H_FREE_RESOURCE,
++ adapter_handle.handle, /* r4 */
++ parms->qp_handle.handle, /* r5 */
++ 0, 0, 0, 0, 0);
++ ret = H_NO_MEM;
++ }
++ }
+
+ if (ret == H_NOT_ENOUGH_RESOURCES)
+ 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 b3e0e72..077376f 100644
+--- a/drivers/infiniband/hw/ehca/hcp_phyp.c
++++ b/drivers/infiniband/hw/ehca/hcp_phyp.c
+@@ -42,10 +42,9 @@
+ #include "ehca_classes.h"
+ #include "hipz_hw.h"
+
+-int hcall_map_page(u64 physaddr, u64 *mapaddr)
++u64 hcall_map_page(u64 physaddr)
+ {
+- *mapaddr = (u64)(ioremap(physaddr, EHCA_PAGESIZE));
+- return 0;
++ return (u64)ioremap(physaddr, EHCA_PAGESIZE);
+ }
+
+ int hcall_unmap_page(u64 mapaddr)
+@@ -58,9 +57,9 @@ int hcp_galpas_ctor(struct h_galpas *galpas, int is_user,
+ u64 paddr_kernel, u64 paddr_user)
+ {
+ if (!is_user) {
+- int ret = hcall_map_page(paddr_kernel, &galpas->kernel.fw_handle);
+- if (ret)
+- return ret;
++ galpas->kernel.fw_handle = hcall_map_page(paddr_kernel);
++ if (!galpas->kernel.fw_handle)
++ return -ENOMEM;
+ } else
+ galpas->kernel.fw_handle = 0;
+
+diff --git a/drivers/infiniband/hw/ehca/hcp_phyp.h b/drivers/infiniband/hw/ehca/hcp_phyp.h
+index 204227d..d1b0299 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,
+
+ int hcp_galpas_dtor(struct h_galpas *galpas);
+
+-int hcall_map_page(u64 physaddr, u64 * mapaddr);
++u64 hcall_map_page(u64 physaddr);
+
+ int hcall_unmap_page(u64 mapaddr);
+
More information about the ewg
mailing list