提交 9cebcdc7 编写于 作者: R Richard Kennedy 提交者: Greg Kroah-Hartman

USB: ohci: fix 2 timers to fire at jiffies + 1s

Code inspection discovered in 2 places timers were being incorrectly setup
using round_jiffies_relative(HZ).  The timer would then fire at time (0 <= T <
HZ).

Fix them to use round_jiffies(jiffies + HZ);
Signed-off-by: NRichard Kennedy <richard@rsk.demon.co.uk>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: David Brownell <david-b@pacbell.net>
Cc: Arjan van de Ven <arjan@infradead.org>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 82247053
...@@ -467,7 +467,7 @@ static void unlink_watchdog_func(unsigned long _ohci) ...@@ -467,7 +467,7 @@ static void unlink_watchdog_func(unsigned long _ohci)
out: out:
kfree(seen); kfree(seen);
if (ohci->eds_scheduled) if (ohci->eds_scheduled)
mod_timer(&ohci->unlink_watchdog, round_jiffies_relative(HZ)); mod_timer(&ohci->unlink_watchdog, round_jiffies(jiffies + HZ));
done: done:
spin_unlock_irqrestore(&ohci->lock, flags); spin_unlock_irqrestore(&ohci->lock, flags);
} }
......
...@@ -169,7 +169,7 @@ static int ed_schedule (struct ohci_hcd *ohci, struct ed *ed) ...@@ -169,7 +169,7 @@ static int ed_schedule (struct ohci_hcd *ohci, struct ed *ed)
if (quirk_zfmicro(ohci) if (quirk_zfmicro(ohci)
&& (ed->type == PIPE_INTERRUPT) && (ed->type == PIPE_INTERRUPT)
&& !(ohci->eds_scheduled++)) && !(ohci->eds_scheduled++))
mod_timer(&ohci->unlink_watchdog, round_jiffies_relative(HZ)); mod_timer(&ohci->unlink_watchdog, round_jiffies(jiffies + HZ));
wmb (); wmb ();
/* we care about rm_list when setting CLE/BLE in case the HC was at /* we care about rm_list when setting CLE/BLE in case the HC was at
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册