Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 302635
b: refs/heads/master
c: 6ceaade
h: refs/heads/master
i:
  302633: d612107
  302631: 6bb4a3c
v: v3
  • Loading branch information
Mitko Haralanov authored and Roland Dreier committed May 14, 2012
1 parent 02bbf08 commit a3d9868
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4ccf28a26c981bcc6f938a7ea293a623d2d66d7b
refs/heads/master: 6ceaadee341da89af143c5cd56a3652b406e1ff5
3 changes: 2 additions & 1 deletion trunk/drivers/infiniband/hw/qib/qib_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ void qib_set_ctxtcnt(struct qib_devdata *dd)
dd->cfgctxts = qib_cfgctxts;
else
dd->cfgctxts = dd->ctxtcnt;
dd->freectxts = (dd->first_user_ctxt > dd->cfgctxts) ? 0 :
dd->cfgctxts - dd->first_user_ctxt;
}

/*
Expand Down Expand Up @@ -402,7 +404,6 @@ static void enable_chip(struct qib_devdata *dd)
if (rcd)
dd->f_rcvctrl(rcd->ppd, rcvmask, i);
}
dd->freectxts = dd->cfgctxts - dd->first_user_ctxt;
}

static void verify_interrupt(unsigned long opaque)
Expand Down
7 changes: 5 additions & 2 deletions trunk/drivers/infiniband/hw/qib/qib_sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -503,8 +503,11 @@ static ssize_t show_nctxts(struct device *device,
struct qib_devdata *dd = dd_from_dev(dev);

/* Return the number of user ports (contexts) available. */
return scnprintf(buf, PAGE_SIZE, "%u\n", dd->cfgctxts -
dd->first_user_ctxt);
/* The calculation below deals with a special case where
* cfgctxts is set to 1 on a single-port board. */
return scnprintf(buf, PAGE_SIZE, "%u\n",
(dd->first_user_ctxt > dd->cfgctxts) ? 0 :
(dd->cfgctxts - dd->first_user_ctxt));
}

static ssize_t show_nfreectxts(struct device *device,
Expand Down

0 comments on commit a3d9868

Please sign in to comment.