Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1238457 > unrolled thread

Re: [PATCH 06/14] RFC: usb/host/fotg210: replace msleep by usleep_range

Started byFelipe Balbi <balbi@ti.com>
First post2015-10-02 19:40 +0200
Last post2015-10-04 17:30 +0200
Articles 4 — 3 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH 06/14] RFC: usb/host/fotg210: replace msleep by  usleep_range Felipe Balbi <balbi@ti.com> - 2015-10-02 19:40 +0200
    Re: [PATCH 06/14] RFC: usb/host/fotg210: replace msleep by usleep_range Alan Stern <stern@rowland.harvard.edu> - 2015-10-02 20:00 +0200
      Re: [PATCH 06/14] RFC: usb/host/fotg210: replace msleep by usleep_range Peter Senna Tschudin <peter.senna@gmail.com> - 2015-10-04 12:00 +0200
        Re: [PATCH 06/14] RFC: usb/host/fotg210: replace msleep by usleep_range Alan Stern <stern@rowland.harvard.edu> - 2015-10-04 17:30 +0200

#1238457 — Re: [PATCH 06/14] RFC: usb/host/fotg210: replace msleep by usleep_range

FromFelipe Balbi <balbi@ti.com>
Date2015-10-02 19:40 +0200
SubjectRe: [PATCH 06/14] RFC: usb/host/fotg210: replace msleep by usleep_range
Message-ID<qfctl-1MB-35@gated-at.bofh.it>

[Multipart message — attachments visible in raw view] — view raw

On Mon, Sep 21, 2015 at 05:01:10PM +0200, Peter Senna Tschudin wrote:
> msleep under 20ms can result in sleeping up to 20ms, which may not be
> intended. Replace msleep(5) by usleep_range(5000, 6000).
> 
> Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>

good catch. I'd apply this straight away. Alan ?

> ---
>  drivers/usb/host/fotg210-hcd.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/host/fotg210-hcd.c b/drivers/usb/host/fotg210-hcd.c
> index e7e9991..55c2279 100644
> --- a/drivers/usb/host/fotg210-hcd.c
> +++ b/drivers/usb/host/fotg210-hcd.c
> @@ -5122,7 +5122,7 @@ static int fotg210_run(struct usb_hcd *hcd)
>  	fotg210->rh_state = FOTG210_RH_RUNNING;
>  	/* unblock posted writes */
>  	fotg210_readl(fotg210, &fotg210->regs->command);
> -	msleep(5);
> +	usleep_range(5000, 6000);
>  	up_write(&ehci_cf_port_reset_rwsem);
>  	fotg210->last_periodic_enable = ktime_get_real();
>  
> -- 
> 2.1.0
> 

-- 
balbi

[toc] | [next] | [standalone]


#1238491 — Re: [PATCH 06/14] RFC: usb/host/fotg210: replace msleep by usleep_range

FromAlan Stern <stern@rowland.harvard.edu>
Date2015-10-02 20:00 +0200
SubjectRe: [PATCH 06/14] RFC: usb/host/fotg210: replace msleep by usleep_range
Message-ID<qfcMJ-29a-51@gated-at.bofh.it>
In reply to#1238457
On Fri, 2 Oct 2015, Felipe Balbi wrote:

> On Mon, Sep 21, 2015 at 05:01:10PM +0200, Peter Senna Tschudin wrote:
> > msleep under 20ms can result in sleeping up to 20ms, which may not be
> > intended. Replace msleep(5) by usleep_range(5000, 6000).
> > 
> > Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
> 
> good catch. I'd apply this straight away. Alan ?

It really doesn't matter.  As long as the delay is at least 5 ms, it
can be arbitrarily long.  This won't hurt, and if it prevents automated
tools from complaining then it's worthwhile.

Peter, a lot of the changes you have been making will also apply to the 
ehci-hcd driver.  Do you want to update it as well?  One caution: The 
style used for continuation lines is to add two extra tab stops, not to 
align things with an open paren on the original line.

Alan Stern

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

[toc] | [prev] | [next] | [standalone]


#1239083 — Re: [PATCH 06/14] RFC: usb/host/fotg210: replace msleep by usleep_range

FromPeter Senna Tschudin <peter.senna@gmail.com>
Date2015-10-04 12:00 +0200
SubjectRe: [PATCH 06/14] RFC: usb/host/fotg210: replace msleep by usleep_range
Message-ID<qfOff-5eb-1@gated-at.bofh.it>
In reply to#1238491
On Fri, Oct 2, 2015 at 7:52 PM, Alan Stern <stern@rowland.harvard.edu> wrote:
> On Fri, 2 Oct 2015, Felipe Balbi wrote:
>
>> On Mon, Sep 21, 2015 at 05:01:10PM +0200, Peter Senna Tschudin wrote:
>> > msleep under 20ms can result in sleeping up to 20ms, which may not be
>> > intended. Replace msleep(5) by usleep_range(5000, 6000).
>> >
>> > Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
>>
>> good catch. I'd apply this straight away. Alan ?
>
> It really doesn't matter.  As long as the delay is at least 5 ms, it
> can be arbitrarily long.  This won't hurt, and if it prevents automated
> tools from complaining then it's worthwhile.
Then is it a good idea to increase the range to reduce chances of
creating an interrupt?

