Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=947d7617a1d876c2c93f73017a734e070c64d43b
Commit:     947d7617a1d876c2c93f73017a734e070c64d43b
Parent:     19085745598ec254fd814411b675b52380c3bac0
Author:     Ralph Campbell <[EMAIL PROTECTED]>
AuthorDate: Thu Mar 15 14:44:48 2007 -0700
Committer:  Roland Dreier <[EMAIL PROTECTED]>
CommitDate: Wed Apr 18 20:20:54 2007 -0700

    IB/ipath: Don't initialize port memory for subports
    
    A recent change was made to allocate memory for a port after CPU
    affinity is set. That change didn't account for subports and was
    trying to allocate memory for the port twice.
    
    Signed-off-by: Bryan O'Sullivan <[EMAIL PROTECTED]>
    Signed-off-by: Roland Dreier <[EMAIL PROTECTED]>
---
 drivers/infiniband/hw/ipath/ipath_file_ops.c |   19 +++++++++++++++----
 drivers/infiniband/hw/ipath/ipath_kernel.h   |    2 ++
 2 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/drivers/infiniband/hw/ipath/ipath_file_ops.c 
b/drivers/infiniband/hw/ipath/ipath_file_ops.c
index 5d64ff8..5de1dd4 100644
--- a/drivers/infiniband/hw/ipath/ipath_file_ops.c
+++ b/drivers/infiniband/hw/ipath/ipath_file_ops.c
@@ -178,8 +178,7 @@ static int ipath_get_base_info(struct file *fp,
 
                kinfo->spi_rcvhdr_base = ((u64) pd->subport_rcvhdr_base +
                        pd->port_rcvhdrq_size * slave) & MMAP64_MASK;
-               kinfo->spi_rcvhdr_tailaddr =
-                       (u64) pd->port_rcvhdrqtailaddr_phys & MMAP64_MASK;
+               kinfo->spi_rcvhdr_tailaddr = 0;
                kinfo->spi_rcv_egrbufs = ((u64) pd->subport_rcvegrbuf +
                        dd->ipath_rcvegrcnt * dd->ipath_rcvegrbufsize * slave) &
                        MMAP64_MASK;
@@ -1443,6 +1442,7 @@ static int init_subports(struct ipath_devdata *dd,
        pd->port_subport_cnt = uinfo->spu_subport_cnt;
        pd->port_subport_id = uinfo->spu_subport_id;
        pd->active_slaves = 1;
+       set_bit(IPATH_PORT_MASTER_UNINIT, &pd->port_flag);
        goto bail;
 
 bail_rhdr:
@@ -1764,11 +1764,17 @@ static int ipath_do_user_init(struct file *fp,
                              const struct ipath_user_info *uinfo)
 {
        int ret;
-       struct ipath_portdata *pd;
+       struct ipath_portdata *pd = port_fp(fp);
        struct ipath_devdata *dd;
        u32 head32;
 
-       pd = port_fp(fp);
+       /* Subports don't need to initialize anything since master did it. */
+       if (subport_fp(fp)) {
+               ret = wait_event_interruptible(pd->port_wait,
+                       !test_bit(IPATH_PORT_MASTER_UNINIT, &pd->port_flag));
+               goto done;
+       }
+
        dd = pd->port_dd;
 
        if (uinfo->spu_rcvhdrsize) {
@@ -1826,6 +1832,11 @@ static int ipath_do_user_init(struct file *fp,
                         dd->ipath_rcvctrl & ~INFINIPATH_R_TAILUPD);
        ipath_write_kreg(dd, dd->ipath_kregs->kr_rcvctrl,
                         dd->ipath_rcvctrl);
+       /* Notify any waiting slaves */
+       if (pd->port_subport_cnt) {
+               clear_bit(IPATH_PORT_MASTER_UNINIT, &pd->port_flag);
+               wake_up(&pd->port_wait);
+       }
 done:
        return ret;
 }
diff --git a/drivers/infiniband/hw/ipath/ipath_kernel.h 
b/drivers/infiniband/hw/ipath/ipath_kernel.h
index 6d8d05f..c8df65a 100644
--- a/drivers/infiniband/hw/ipath/ipath_kernel.h
+++ b/drivers/infiniband/hw/ipath/ipath_kernel.h
@@ -701,6 +701,8 @@ int ipath_set_rx_pol_inv(struct ipath_devdata *dd, u8 
new_pol_inv);
 #define IPATH_PORT_WAITING_RCV   2
                /* waiting for a PIO buffer to be available */
 #define IPATH_PORT_WAITING_PIO   3
+               /* master has not finished initializing */
+#define IPATH_PORT_MASTER_UNINIT 4
 
 /* free up any allocated data at closes */
 void ipath_free_data(struct ipath_portdata *dd);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to