aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/qib/qib_init.c
diff options
context:
space:
mode:
authorMitko Haralanov <mitko.haralanov@intel.com>2012-05-07 14:03:02 -0400
committerRoland Dreier <roland@purestorage.com>2012-05-14 15:39:04 -0400
commit6ceaadee341da89af143c5cd56a3652b406e1ff5 (patch)
tree5aa84c28c79f936d59bdcfb4475983a04799764d /drivers/infiniband/hw/qib/qib_init.c
parent4ccf28a26c981bcc6f938a7ea293a623d2d66d7b (diff)
IB/qib: Display correct value for number of contexts
A "fix" for a bug with the number of contexts on a single-port board caused the calculation to be off by one, which causes problems with the upper layers. The same problem exists for number of free contexts, which is also fixed here. Signed-off-by: Mitko Haralanov <mitko.haralanov@intel.com> Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com> Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/infiniband/hw/qib/qib_init.c')
-rw-r--r--drivers/infiniband/hw/qib/qib_init.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/qib/qib_init.c b/drivers/infiniband/hw/qib/qib_init.c
index cf0cd30adc8d..dc14e100a7f1 100644
--- a/drivers/infiniband/hw/qib/qib_init.c
+++ b/drivers/infiniband/hw/qib/qib_init.c
@@ -102,6 +102,8 @@ void qib_set_ctxtcnt(struct qib_devdata *dd)
102 dd->cfgctxts = qib_cfgctxts; 102 dd->cfgctxts = qib_cfgctxts;
103 else 103 else
104 dd->cfgctxts = dd->ctxtcnt; 104 dd->cfgctxts = dd->ctxtcnt;
105 dd->freectxts = (dd->first_user_ctxt > dd->cfgctxts) ? 0 :
106 dd->cfgctxts - dd->first_user_ctxt;
105} 107}
106 108
107/* 109/*
@@ -402,7 +404,6 @@ static void enable_chip(struct qib_devdata *dd)
402 if (rcd) 404 if (rcd)
403 dd->f_rcvctrl(rcd->ppd, rcvmask, i); 405 dd->f_rcvctrl(rcd->ppd, rcvmask, i);
404 } 406 }
405 dd->freectxts = dd->cfgctxts - dd->first_user_ctxt;
406} 407}
407 408
408static void verify_interrupt(unsigned long opaque) 409static void verify_interrupt(unsigned long opaque)