usleep_range(5000, 10000)?

>
> Peter, a lot of the changes you have been making will also apply to the
> ehci-hcd driver.  Do you want to update it as well?  One caution: The
> style used for continuation lines is to add two extra tab stops, not to
> align things with an open paren on the original line.
The drivers with more checkpatch errors and warnings are:

<number of errors> <number of warnings> <path>

117 586 drivers/usb/host/fusbh200-hcd.c
38 124 drivers/usb/host/ohci-q.c
38 122 drivers/usb/host/ehci-dbg.c
37 118 drivers/usb/host/ohci-dbg.c
36 129 drivers/usb/host/ehci-sched.c
24 136 drivers/usb/host/ohci-hcd.c
23 16 drivers/usb/host/sl811-hcd.c
20 105 drivers/usb/host/ohci-hub.c
18 48 drivers/usb/host/ehci-hub.c

17 70 drivers/usb/host/ehci-hcd.c

13 4 drivers/usb/host/uhci-debug.c
12 93 drivers/usb/host/ehci-q.c
9 83 drivers/usb/host/isp116x-hcd.c
9 32 drivers/usb/host/fotg210-hcd.c
7 29 drivers/usb/host/oxu210hp-hcd.c
6 4 drivers/usb/host/sl811_cs.c

I'll fix ehci-hcd. Do you want patches for the others?

I'll fix the alignment using two extra tabs instead of aligning with
opening parenthesis. Thank you.


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

[toc] | [prev] | [next] | [standalone]


#1239142 — Re: [PATCH 06/14] RFC: usb/host/fotg210: replace msleep by usleep_range

FromAlan Stern <stern@rowland.harvard.edu>
Date2015-10-04 17:30 +0200
SubjectRe: [PATCH 06/14] RFC: usb/host/fotg210: replace msleep by usleep_range
Message-ID<qfToB-4fU-3@gated-at.bofh.it>
In reply to#1239083
On Sun, 4 Oct 2015, Peter Senna Tschudin wrote:

> On Fri, Oct 2, 2015 at 7:52 PM, Alan Stern <stern@rowland.harvard.edu> wrote:
> > On Fri, 2 Oct 2015, Felipe Balbi wrote:
> >
> >> On Mon, Sep 21, 2015 at 05:01:10PM +0200, Peter Senna Tschudin wrote:
> >> > msleep under 20ms can result in sleeping up to 20ms, which may not be
> >> > intended. Replace msleep(5) by usleep_range(5000, 6000).
> >> >
> >> > Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
> >>
> >> good catch. I'd apply this straight away. Alan ?
> >
> > It really doesn't matter.  As long as the delay is at least 5 ms, it
> > can be arbitrarily long.  This won't hurt, and if it prevents automated
> > tools from complaining then it's worthwhile.
> Then is it a good idea to increase the range to reduce chances of
> creating an interrupt?
> 
> usleep_range(5000, 10000)?

That wold be okay.

> > Peter, a lot of the changes you have been making will also apply to the
> > ehci-hcd driver.  Do you want to update it as well?  One caution: The
> > style used for continuation lines is to add two extra tab stops, not to
> > align things with an open paren on the original line.
> The drivers with more checkpatch errors and warnings are:
> 
> <number of errors> <number of warnings> <path>
> 
> 117 586 drivers/usb/host/fusbh200-hcd.c
> 38 124 drivers/usb/host/ohci-q.c
> 38 122 drivers/usb/host/ehci-dbg.c
> 37 118 drivers/usb/host/ohci-dbg.c
> 36 129 drivers/usb/host/ehci-sched.c
> 24 136 drivers/usb/host/ohci-hcd.c
> 23 16 drivers/usb/host/sl811-hcd.c
> 20 105 drivers/usb/host/ohci-hub.c
> 18 48 drivers/usb/host/ehci-hub.c
> 
> 17 70 drivers/usb/host/ehci-hcd.c
> 
> 13 4 drivers/usb/host/uhci-debug.c
> 12 93 drivers/usb/host/ehci-q.c
> 9 83 drivers/usb/host/isp116x-hcd.c
> 9 32 drivers/usb/host/fotg210-hcd.c
> 7 29 drivers/usb/host/oxu210hp-hcd.c
> 6 4 drivers/usb/host/sl811_cs.c
> 
> I'll fix ehci-hcd. Do you want patches for the others?

I was speaking of ehci-*.c, because the code in there is extremely
similar to the code you've already been working on.

There's no point in trying to fix _all_ those checkpatch violations.  A 
lot of them are trivial things like an extra space character between a 
function name and the following left paren.

Alan Stern

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

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web