diff options
author | Clemens Ladisch <clemens@ladisch.de> | 2011-01-22 09:05:03 -0500 |
---|---|---|
committer | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2011-01-23 06:31:01 -0500 |
commit | e71084af58cf15e6043338500eeaf6281d0a62af (patch) | |
tree | d757d4891a4f93f7a07c1f12448d3be3be748fa1 /drivers/firewire/core-cdev.c | |
parent | dbc9880fa731fe2482a706bbabb4165269233063 (diff) |
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.c | 3 |
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) | |||
1205 | todo = r->todo; | 1205 | todo = r->todo; |
1206 | /* Allow 1000ms grace period for other reallocations. */ | 1206 | /* Allow 1000ms grace period for other reallocations. */ |
1207 | if (todo == ISO_RES_ALLOC && | 1207 | if (todo == ISO_RES_ALLOC && |
1208 | time_is_after_jiffies(client->device->card->reset_jiffies + HZ)) { | 1208 | time_before64(get_jiffies_64(), |
1209 | client->device->card->reset_jiffies + HZ)) { | ||
1209 | schedule_iso_resource(r, DIV_ROUND_UP(HZ, 3)); | 1210 | schedule_iso_resource(r, DIV_ROUND_UP(HZ, 3)); |
1210 | skip = true; | 1211 | skip = true; |
1211 | } else { | 1212 | } else { |