summaryrefslogtreecommitdiffstats
path: root/drivers/firewire/core-cdev.c
diff options
context:
space:
mode:
authorClemens Ladisch <clemens@ladisch.de>2011-01-22 15:05:03 +0100
committerStefan Richter <stefanr@s5r6.in-berlin.de>2011-01-23 12:31:01 +0100
commite71084af58cf15e6043338500eeaf6281d0a62af (patch)
treed757d4891a4f93f7a07c1f12448d3be3be748fa1 /drivers/firewire/core-cdev.c
parentfirewire: cdev: remove unneeded reference (diff)
downloadlinux-e71084af58cf15e6043338500eeaf6281d0a62af.tar.xz
linux-e71084af58cf15e6043338500eeaf6281d0a62af.zip
firewire: core: fix card->reset_jiffies overflow
On a 32-bit machine with, e.g., HZ=1000, jiffies will overflow after about 50 days, so if there are between 25 and 50 days between bus resets, the card->reset_jiffies comparisons can get wrong results. To fix this, ensure that this timestamp always uses 64 bits. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: "Stefan Richter" <stefanr@s5r6.in-berlin.de>
Diffstat (limited to 'drivers/firewire/core-cdev.c')
-rw-r--r--drivers/firewire/core-cdev.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/firewire/core-cdev.c b/drivers/firewire/core-cdev.c
index e0c13fb3ae22..62ac111af243 100644
--- a/drivers/firewire/core-cdev.c
+++ b/drivers/firewire/core-cdev.c
@@ -1205,7 +1205,8 @@ static void iso_resource_work(struct work_struct *work)
todo = r->todo;
/* Allow 1000ms grace period for other reallocations. */
if (todo == ISO_RES_ALLOC &&
- time_is_after_jiffies(client->device->card->reset_jiffies + HZ)) {
+ time_before64(get_jiffies_64(),
+ client->device->card->reset_jiffies + HZ)) {
schedule_iso_resource(r, DIV_ROUND_UP(HZ, 3));
skip = true;
} else {