lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 27 Mar 2008 11:53:01 -0700
From:	David Brownell <david-b@...bell.net>
To:	Richard Kennedy <richard@....demon.co.uk>
Cc:	linux-usb <linux-usb@...r.kernel.org>,
	lkml <linux-kernel@...r.kernel.org>,
	Alan Stern <stern@...land.harvard.edu>
Subject: Re: [patch] usb ohci : fix 2 timers to fire at jiffies + 1s

On Wednesday 26 March 2008, Richard Kennedy wrote:
>     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: Richard Kennedy <richard@....demon.co.uk>

Acked-by: David Brownell <dbrownell@...rs.sourceforge.net>

> ---
> 
> compiled on latest v2.6.25-rc7-11 git head but not otherwise tested.
> Richard
> 
> diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c
> index dd4798e..33f1c1c 100644
> --- a/drivers/usb/host/ohci-hcd.c
> +++ b/drivers/usb/host/ohci-hcd.c
> @@ -467,7 +467,7 @@ static void unlink_watchdog_func(unsigned long _ohci)
>  out:
>  	kfree(seen);
>  	if (ohci->eds_scheduled)
> -		mod_timer(&ohci->unlink_watchdog, round_jiffies_relative(HZ));
> +		mod_timer(&ohci->unlink_watchdog, round_jiffies(jiffies + HZ));
>  done:
>  	spin_unlock_irqrestore(&ohci->lock, flags);
>  }
> diff --git a/drivers/usb/host/ohci-q.c b/drivers/usb/host/ohci-q.c
> index 5181732..9c9f3b5 100644
> --- a/drivers/usb/host/ohci-q.c
> +++ b/drivers/usb/host/ohci-q.c
> @@ -169,7 +169,7 @@ static int ed_schedule (struct ohci_hcd *ohci, struct ed *ed)
>  	if (quirk_zfmicro(ohci)
>  			&& (ed->type == PIPE_INTERRUPT)
>  			&& !(ohci->eds_scheduled++))
> -		mod_timer(&ohci->unlink_watchdog, round_jiffies_relative(HZ));
> +		mod_timer(&ohci->unlink_watchdog, round_jiffies(jiffies + HZ));
>  	wmb ();
>  
>  	/* we care about rm_list when setting CLE/BLE in case the HC was at
> 
> 


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