Commit 49410185 authored by Manuel Schölling's avatar Manuel Schölling Committed by Roland Dreier

IB/ipath: Use time_before()/_after()

Time comparisons must use time_after / time_before to avoid problems
when jiffies wraps.
Signed-off-by: default avatarManuel Schölling <manuel.schoelling@gmx.de>
Signed-off-by: default avatarRoland Dreier <roland@purestorage.com>
parent 7e6d3e5c
...@@ -70,7 +70,7 @@ void ipath_disarm_senderrbufs(struct ipath_devdata *dd) ...@@ -70,7 +70,7 @@ void ipath_disarm_senderrbufs(struct ipath_devdata *dd)
if (sbuf[0] || sbuf[1] || (piobcnt > 128 && (sbuf[2] || sbuf[3]))) { if (sbuf[0] || sbuf[1] || (piobcnt > 128 && (sbuf[2] || sbuf[3]))) {
int i; int i;
if (ipath_debug & (__IPATH_PKTDBG|__IPATH_DBG) && if (ipath_debug & (__IPATH_PKTDBG|__IPATH_DBG) &&
dd->ipath_lastcancel > jiffies) { time_after(dd->ipath_lastcancel, jiffies)) {
__IPATH_DBG_WHICH(__IPATH_PKTDBG|__IPATH_DBG, __IPATH_DBG_WHICH(__IPATH_PKTDBG|__IPATH_DBG,
"SendbufErrs %lx %lx", sbuf[0], "SendbufErrs %lx %lx", sbuf[0],
sbuf[1]); sbuf[1]);
...@@ -755,7 +755,7 @@ static int handle_errors(struct ipath_devdata *dd, ipath_err_t errs) ...@@ -755,7 +755,7 @@ static int handle_errors(struct ipath_devdata *dd, ipath_err_t errs)
/* likely due to cancel; so suppress message unless verbose */ /* likely due to cancel; so suppress message unless verbose */
if ((errs & (INFINIPATH_E_SPKTLEN | INFINIPATH_E_SPIOARMLAUNCH)) && if ((errs & (INFINIPATH_E_SPKTLEN | INFINIPATH_E_SPIOARMLAUNCH)) &&
dd->ipath_lastcancel > jiffies) { time_after(dd->ipath_lastcancel, jiffies)) {
/* armlaunch takes precedence; it often causes both. */ /* armlaunch takes precedence; it often causes both. */
ipath_cdbg(VERBOSE, ipath_cdbg(VERBOSE,
"Suppressed %s error (%llx) after sendbuf cancel\n", "Suppressed %s error (%llx) after sendbuf cancel\n",
......
...@@ -247,7 +247,7 @@ static void sdma_abort_task(unsigned long opaque) ...@@ -247,7 +247,7 @@ static void sdma_abort_task(unsigned long opaque)
/* ipath_sdma_abort() is done, waiting for interrupt */ /* ipath_sdma_abort() is done, waiting for interrupt */
if (status == IPATH_SDMA_ABORT_DISARMED) { if (status == IPATH_SDMA_ABORT_DISARMED) {
if (jiffies < dd->ipath_sdma_abort_intr_timeout) if (time_before(jiffies, dd->ipath_sdma_abort_intr_timeout))
goto resched_noprint; goto resched_noprint;
/* give up, intr got lost somewhere */ /* give up, intr got lost somewhere */
ipath_dbg("give up waiting for SDMADISABLED intr\n"); ipath_dbg("give up waiting for SDMADISABLED intr\n");
...@@ -341,7 +341,7 @@ static void sdma_abort_task(unsigned long opaque) ...@@ -341,7 +341,7 @@ static void sdma_abort_task(unsigned long opaque)
* JAG - this is bad to just have default be a loop without * JAG - this is bad to just have default be a loop without
* state change * state change
*/ */
if (jiffies > dd->ipath_sdma_abort_jiffies) { if (time_after(jiffies, dd->ipath_sdma_abort_jiffies)) {
ipath_dbg("looping with status 0x%08lx\n", ipath_dbg("looping with status 0x%08lx\n",
dd->ipath_sdma_status); dd->ipath_sdma_status);
dd->ipath_sdma_abort_jiffies = jiffies + 5 * HZ; dd->ipath_sdma_abort_jiffies = jiffies + 5 * HZ;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment