aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/ipath/ipath_sdma.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/infiniband/hw/ipath/ipath_sdma.c')
-rw-r--r--drivers/infiniband/hw/ipath/ipath_sdma.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/infiniband/hw/ipath/ipath_sdma.c b/drivers/infiniband/hw/ipath/ipath_sdma.c
index 1974df7a9f78..0d07682c7310 100644
--- a/drivers/infiniband/hw/ipath/ipath_sdma.c
+++ b/drivers/infiniband/hw/ipath/ipath_sdma.c
@@ -449,16 +449,19 @@ int setup_sdma(struct ipath_devdata *dd)
449 ipath_write_kreg(dd, dd->ipath_kregs->kr_senddmaheadaddr, 449 ipath_write_kreg(dd, dd->ipath_kregs->kr_senddmaheadaddr,
450 dd->ipath_sdma_head_phys); 450 dd->ipath_sdma_head_phys);
451 451
452 /* Reserve all the former "kernel" piobufs */ 452 /*
453 n = dd->ipath_piobcnt2k + dd->ipath_piobcnt4k - dd->ipath_pioreserved; 453 * Reserve all the former "kernel" piobufs, using high number range
454 for (i = dd->ipath_lastport_piobuf; i < n; ++i) { 454 * so we get as many 4K buffers as possible
455 */
456 n = dd->ipath_piobcnt2k + dd->ipath_piobcnt4k;
457 i = dd->ipath_lastport_piobuf + dd->ipath_pioreserved;
458 ipath_chg_pioavailkernel(dd, i, n - i , 0);
459 for (; i < n; ++i) {
455 unsigned word = i / 64; 460 unsigned word = i / 64;
456 unsigned bit = i & 63; 461 unsigned bit = i & 63;
457 BUG_ON(word >= 3); 462 BUG_ON(word >= 3);
458 senddmabufmask[word] |= 1ULL << bit; 463 senddmabufmask[word] |= 1ULL << bit;
459 } 464 }
460 ipath_chg_pioavailkernel(dd, dd->ipath_lastport_piobuf,
461 n - dd->ipath_lastport_piobuf, 0);
462 ipath_write_kreg(dd, dd->ipath_kregs->kr_senddmabufmask0, 465 ipath_write_kreg(dd, dd->ipath_kregs->kr_senddmabufmask0,
463 senddmabufmask[0]); 466 senddmabufmask[0]);
464 ipath_write_kreg(dd, dd->ipath_kregs->kr_senddmabufmask1, 467 ipath_write_kreg(dd, dd->ipath_kregs->kr_senddmabufmask1,