Skip to content

Commit

Permalink
libata: fix timing computation in ata_eh_reset()
Browse files Browse the repository at this point in the history
As jiffies changes asynchronously, it needs to be cached if unchanging
timestamp is needed.  The code in ata_eh_reset() intended to do that
with @now but never actually did it.  Fix it.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
  • Loading branch information
Tejun Heo authored and Jeff Garzik committed Nov 3, 2007
1 parent f8d8e57 commit cd95546
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/ata/libata-eh.c
Original file line number Diff line number Diff line change
Expand Up @@ -2204,7 +2204,7 @@ int ata_eh_reset(struct ata_link *link, int classify,
unsigned long now = jiffies;

if (time_before(now, deadline)) {
unsigned long delta = deadline - jiffies;
unsigned long delta = deadline - now;

ata_link_printk(link, KERN_WARNING, "reset failed "
"(errno=%d), retrying in %u secs\n",
Expand Down

0 comments on commit cd95546

Please sign in to comment.