From: Mike Marciniszyn Date: Thu, 6 Oct 2011 16:33:35 +0000 (-0700) Subject: IB/qib: Correct nfreectxts for multiple HCAs X-Git-Tag: v3.2-rc1~104^2^11~9 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=53ab1c6498371723c31b18400fab10a902a15a63;p=pandora-kernel.git 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 Reviewed-by: Ram Vepa Signed-off-by: Roland Dreier --- Reading git-diff-tree failed