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] [day] [month] [year] [list]
Date:	Wed, 21 Dec 2011 22:05:38 -0500 (EST)
From:	Alan Stern <stern@...land.harvard.edu>
To:	Dmitry Antipov <dmitry.antipov@...aro.org>
cc:	linaro-dev@...ts.linaro.org, <patches@...aro.org>,
	<linux-usb@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] ohci-hcd: ohci-hcd: use usleep_range() instead of mdelay()

On Wed, 21 Dec 2011, Dmitry Antipov wrote:

>  From ac60fe289eef3d81009f2b14a12acbac3e71878b Mon Sep 17 00:00:00 2001
> From: Dmitry Antipov <dmitry.antipov@...aro.org>
> Date: Wed, 21 Dec 2011 11:05:27 +0400
> Subject: [PATCH] ohci-hcd: use usleep_range() instead of mdelay()
> 
> ---
>   drivers/usb/host/ohci-hcd.c |    4 +++-
>   1 files changed, 3 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c
> index b263919..a6d58da 100644
> --- a/drivers/usb/host/ohci-hcd.c
> +++ b/drivers/usb/host/ohci-hcd.c
> @@ -574,6 +574,7 @@ static int ohci_run (struct ohci_hcd *ohci)
>   	u32			mask, val;
>   	int			first = ohci->fminterval == 0;
>   	struct usb_hcd		*hcd = ohci_to_hcd(ohci);
> +	unsigned long		usecs;
> 
>   	disable (ohci);
> 
> @@ -724,7 +725,8 @@ retry:
>   	spin_unlock_irq (&ohci->lock);
> 
>   	// POTPGT delay is bits 24-31, in 2 ms units.
> -	mdelay ((val >> 23) & 0x1fe);
> +	usecs = ((val >> 23) & 0x1fe) * USEC_PER_MSEC;
> +	usleep_range(usecs, usecs + 1000);
>   	hcd->state = HC_STATE_RUNNING;
> 
>   	if (quirk_zfmicro(ohci)) {

Why not simply use msleep()?

Alan Stern

--
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