[ofa-general] [PATCH 5/5] IB/ehca: SLES10 SP1/2 backports
Joachim Fenkes
fenkes at de.ibm.com
Mon Jul 14 12:33:56 PDT 2008
From: Alexander Schmidt <alexschm at de.ibm.com>
Signed-off-by: Joachim Fenkes <fenkes at de.ibm.com>
---
.../ehca_01_ibmebus_loc_code.patch | 154 ++++++++++++++++++++
.../ehca_01_ibmebus_loc_code.patch | 154 ++++++++++++++++++++
2 files changed, 308 insertions(+), 0 deletions(-)
create mode 100644 kernel_patches/backport/2.6.16_sles10_sp1/ehca_01_ibmebus_loc_code.patch
create mode 100644 kernel_patches/backport/2.6.16_sles10_sp2/ehca_01_ibmebus_loc_code.patch
diff --git a/kernel_patches/backport/2.6.16_sles10_sp1/ehca_01_ibmebus_loc_code.patch b/kernel_patches/backport/2.6.16_sles10_sp1/ehca_01_ibmebus_loc_code.patch
new file mode 100644
index 0000000..9d4e606
--- /dev/null
+++ b/kernel_patches/backport/2.6.16_sles10_sp1/ehca_01_ibmebus_loc_code.patch
@@ -0,0 +1,154 @@
+Index: ofa_kernel-1.4/drivers/infiniband/hw/ehca/ehca_classes.h
+===================================================================
+--- ofa_kernel-1.4.orig/drivers/infiniband/hw/ehca/ehca_classes.h 2008-07-07 15:06:10.000000000 +0200
++++ ofa_kernel-1.4/drivers/infiniband/hw/ehca/ehca_classes.h 2008-07-10 01:33:03.000000000 +0200
+@@ -112,7 +112,7 @@
+
+ struct ehca_shca {
+ struct ib_device ib_device;
+- struct of_device *ofdev;
++ struct ibmebus_dev *ibmebus_dev;
+ u8 num_ports;
+ int hw_level;
+ struct list_head shca_list;
+Index: ofa_kernel-1.4/drivers/infiniband/hw/ehca/ehca_eq.c
+===================================================================
+--- ofa_kernel-1.4.orig/drivers/infiniband/hw/ehca/ehca_eq.c 2008-07-07 15:06:10.000000000 +0200
++++ ofa_kernel-1.4/drivers/infiniband/hw/ehca/ehca_eq.c 2008-07-10 01:33:03.000000000 +0200
+@@ -122,7 +122,7 @@
+
+ /* register interrupt handlers and initialize work queues */
+ if (type == EHCA_EQ) {
+- 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);
+ } else if (type == EHCA_NEQ) {
+- 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)
+@@ -170,7 +170,7 @@
+ u64 h_ret;
+
+ spin_lock_irqsave(&eq->spinlock, flags);
+- ibmebus_free_irq(eq->ist, (void *)shca);
++ ibmebus_free_irq(NULL, eq->ist, (void *)shca);
+
+ h_ret = hipz_h_destroy_eq(shca->ipz_hca_handle, eq);
+
+Index: ofa_kernel-1.4/drivers/infiniband/hw/ehca/ehca_main.c
+===================================================================
+--- ofa_kernel-1.4.orig/drivers/infiniband/hw/ehca/ehca_main.c 2008-07-10 01:32:25.000000000 +0200
++++ ofa_kernel-1.4/drivers/infiniband/hw/ehca/ehca_main.c 2008-07-10 01:35:21.000000000 +0200
+@@ -289,8 +289,8 @@
+ };
+
+ ehca_gen_dbg("Probing adapter %s...",
+- shca->ofdev->node->full_name);
+- loc_code = of_get_property(shca->ofdev->node, "ibm,loc-code", NULL);
++ shca->ibmebus_dev->ofdev.node->full_name);
++ loc_code = of_get_property(shca->ibmebus_dev->ofdev.node, "ibm,loc-code", NULL);
+ if (loc_code)
+ ehca_gen_dbg(" ... location lode=%s", loc_code);
+
+@@ -458,7 +458,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;
+- shca->ib_device.dma_device = &shca->ofdev->dev;
++ shca->ib_device.dma_device = &shca->ibmebus_dev->ofdev.dev;
+ shca->ib_device.query_device = ehca_query_device;
+ shca->ib_device.query_port = ehca_query_port;
+ shca->ib_device.query_gid = ehca_query_gid;
+@@ -707,7 +707,7 @@
+ .attrs = ehca_dev_attrs
+ };
+
+-static int __devinit ehca_probe(struct of_device *dev,
++static int __devinit ehca_probe(struct ibmebus_dev *dev,
+ const struct of_device_id *id)
+ {
+ struct ehca_shca *shca;
+@@ -715,16 +715,16 @@
+ struct ib_pd *ibpd;
+ int ret, i, eq_size;
+
+- handle = of_get_property(dev->node, "ibm,hca-handle", NULL);
++ handle = of_get_property(dev->ofdev.node, "ibm,hca-handle", NULL);
+ if (!handle) {
+ ehca_gen_err("Cannot get eHCA handle for adapter: %s.",
+- dev->node->full_name);
++ dev->ofdev.node->full_name);
+ return -ENODEV;
+ }
+
+ if (!(*handle)) {
+ ehca_gen_err("Wrong eHCA handle for adapter: %s.",
+- dev->node->full_name);
++ dev->ofdev.node->full_name);
+ return -ENODEV;
+ }
+
+@@ -739,9 +739,9 @@
+ for (i = 0; i < ARRAY_SIZE(shca->sport); i++)
+ spin_lock_init(&shca->sport[i].mod_sqp_lock);
+
+- shca->ofdev = dev;
++ shca->ibmebus_dev = dev;
+ shca->ipz_hca_handle.handle = *handle;
+- dev->dev.driver_data = shca;
++ dev->ofdev.dev.driver_data = shca;
+
+ ret = ehca_sense_attributes(shca);
+ if (ret < 0) {
+@@ -818,7 +818,7 @@
+ }
+ }
+
+- ret = sysfs_create_group(&dev->dev.kobj, &ehca_dev_attr_grp);
++ ret = sysfs_create_group(&dev->ofdev.dev.kobj, &ehca_dev_attr_grp);
+ if (ret) /* only complain; we can live without attributes */
+ ehca_err(&shca->ib_device,
+ "Cannot create device attributes ret=%d", ret);
+@@ -868,12 +868,12 @@
+ return -EINVAL;
+ }
+
+-static int __devexit ehca_remove(struct of_device *dev)
++static int __devexit ehca_remove(struct ibmebus_dev *dev)
+ {
+- struct ehca_shca *shca = dev->dev.driver_data;
++ struct ehca_shca *shca = dev->ofdev.dev.driver_data;
+ int ret;
+
+- sysfs_remove_group(&dev->dev.kobj, &ehca_dev_attr_grp);
++ sysfs_remove_group(&dev->ofdev.dev.kobj, &ehca_dev_attr_grp);
+
+ if (ehca_open_aqp1 == 1) {
+ int i;
+@@ -924,14 +924,11 @@
+ {},
+ };
+
+-static struct of_platform_driver ehca_driver = {
+- .name = "ehca",
+- .match_table = ehca_device_table,
+- .probe = ehca_probe,
+- .remove = ehca_remove,
+- .driver = {
+- .groups = ehca_drv_attr_groups,
+- },
++static struct ibmebus_driver ehca_driver = {
++ .name = "ehca",
++ .id_table = ehca_device_table,
++ .probe = ehca_probe,
++ .remove = ehca_remove,
+ };
+
+ void ehca_poll_eqs(unsigned long data)
diff --git a/kernel_patches/backport/2.6.16_sles10_sp2/ehca_01_ibmebus_loc_code.patch b/kernel_patches/backport/2.6.16_sles10_sp2/ehca_01_ibmebus_loc_code.patch
new file mode 100644
index 0000000..9d4e606
--- /dev/null
+++ b/kernel_patches/backport/2.6.16_sles10_sp2/ehca_01_ibmebus_loc_code.patch
@@ -0,0 +1,154 @@
+Index: ofa_kernel-1.4/drivers/infiniband/hw/ehca/ehca_classes.h
+===================================================================
+--- ofa_kernel-1.4.orig/drivers/infiniband/hw/ehca/ehca_classes.h 2008-07-07 15:06:10.000000000 +0200
++++ ofa_kernel-1.4/drivers/infiniband/hw/ehca/ehca_classes.h 2008-07-10 01:33:03.000000000 +0200
+@@ -112,7 +112,7 @@
+
+ struct ehca_shca {
+ struct ib_device ib_device;
+- struct of_device *ofdev;
++ struct ibmebus_dev *ibmebus_dev;
+ u8 num_ports;
+ int hw_level;
+ struct list_head shca_list;
+Index: ofa_kernel-1.4/drivers/infiniband/hw/ehca/ehca_eq.c
+===================================================================
+--- ofa_kernel-1.4.orig/drivers/infiniband/hw/ehca/ehca_eq.c 2008-07-07 15:06:10.000000000 +0200
++++ ofa_kernel-1.4/drivers/infiniband/hw/ehca/ehca_eq.c 2008-07-10 01:33:03.000000000 +0200
+@@ -122,7 +122,7 @@
+
+ /* register interrupt handlers and initialize work queues */
+ if (type == EHCA_EQ) {
+- 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);
+ } else if (type == EHCA_NEQ) {
+- 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)
+@@ -170,7 +170,7 @@
+ u64 h_ret;
+
+ spin_lock_irqsave(&eq->spinlock, flags);
+- ibmebus_free_irq(eq->ist, (void *)shca);
++ ibmebus_free_irq(NULL, eq->ist, (void *)shca);
+
+ h_ret = hipz_h_destroy_eq(shca->ipz_hca_handle, eq);
+
+Index: ofa_kernel-1.4/drivers/infiniband/hw/ehca/ehca_main.c
+===================================================================
+--- ofa_kernel-1.4.orig/drivers/infiniband/hw/ehca/ehca_main.c 2008-07-10 01:32:25.000000000 +0200
++++ ofa_kernel-1.4/drivers/infiniband/hw/ehca/ehca_main.c 2008-07-10 01:35:21.000000000 +0200
+@@ -289,8 +289,8 @@
+ };
+
+ ehca_gen_dbg("Probing adapter %s...",
+- shca->ofdev->node->full_name);
+- loc_code = of_get_property(shca->ofdev->node, "ibm,loc-code", NULL);
++ shca->ibmebus_dev->ofdev.node->full_name);
++ loc_code = of_get_property(shca->ibmebus_dev->ofdev.node, "ibm,loc-code", NULL);
+ if (loc_code)
+ ehca_gen_dbg(" ... location lode=%s", loc_code);
+
+@@ -458,7 +458,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;
+- shca->ib_device.dma_device = &shca->ofdev->dev;
++ shca->ib_device.dma_device = &shca->ibmebus_dev->ofdev.dev;
+ shca->ib_device.query_device = ehca_query_device;
+ shca->ib_device.query_port = ehca_query_port;
+ shca->ib_device.query_gid = ehca_query_gid;
+@@ -707,7 +707,7 @@
+ .attrs = ehca_dev_attrs
+ };
+
+-static int __devinit ehca_probe(struct of_device *dev,
++static int __devinit ehca_probe(struct ibmebus_dev *dev,
+ const struct of_device_id *id)
+ {
+ struct ehca_shca *shca;
+@@ -715,16 +715,16 @@
+ struct ib_pd *ibpd;
+ int ret, i, eq_size;
+
+- handle = of_get_property(dev->node, "ibm,hca-handle", NULL);
++ handle = of_get_property(dev->ofdev.node, "ibm,hca-handle", NULL);
+ if (!handle) {
+ ehca_gen_err("Cannot get eHCA handle for adapter: %s.",
+- dev->node->full_name);
++ dev->ofdev.node->full_name);
+ return -ENODEV;
+ }
+
+ if (!(*handle)) {
+ ehca_gen_err("Wrong eHCA handle for adapter: %s.",
+- dev->node->full_name);
++ dev->ofdev.node->full_name);
+ return -ENODEV;
+ }
+
+@@ -739,9 +739,9 @@
+ for (i = 0; i < ARRAY_SIZE(shca->sport); i++)
+ spin_lock_init(&shca->sport[i].mod_sqp_lock);
+
+- shca->ofdev = dev;
++ shca->ibmebus_dev = dev;
+ shca->ipz_hca_handle.handle = *handle;
+- dev->dev.driver_data = shca;
++ dev->ofdev.dev.driver_data = shca;
+
+ ret = ehca_sense_attributes(shca);
+ if (ret < 0) {
+@@ -818,7 +818,7 @@
+ }
+ }
+
+- ret = sysfs_create_group(&dev->dev.kobj, &ehca_dev_attr_grp);
++ ret = sysfs_create_group(&dev->ofdev.dev.kobj, &ehca_dev_attr_grp);
+ if (ret) /* only complain; we can live without attributes */
+ ehca_err(&shca->ib_device,
+ "Cannot create device attributes ret=%d", ret);
+@@ -868,12 +868,12 @@
+ return -EINVAL;
+ }
+
+-static int __devexit ehca_remove(struct of_device *dev)
++static int __devexit ehca_remove(struct ibmebus_dev *dev)
+ {
+- struct ehca_shca *shca = dev->dev.driver_data;
++ struct ehca_shca *shca = dev->ofdev.dev.driver_data;
+ int ret;
+
+- sysfs_remove_group(&dev->dev.kobj, &ehca_dev_attr_grp);
++ sysfs_remove_group(&dev->ofdev.dev.kobj, &ehca_dev_attr_grp);
+
+ if (ehca_open_aqp1 == 1) {
+ int i;
+@@ -924,14 +924,11 @@
+ {},
+ };
+
+-static struct of_platform_driver ehca_driver = {
+- .name = "ehca",
+- .match_table = ehca_device_table,
+- .probe = ehca_probe,
+- .remove = ehca_remove,
+- .driver = {
+- .groups = ehca_drv_attr_groups,
+- },
++static struct ibmebus_driver ehca_driver = {
++ .name = "ehca",
++ .id_table = ehca_device_table,
++ .probe = ehca_probe,
++ .remove = ehca_remove,
+ };
+
+ void ehca_poll_eqs(unsigned long data)
--
1.5.5
More information about the general
mailing list