* [PATCH] staging: nvec: Replace udelay by usleep_range
@ 2017-03-07 12:52 Sreya Mittal
2017-03-07 15:52 ` [Outreachy kernel] " Julia Lawall
0 siblings, 1 reply; 6+ messages in thread
From: Sreya Mittal @ 2017-03-07 12:52 UTC (permalink / raw)
To: outreachy-kernel; +Cc: Sreya Mittal, Marc Dietrich, Greg Kroah-Hartman
Replace udelay by usleep_range.
Fixes the checkpatch issue:
usleep_range is preferred over udelay
In Documentation/timers/timers-howto.txt,
it is mentioned that udelay should be used
for a few microseconds(less than 10), and
usleep_range should be preferred for 10
microseconds to 20 milliseconds.
Signed-off-by: Sreya Mittal <sreyamittal5@gmail.com>
---
drivers/staging/nvec/nvec.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/nvec/nvec.c b/drivers/staging/nvec/nvec.c
index c1feccf..5fab241 100644
--- a/drivers/staging/nvec/nvec.c
+++ b/drivers/staging/nvec/nvec.c
@@ -631,7 +631,7 @@ static irqreturn_t nvec_interrupt(int irq, void *dev)
break;
case 2: /* first byte after command */
if (status == (I2C_SL_IRQ | RNW | RCVD)) {
- udelay(33);
+ usleep_range(33, 43);
if (nvec->rx->data[0] != 0x01) {
dev_err(nvec->dev,
"Read without prior read command\n");
@@ -718,7 +718,7 @@ static irqreturn_t nvec_interrupt(int irq, void *dev)
* We experience less incomplete messages with this delay than without
* it, but we don't know why. Help is appreciated.
*/
- udelay(100);
+ usleep_range(100,200);
return IRQ_HANDLED;
}
--
2.9.3
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [Outreachy kernel] [PATCH] staging: nvec: Replace udelay by usleep_range
2017-03-07 12:52 [PATCH] staging: nvec: Replace udelay by usleep_range Sreya Mittal
@ 2017-03-07 15:52 ` Julia Lawall
2017-03-07 19:14 ` Sreya Mittal
0 siblings, 1 reply; 6+ messages in thread
From: Julia Lawall @ 2017-03-07 15:52 UTC (permalink / raw)
To: Sreya Mittal; +Cc: outreachy-kernel, Marc Dietrich, Greg Kroah-Hartman
On Tue, 7 Mar 2017, Sreya Mittal wrote:
> Replace udelay by usleep_range.
> Fixes the checkpatch issue:
> usleep_range is preferred over udelay
>
> In Documentation/timers/timers-howto.txt,
> it is mentioned that udelay should be used
> for a few microseconds(less than 10), and
> usleep_range should be preferred for 10
> microseconds to 20 milliseconds.
>
> Signed-off-by: Sreya Mittal <sreyamittal5@gmail.com>
> ---
> drivers/staging/nvec/nvec.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/staging/nvec/nvec.c b/drivers/staging/nvec/nvec.c
> index c1feccf..5fab241 100644
> --- a/drivers/staging/nvec/nvec.c
> +++ b/drivers/staging/nvec/nvec.c
> @@ -631,7 +631,7 @@ static irqreturn_t nvec_interrupt(int irq, void *dev)
> break;
> case 2: /* first byte after command */
> if (status == (I2C_SL_IRQ | RNW | RCVD)) {
> - udelay(33);
> + usleep_range(33, 43);
The key point is how do you choose the upper bound. If you don't have a
good rationale for your choice, it would be better not to make the change.
julia
> if (nvec->rx->data[0] != 0x01) {
> dev_err(nvec->dev,
> "Read without prior read command\n");
> @@ -718,7 +718,7 @@ static irqreturn_t nvec_interrupt(int irq, void *dev)
> * We experience less incomplete messages with this delay than without
> * it, but we don't know why. Help is appreciated.
> */
> - udelay(100);
> + usleep_range(100,200);
>
> return IRQ_HANDLED;
> }
> --
> 2.9.3
>
> --
> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20170307125256.3998-1-sreyamittal5%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Outreachy kernel] [PATCH] staging: nvec: Replace udelay by usleep_range
2017-03-07 15:52 ` [Outreachy kernel] " Julia Lawall
@ 2017-03-07 19:14 ` Sreya Mittal
2017-03-07 20:47 ` [Outreachy kernel] [PATCH] staging: nvec: Replace udelay byusleep_range Marc Dietrich
0 siblings, 1 reply; 6+ messages in thread
From: Sreya Mittal @ 2017-03-07 19:14 UTC (permalink / raw)
To: outreachy-kernel; +Cc: sreyamittal5, marvin24, gregkh
[-- Attachment #1.1: Type: text/plain, Size: 2645 bytes --]
On Tuesday, March 7, 2017 at 9:22:16 PM UTC+5:30, Julia Lawall wrote:
>
>
>
> On Tue, 7 Mar 2017, Sreya Mittal wrote:
>
> > Replace udelay by usleep_range.
> > Fixes the checkpatch issue:
> > usleep_range is preferred over udelay
> >
> > In Documentation/timers/timers-howto.txt,
> > it is mentioned that udelay should be used
> > for a few microseconds(less than 10), and
> > usleep_range should be preferred for 10
> > microseconds to 20 milliseconds.
> >
> > Signed-off-by: Sreya Mittal <sreyam...@gmail.com <javascript:>>
> > ---
> > drivers/staging/nvec/nvec.c | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/staging/nvec/nvec.c b/drivers/staging/nvec/nvec.c
> > index c1feccf..5fab241 100644
> > --- a/drivers/staging/nvec/nvec.c
> > +++ b/drivers/staging/nvec/nvec.c
> > @@ -631,7 +631,7 @@ static irqreturn_t nvec_interrupt(int irq, void
> *dev)
> > break;
> > case 2: /* first byte after command */
> > if (status == (I2C_SL_IRQ | RNW | RCVD)) {
> > - udelay(33);
> > + usleep_range(33, 43);
>
> The key point is how do you choose the upper bound. If you don't have a
> good rationale for your choice, it would be better not to make the change.
>
Could you please give some hint(s) regarding the choice of upper bound and
what possibly can be a good rationale for it?
Sreya
>
> julia
>
> > if (nvec->rx->data[0] != 0x01) {
> > dev_err(nvec->dev,
> > "Read without prior read
> command\n");
> > @@ -718,7 +718,7 @@ static irqreturn_t nvec_interrupt(int irq, void
> *dev)
> > * We experience less incomplete messages with this delay than
> without
> > * it, but we don't know why. Help is appreciated.
> > */
> > - udelay(100);
> > + usleep_range(100,200);
> >
> > return IRQ_HANDLED;
> > }
> > --
> > 2.9.3
> >
> > --
> > You received this message because you are subscribed to the Google
> Groups "outreachy-kernel" group.
> > To unsubscribe from this group and stop receiving emails from it, send
> an email to outreachy-kern...@googlegroups.com <javascript:>.
> > To post to this group, send email to outreach...@googlegroups.com
> <javascript:>.
> > To view this discussion on the web visit
> https://groups.google.com/d/msgid/outreachy-kernel/20170307125256.3998-1-sreyamittal5%40gmail.com.
>
> > For more options, visit https://groups.google.com/d/optout.
> >
>
[-- Attachment #1.2: Type: text/html, Size: 4809 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Outreachy kernel] [PATCH] staging: nvec: Replace udelay byusleep_range
2017-03-07 19:14 ` Sreya Mittal
@ 2017-03-07 20:47 ` Marc Dietrich
2017-03-07 21:21 ` Sreya Mittal
0 siblings, 1 reply; 6+ messages in thread
From: Marc Dietrich @ 2017-03-07 20:47 UTC (permalink / raw)
To: Sreya Mittal; +Cc: outreachy-kernel, gregkh, Julia Lawall
[-- Attachment #1.1: Type: text/plain, Size: 3180 bytes --]
Am Dienstag, 7. März 2017, 20:14:06 CET schrieb Sreya Mittal:
> On Tuesday, March 7, 2017 at 9:22:16 PM UTC+5:30, Julia Lawall wrote:
> > On Tue, 7 Mar 2017, Sreya Mittal wrote:
> > > Replace udelay by usleep_range.
> > > Fixes the checkpatch issue:
> > > usleep_range is preferred over udelay
> > >
> > > In Documentation/timers/timers-howto.txt,
> > > it is mentioned that udelay should be used
> > > for a few microseconds(less than 10), and
> > > usleep_range should be preferred for 10
> > > microseconds to 20 milliseconds.
> > >
> > > Signed-off-by: Sreya Mittal <sreyam...@gmail.com <javascript:>>
> > > ---
> > >
> > > drivers/staging/nvec/nvec.c | 4 ++--
> > > 1 file changed, 2 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/drivers/staging/nvec/nvec.c b/drivers/staging/nvec/nvec.c
> > > index c1feccf..5fab241 100644
> > > --- a/drivers/staging/nvec/nvec.c
> > > +++ b/drivers/staging/nvec/nvec.c
> > > @@ -631,7 +631,7 @@ static irqreturn_t nvec_interrupt(int irq, void
> >
> > *dev)
> >
> > > break;
> > >
> > > case 2: /* first byte after command */
> > >
> > > if (status == (I2C_SL_IRQ | RNW | RCVD)) {
> > >
> > > - udelay(33);
> > > + usleep_range(33, 43);
> >
> > The key point is how do you choose the upper bound. If you don't have a
> > good rationale for your choice, it would be better not to make the change.
>
> Could you please give some hint(s) regarding the choice of upper bound and
> what possibly can be a good rationale for it?
I n'acked a similar patch a few days ago. See https://lkml.org/lkml/2017/3/2/293.
Maybe it would be good to add a hint to the relevant tutorials to first check if a similar patch
has been submitted before.
Marc
Sreya
>
> > julia
> >
> > > if (nvec->rx->data[0] != 0x01) {
> > >
> > > dev_err(nvec->dev,
> > >
> > > "Read without prior read
> >
> > command\n");
> >
> > > @@ -718,7 +718,7 @@ static irqreturn_t nvec_interrupt(int irq, void
> >
> > *dev)
> >
> > > * We experience less incomplete messages with this delay than
> >
> > without
> >
> > > * it, but we don't know why. Help is appreciated.
> > > */
> > >
> > > - udelay(100);
> > > + usleep_range(100,200);
> > >
> > > return IRQ_HANDLED;
> > >
> > > }
> >
> > Groups "outreachy-kernel" group.
> >
> > > To unsubscribe from this group and stop receiving emails from it, send
> >
> > an email to outreachy-kern...@googlegroups.com <javascript:>.
> >
> > > To post to this group, send email to outreach...@googlegroups.com
> >
> > <javascript:>.
> >
> > > To view this discussion on the web visit
> >
> > https://groups.google.com/d/msgid/outreachy-kernel/20170307125256.3998-1-s
> > reyamittal5%40gmail.com.>
> > > For more options, visit https://groups.google.com/d/optout.
[-- Attachment #1.2: Type: text/html, Size: 17823 bytes --]
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Outreachy kernel] [PATCH] staging: nvec: Replace udelay byusleep_range
2017-03-07 20:47 ` [Outreachy kernel] [PATCH] staging: nvec: Replace udelay byusleep_range Marc Dietrich
@ 2017-03-07 21:21 ` Sreya Mittal
2017-03-07 21:32 ` Julia Lawall
0 siblings, 1 reply; 6+ messages in thread
From: Sreya Mittal @ 2017-03-07 21:21 UTC (permalink / raw)
To: outreachy-kernel; +Cc: sreyamittal5, gregkh, julia.lawall, marvin24
[-- Attachment #1.1: Type: text/plain, Size: 3566 bytes --]
On Wednesday, March 8, 2017 at 2:17:36 AM UTC+5:30, Marc Dietrich wrote:
>
> Am Dienstag, 7. März 2017, 20:14:06 CET schrieb Sreya Mittal:
>
> > On Tuesday, March 7, 2017 at 9:22:16 PM UTC+5:30, Julia Lawall wrote:
>
> > > On Tue, 7 Mar 2017, Sreya Mittal wrote:
>
> > > > Replace udelay by usleep_range.
>
> > > > Fixes the checkpatch issue:
>
> > > > usleep_range is preferred over udelay
>
> > > >
>
> > > > In Documentation/timers/timers-howto.txt,
>
> > > > it is mentioned that udelay should be used
>
> > > > for a few microseconds(less than 10), and
>
> > > > usleep_range should be preferred for 10
>
> > > > microseconds to 20 milliseconds.
>
> > > >
>
> > > > Signed-off-by: Sreya Mittal <sreyam...@gmail.com <javascript:>>
>
> > > > ---
>
> > > >
>
> > > > drivers/staging/nvec/nvec.c | 4 ++--
>
> > > > 1 file changed, 2 insertions(+), 2 deletions(-)
>
> > > >
>
> > > > diff --git a/drivers/staging/nvec/nvec.c
> b/drivers/staging/nvec/nvec.c
>
> > > > index c1feccf..5fab241 100644
>
> > > > --- a/drivers/staging/nvec/nvec.c
>
> > > > +++ b/drivers/staging/nvec/nvec.c
>
> > > > @@ -631,7 +631,7 @@ static irqreturn_t nvec_interrupt(int irq, void
>
> > >
>
> > > *dev)
>
> > >
>
> > > > break;
>
> > > >
>
> > > > case 2: /* first byte after command */
>
> > > >
>
> > > > if (status == (I2C_SL_IRQ | RNW | RCVD)) {
>
> > > >
>
> > > > - udelay(33);
>
> > > > + usleep_range(33, 43);
>
> > >
>
> > > The key point is how do you choose the upper bound. If you don't have a
>
> > > good rationale for your choice, it would be better not to make the
> change.
>
> >
>
> > Could you please give some hint(s) regarding the choice of upper bound
> and
>
> > what possibly can be a good rationale for it?
>
>
>
> I n'acked a similar patch a few days ago. See
> https://lkml.org/lkml/2017/3/2/293.
>
>
>
> Maybe it would be good to add a hint to the relevant tutorials to first
> check if a similar patch has been submitted before.
>
>
>
> Marc
>
Hi,
Thank you for the link. My bad that I didn't check whether a similar patch
has been submitted before.
Sreya
>
>
> Sreya
>
>
>
> >
>
> > > julia
>
> > >
>
> > > > if (nvec->rx->data[0] != 0x01) {
>
> > > >
>
> > > > dev_err(nvec->dev,
>
> > > >
>
> > > > "Read without prior read
>
> > >
>
> > > command\n");
>
> > >
>
> > > > @@ -718,7 +718,7 @@ static irqreturn_t nvec_interrupt(int irq, void
>
> > >
>
> > > *dev)
>
> > >
>
> > > > * We experience less incomplete messages with this delay than
>
> > >
>
> > > without
>
> > >
>
> > > > * it, but we don't know why. Help is appreciated.
>
> > > > */
>
> > > >
>
> > > > - udelay(100);
>
> > > > + usleep_range(100,200);
>
> > > >
>
> > > > return IRQ_HANDLED;
>
> > > >
>
> > > > }
>
> > >
>
> > > Groups "outreachy-kernel" group.
>
> > >
>
> > > > To unsubscribe from this group and stop receiving emails from it,
> send
>
> > >
>
> > > an email to outreachy-kern...@googlegroups.com <javascript:>.
>
> > >
>
> > > > To post to this group, send email to outreach...@googlegroups.com
>
> > >
>
> > > <javascript:>.
>
> > >
>
> > > > To view this discussion on the web visit
>
> > >
>
> > >
> https://groups.google.com/d/msgid/outreachy-kernel/20170307125256.3998-1-s
>
> > > reyamittal5%40gmail.com.>
>
> > > > For more options, visit https://groups.google.com/d/optout.
>
>
>
>
>
[-- Attachment #1.2: Type: text/html, Size: 15437 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Outreachy kernel] [PATCH] staging: nvec: Replace udelay byusleep_range
2017-03-07 21:21 ` Sreya Mittal
@ 2017-03-07 21:32 ` Julia Lawall
0 siblings, 0 replies; 6+ messages in thread
From: Julia Lawall @ 2017-03-07 21:32 UTC (permalink / raw)
To: Sreya Mittal; +Cc: outreachy-kernel, gregkh, marvin24
[-- Attachment #1: Type: text/plain, Size: 4687 bytes --]
On Tue, 7 Mar 2017, Sreya Mittal wrote:
>
>
> On Wednesday, March 8, 2017 at 2:17:36 AM UTC+5:30, Marc Dietrich wrote:
>
> Am Dienstag, 7. März 2017, 20:14:06 CET schrieb Sreya Mittal:
>
> > On Tuesday, March 7, 2017 at 9:22:16 PM UTC+5:30, Julia Lawall
> wrote:
>
> > > On Tue, 7 Mar 2017, Sreya Mittal wrote:
>
> > > > Replace udelay by usleep_range.
>
> > > > Fixes the checkpatch issue:
>
> > > > usleep_range is preferred over udelay
>
> > > >
>
> > > > In Documentation/timers/timers-howto.txt,
>
> > > > it is mentioned that udelay should be used
>
> > > > for a few microseconds(less than 10), and
>
> > > > usleep_range should be preferred for 10
>
> > > > microseconds to 20 milliseconds.
>
> > > >
>
> > > > Signed-off-by: Sreya Mittal <sreyam...@gmail.com
> <javascript:>>
>
> > > > ---
>
> > > >
>
> > > > drivers/staging/nvec/nvec.c | 4 ++--
>
> > > > 1 file changed, 2 insertions(+), 2 deletions(-)
>
> > > >
>
> > > > diff --git a/drivers/staging/nvec/nvec.c
> b/drivers/staging/nvec/nvec.c
>
> > > > index c1feccf..5fab241 100644
>
> > > > --- a/drivers/staging/nvec/nvec.c
>
> > > > +++ b/drivers/staging/nvec/nvec.c
>
> > > > @@ -631,7 +631,7 @@ static irqreturn_t nvec_interrupt(int
> irq, void
>
> > >
>
> > > *dev)
>
> > >
>
> > > > break;
>
> > > >
>
> > > > case 2: /* first byte after command */
>
> > > >
>
> > > > if (status == (I2C_SL_IRQ | RNW | RCVD)) {
>
> > > >
>
> > > > - udelay(33);
>
> > > > + usleep_range(33, 43);
>
> > >
>
> > > The key point is how do you choose the upper bound. If you
> don't have a
>
> > > good rationale for your choice, it would be better not to
> make the change.
>
> >
>
> > Could you please give some hint(s) regarding the choice of
> upper bound and
>
> > what possibly can be a good rationale for it?
>
>
>
> I n'acked a similar patch a few days ago. See
> https://lkml.org/lkml/2017/3/2/293.
>
>
>
> Maybe it would be good to add a hint to the relevant tutorials
> to first check if a similar patch has been submitted before.
I have added some text to this effect. Thank you for the suggestion.
julia
>
>
>
> Marc
>
>
> Hi,
>
> Thank you for the link. My bad that I didn't check whether a similar patch
> has been submitted before.
>
> Sreya
>
>
>
>
> Sreya
>
>
>
> >
>
> > > julia
>
> > >
>
> > > > if (nvec->rx->data[0] != 0x01) {
>
> > > >
>
> > > > dev_err(nvec->dev,
>
> > > >
>
> > > > "Read without prior read
>
> > >
>
> > > command\n");
>
> > >
>
> > > > @@ -718,7 +718,7 @@ static irqreturn_t nvec_interrupt(int
> irq, void
>
> > >
>
> > > *dev)
>
> > >
>
> > > > * We experience less incomplete messages with this delay
> than
>
> > >
>
> > > without
>
> > >
>
> > > > * it, but we don't know why. Help is appreciated.
>
> > > > */
>
> > > >
>
> > > > - udelay(100);
>
> > > > + usleep_range(100,200);
>
> > > >
>
> > > > return IRQ_HANDLED;
>
> > > >
>
> > > > }
>
> > >
>
> > > Groups "outreachy-kernel" group.
>
> > >
>
> > > > To unsubscribe from this group and stop receiving emails
> from it, send
>
> > >
>
> > > an email to outreachy-kern...@googlegroups.com
> <javascript:>.
>
> > >
>
> > > > To post to this group, send email to
> outreach...@googlegroups.com
>
> > >
>
> > > <javascript:>.
>
> > >
>
> > > > To view this discussion on the web visit
>
> > >
>
> > >
> https://groups.google.com/d/msgid/outreachy-kernel/20170307125256.3998-1-s
>
> > > reyamittal5%40gmail.com.>
>
> > > > For more options, visit
> https://groups.google.com/d/optout.
>
>
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visithttps://groups.google.com/d/msgid/outreachy-kernel/9c43c46e-93b5-46fd-ba6f-
> ccdf5929d380%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2017-03-07 21:32 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-07 12:52 [PATCH] staging: nvec: Replace udelay by usleep_range Sreya Mittal
2017-03-07 15:52 ` [Outreachy kernel] " Julia Lawall
2017-03-07 19:14 ` Sreya Mittal
2017-03-07 20:47 ` [Outreachy kernel] [PATCH] staging: nvec: Replace udelay byusleep_range Marc Dietrich
2017-03-07 21:21 ` Sreya Mittal
2017-03-07 21:32 ` Julia Lawall
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.