aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
authorRalph Campbell <ralph.campbell@qlogic.com>2007-03-15 17:44:48 -0400
committerRoland Dreier <rolandd@cisco.com>2007-04-18 23:20:54 -0400
commit947d7617a1d876c2c93f73017a734e070c64d43b (patch)
tree29fb7a5aabdb04ad369f71338e6ab5387bffd8c4 /drivers/infiniband
parent19085745598ec254fd814411b675b52380c3bac0 (diff)
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 <bryan.osullivan@qlogic.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/hw/ipath/ipath_file_ops.c19
-rw-r--r--drivers/infiniband/hw/ipath/ipath_kernel.h2
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 5d64ff875297..5de1dd49722f 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,
178 178
179 kinfo->spi_rcvhdr_base = ((u64) pd->subport_rcvhdr_base + 179 kinfo->spi_rcvhdr_base = ((u64) pd->subport_rcvhdr_base +
180 pd->port_rcvhdrq_size * slave) & MMAP64_MASK; 180 pd->port_rcvhdrq_size * slave) & MMAP64_MASK;
181 kinfo->spi_rcvhdr_tailaddr = 181 kinfo->spi_rcvhdr_tailaddr = 0;
182 (u64) pd->port_rcvhdrqtailaddr_phys & MMAP64_MASK;
183 kinfo->spi_rcv_egrbufs = ((u64) pd->subport_rcvegrbuf + 182 kinfo->spi_rcv_egrbufs = ((u64) pd->subport_rcvegrbuf +
184 dd->ipath_rcvegrcnt * dd->ipath_rcvegrbufsize * slave) & 183 dd->ipath_rcvegrcnt * dd->ipath_rcvegrbufsize * slave) &
185 MMAP64_MASK; 184 MMAP64_MASK;
@@ -1443,6 +1442,7 @@ static int init_subports(struct ipath_devdata *dd,
1443 pd->port_subport_cnt = uinfo->spu_subport_cnt; 1442 pd->port_subport_cnt = uinfo->spu_subport_cnt;
1444 pd->port_subport_id = uinfo->spu_subport_id; 1443 pd->port_subport_id = uinfo->spu_subport_id;
1445 pd->active_slaves = 1; 1444 pd->active_slaves = 1;
1445 set_bit(IPATH_PORT_MASTER_UNINIT, &pd->port_flag);
1446 goto bail; 1446 goto bail;
1447 1447
1448bail_rhdr: 1448bail_rhdr:
@@ -1764,11 +1764,17 @@ static int ipath_do_user_init(struct file *fp,
1764 const struct ipath_user_info *uinfo) 1764 const struct ipath_user_info *uinfo)
1765{ 1765{
1766 int ret; 1766 int ret;
1767 struct ipath_portdata *pd; 1767 struct ipath_portdata *pd = port_fp(fp);
1768 struct ipath_devdata *dd; 1768 struct ipath_devdata *dd;
1769 u32 head32; 1769 u32 head32;
1770 1770
1771 pd = port_fp(fp); 1771 /* Subports don't need to initialize anything since master did it. */
1772 if (subport_fp(fp)) {
1773 ret = wait_event_interruptible(pd->port_wait,
1774 !test_bit(IPATH_PORT_MASTER_UNINIT, &pd->port_flag));
1775 goto done;
1776 }
1777
1772 dd = pd->port_dd; 1778 dd = pd->port_dd;
1773 1779
1774 if (uinfo->spu_rcvhdrsize) { 1780 if (uinfo->spu_rcvhdrsize) {
@@ -1826,6 +1832,11 @@ static int ipath_do_user_init(struct file *fp,
1826 dd->ipath_rcvctrl & ~INFINIPATH_R_TAILUPD); 1832 dd->ipath_rcvctrl & ~INFINIPATH_R_TAILUPD);
1827 ipath_write_kreg(dd, dd->ipath_kregs->kr_rcvctrl, 1833 ipath_write_kreg(dd, dd->ipath_kregs->kr_rcvctrl,
1828 dd->ipath_rcvctrl); 1834 dd->ipath_rcvctrl);
1835 /* Notify any waiting slaves */
1836 if (pd->port_subport_cnt) {
1837 clear_bit(IPATH_PORT_MASTER_UNINIT, &pd->port_flag);
1838 wake_up(&pd->port_wait);
1839 }
1829done: 1840done:
1830 return ret; 1841 return ret;
1831} 1842}
diff --git a/drivers/infiniband/hw/ipath/ipath_kernel.h b/drivers/infiniband/hw/ipath/ipath_kernel.h
index 6d8d05fb5999..c8df65a4d19d 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);
701#define IPATH_PORT_WAITING_RCV 2 701#define IPATH_PORT_WAITING_RCV 2
702 /* waiting for a PIO buffer to be available */ 702 /* waiting for a PIO buffer to be available */
703#define IPATH_PORT_WAITING_PIO 3 703#define IPATH_PORT_WAITING_PIO 3
704 /* master has not finished initializing */
705#define IPATH_PORT_MASTER_UNINIT 4
704 706
705/* free up any allocated data at closes */ 707/* free up any allocated data at closes */
706void ipath_free_data(struct ipath_portdata *dd); 708void ipath_free_data(struct ipath_portdata *dd);