linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ohci-hcd: ohci-hcd: use usleep_range() instead of mdelay()
@ 2011-12-21  7:07 Dmitry Antipov
  2011-12-21 21:12 ` Greg KH
  2011-12-22  3:05 ` Alan Stern
  0 siblings, 2 replies; 3+ messages in thread
From: Dmitry Antipov @ 2011-12-21  7:07 UTC (permalink / raw)
  To: linaro-dev; +Cc: patches, linux-usb, linux-kernel

 From ac60fe289eef3d81009f2b14a12acbac3e71878b Mon Sep 17 00:00:00 2001
From: Dmitry Antipov <dmitry.antipov@linaro.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)) {
-- 
1.7.7.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] ohci-hcd: ohci-hcd: use usleep_range() instead of mdelay()
  2011-12-21  7:07 [PATCH] ohci-hcd: ohci-hcd: use usleep_range() instead of mdelay() Dmitry Antipov
@ 2011-12-21 21:12 ` Greg KH
  2011-12-22  3:05 ` Alan Stern
  1 sibling, 0 replies; 3+ messages in thread
From: Greg KH @ 2011-12-21 21:12 UTC (permalink / raw)
  To: Dmitry Antipov; +Cc: linaro-dev, patches, linux-usb, linux-kernel

On Wed, Dec 21, 2011 at 11:07:22AM +0400, Dmitry Antipov wrote:
> From ac60fe289eef3d81009f2b14a12acbac3e71878b Mon Sep 17 00:00:00 2001
> From: Dmitry Antipov <dmitry.antipov@linaro.org>
> Date: Wed, 21 Dec 2011 11:05:27 +0400
> Subject: [PATCH] ohci-hcd: use usleep_range() instead of mdelay()
> 

You didn't sign off on this, and you failed to explain why this is
needed.

You also didn't use git-send-email, making it a pain to apply (why do I
need the duplicate headers in the email body?

So consider this patch totally ignored.

greg k-h



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ohci-hcd: ohci-hcd: use usleep_range() instead of mdelay()
  2011-12-21  7:07 [PATCH] ohci-hcd: ohci-hcd: use usleep_range() instead of mdelay() Dmitry Antipov
  2011-12-21 21:12 ` Greg KH
@ 2011-12-22  3:05 ` Alan Stern
  1 sibling, 0 replies; 3+ messages in thread
From: Alan Stern @ 2011-12-22  3:05 UTC (permalink / raw)
  To: Dmitry Antipov; +Cc: linaro-dev, patches, linux-usb, linux-kernel

On Wed, 21 Dec 2011, Dmitry Antipov wrote:

>  From ac60fe289eef3d81009f2b14a12acbac3e71878b Mon Sep 17 00:00:00 2001
> From: Dmitry Antipov <dmitry.antipov@linaro.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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-12-22  3:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-21  7:07 [PATCH] ohci-hcd: ohci-hcd: use usleep_range() instead of mdelay() Dmitry Antipov
2011-12-21 21:12 ` Greg KH
2011-12-22  3:05 ` Alan Stern

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).