2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-21 03:33:59 +08:00
linux-next/drivers/infiniband/hw
Mike Marciniszyn 53ab1c6498 IB/qib: Correct nfreectxts for multiple HCAs
The code that was recently introduced to report the number
of free contexts is flawed for multiple HCAs:

       /* Return the number of free user ports (contexts) available. */
       return scnprintf(buf, PAGE_SIZE, "%u\n", dd->cfgctxts -
                dd->first_user_ctxt - (u32)qib_stats.sps_ctxts);

The qib_stats is global to the module, not per HCA, so the code is broken
for multiple HCAs.

This patch adds a qib_devdata field, freectxts, that reflects the free
contexts for this HCA.

Signed-off-by: Mike Marciniszyn <mike.marciniszyn@qlogic.com>
Reviewed-by: Ram Vepa <ram.vepa@qlogic.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
2011-10-06 09:33:35 -07:00
..
amso1100 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband 2011-07-22 14:50:12 -07:00
cxgb3 [SCSI] cxgb3i: convert cdev->l2opt to use rcu to prevent NULL dereference 2011-09-26 09:28:01 -05:00
cxgb4 atomic: use <linux/atomic.h> 2011-07-26 16:49:47 -07:00
ehca atomic: use <linux/atomic.h> 2011-07-26 16:49:47 -07:00
ipath Merge branches 'cma', 'cxgb4', 'ipath', 'misc', 'mlx4', 'mthca', 'qib' and 'srp' into for-next 2011-07-22 11:56:11 -07:00
mlx4 IB/mlx4: Support PMA counters for IBoE 2011-07-18 21:04:36 -07:00
mthca IB/mthca: Remove unnecessary read of PCI_CAP_ID_EXP 2011-07-18 12:01:22 -07:00
nes atomic: use <linux/atomic.h> 2011-07-26 16:49:47 -07:00
qib IB/qib: Correct nfreectxts for multiple HCAs 2011-10-06 09:33:35 -07:00