diff options
author | Manuel Schölling <manuel.schoelling@gmx.de> | 2014-05-25 09:26:41 -0400 |
---|---|---|
committer | Roland Dreier <roland@purestorage.com> | 2014-05-28 12:57:06 -0400 |
commit | 49410185c356b2767409de9220d5cf5c8db062e5 (patch) | |
tree | 455552fb347948aac6db38e92bd8f95f73fa378d /drivers/infiniband | |
parent | 7e6d3e5c70f13874fb06e6b67696ed90ce79bd48 (diff) |
IB/ipath: Use time_before()/_after()
Time comparisons must use time_after / time_before to avoid problems
when jiffies wraps.
Signed-off-by: Manuel Schölling <manuel.schoelling@gmx.de>
Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r-- | drivers/infiniband/hw/ipath/ipath_intr.c | 4 | ||||
-rw-r--r-- | drivers/infiniband/hw/ipath/ipath_sdma.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/drivers/infiniband/hw/ipath/ipath_intr.c b/drivers/infiniband/hw/ipath/ipath_intr.c index 26dfbc8ee0f1..01ba792791a0 100644 --- a/drivers/infiniband/hw/ipath/ipath_intr.c +++ b/drivers/infiniband/hw/ipath/ipath_intr.c | |||
@@ -70,7 +70,7 @@ void ipath_disarm_senderrbufs(struct ipath_devdata *dd) | |||
70 | if (sbuf[0] || sbuf[1] || (piobcnt > 128 && (sbuf[2] || sbuf[3]))) { | 70 | if (sbuf[0] || sbuf[1] || (piobcnt > 128 && (sbuf[2] || sbuf[3]))) { |
71 | int i; | 71 | int i; |
72 | if (ipath_debug & (__IPATH_PKTDBG|__IPATH_DBG) && | 72 | if (ipath_debug & (__IPATH_PKTDBG|__IPATH_DBG) && |
73 | dd->ipath_lastcancel > jiffies) { | 73 | time_after(dd->ipath_lastcancel, jiffies)) { |
74 | __IPATH_DBG_WHICH(__IPATH_PKTDBG|__IPATH_DBG, | 74 | __IPATH_DBG_WHICH(__IPATH_PKTDBG|__IPATH_DBG, |
75 | "SendbufErrs %lx %lx", sbuf[0], | 75 | "SendbufErrs %lx %lx", sbuf[0], |
76 | sbuf[1]); | 76 | sbuf[1]); |
@@ -755,7 +755,7 @@ static int handle_errors(struct ipath_devdata *dd, ipath_err_t errs) | |||
755 | 755 | ||
756 | /* likely due to cancel; so suppress message unless verbose */ | 756 | /* likely due to cancel; so suppress message unless verbose */ |
757 | if ((errs & (INFINIPATH_E_SPKTLEN | INFINIPATH_E_SPIOARMLAUNCH)) && | 757 | if ((errs & (INFINIPATH_E_SPKTLEN | INFINIPATH_E_SPIOARMLAUNCH)) && |
758 | dd->ipath_lastcancel > jiffies) { | 758 | time_after(dd->ipath_lastcancel, jiffies)) { |
759 | /* armlaunch takes precedence; it often causes both. */ | 759 | /* armlaunch takes precedence; it often causes both. */ |
760 | ipath_cdbg(VERBOSE, | 760 | ipath_cdbg(VERBOSE, |
761 | "Suppressed %s error (%llx) after sendbuf cancel\n", | 761 | "Suppressed %s error (%llx) after sendbuf cancel\n", |
diff --git a/drivers/infiniband/hw/ipath/ipath_sdma.c b/drivers/infiniband/hw/ipath/ipath_sdma.c index 98ac18ec977e..17a517766ad2 100644 --- a/drivers/infiniband/hw/ipath/ipath_sdma.c +++ b/drivers/infiniband/hw/ipath/ipath_sdma.c | |||
@@ -247,7 +247,7 @@ static void sdma_abort_task(unsigned long opaque) | |||
247 | 247 | ||
248 | /* ipath_sdma_abort() is done, waiting for interrupt */ | 248 | /* ipath_sdma_abort() is done, waiting for interrupt */ |
249 | if (status == IPATH_SDMA_ABORT_DISARMED) { | 249 | if (status == IPATH_SDMA_ABORT_DISARMED) { |
250 | if (jiffies < dd->ipath_sdma_abort_intr_timeout) | 250 | if (time_before(jiffies, dd->ipath_sdma_abort_intr_timeout)) |
251 | goto resched_noprint; | 251 | goto resched_noprint; |
252 | /* give up, intr got lost somewhere */ | 252 | /* give up, intr got lost somewhere */ |
253 | ipath_dbg("give up waiting for SDMADISABLED intr\n"); | 253 | ipath_dbg("give up waiting for SDMADISABLED intr\n"); |
@@ -341,7 +341,7 @@ resched: | |||
341 | * JAG - this is bad to just have default be a loop without | 341 | * JAG - this is bad to just have default be a loop without |
342 | * state change | 342 | * state change |
343 | */ | 343 | */ |
344 | if (jiffies > dd->ipath_sdma_abort_jiffies) { | 344 | if (time_after(jiffies, dd->ipath_sdma_abort_jiffies)) { |
345 | ipath_dbg("looping with status 0x%08lx\n", | 345 | ipath_dbg("looping with status 0x%08lx\n", |
346 | dd->ipath_sdma_status); | 346 | dd->ipath_sdma_status); |
347 | dd->ipath_sdma_abort_jiffies = jiffies + 5 * HZ; | 347 | dd->ipath_sdma_abort_jiffies = jiffies + 5 * HZ; |