* [PATCH] staging: fbtft: replace udelay with usleep_range
@ 2022-07-09 10:06 Christos Kollintzas
2022-07-09 10:30 ` Greg KH
0 siblings, 1 reply; 6+ messages in thread
From: Christos Kollintzas @ 2022-07-09 10:06 UTC (permalink / raw)
To: gregkh, dri-devel, linux-fbdev, linux-staging, linux-kernel
Adhere to Linux kernel coding style.
Reported by checkpatch:
CHECK: usleep_range is preferred over udelay
Signed-off-by: Christos Kollintzas <c.kollintzas.92@gmail.com>
---
drivers/staging/fbtft/fb_upd161704.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/drivers/staging/fbtft/fb_upd161704.c b/drivers/staging/fbtft/fb_upd161704.c
index c680160d6380..eeafbab4ace1 100644
--- a/drivers/staging/fbtft/fb_upd161704.c
+++ b/drivers/staging/fbtft/fb_upd161704.c
@@ -32,27 +32,27 @@ static int init_display(struct fbtft_par *par)
/* oscillator start */
write_reg(par, 0x003A, 0x0001); /*Oscillator 0: stop, 1: operation */
- udelay(100);
+ usleep_range(100, 110);
/* y-setting */
write_reg(par, 0x0024, 0x007B); /* amplitude setting */
- udelay(10);
+ usleep_range(10, 15);
write_reg(par, 0x0025, 0x003B); /* amplitude setting */
write_reg(par, 0x0026, 0x0034); /* amplitude setting */
- udelay(10);
+ usleep_range(10, 15);
write_reg(par, 0x0027, 0x0004); /* amplitude setting */
write_reg(par, 0x0052, 0x0025); /* circuit setting 1 */
- udelay(10);
+ usleep_range(10, 15);
write_reg(par, 0x0053, 0x0033); /* circuit setting 2 */
write_reg(par, 0x0061, 0x001C); /* adjustment V10 positive polarity */
- udelay(10);
+ usleep_range(10, 15);
write_reg(par, 0x0062, 0x002C); /* adjustment V9 negative polarity */
write_reg(par, 0x0063, 0x0022); /* adjustment V34 positive polarity */
- udelay(10);
+ usleep_range(10, 15);
write_reg(par, 0x0064, 0x0027); /* adjustment V31 negative polarity */
- udelay(10);
+ usleep_range(10, 15);
write_reg(par, 0x0065, 0x0014); /* adjustment V61 negative polarity */
- udelay(10);
+ usleep_range(10, 15);
write_reg(par, 0x0066, 0x0010); /* adjustment V61 negative polarity */
/* Basical clock for 1 line (BASECOUNT[7:0]) number specified */
@@ -60,7 +60,7 @@ static int init_display(struct fbtft_par *par)
/* Power supply setting */
write_reg(par, 0x0019, 0x0000); /* DC/DC output setting */
- udelay(200);
+ usleep_range(200, 210);
write_reg(par, 0x001A, 0x1000); /* DC/DC frequency setting */
write_reg(par, 0x001B, 0x0023); /* DC/DC rising setting */
write_reg(par, 0x001C, 0x0C01); /* Regulator voltage setting */
--
2.20.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] staging: fbtft: replace udelay with usleep_range
2022-07-09 10:06 [PATCH] staging: fbtft: replace udelay with usleep_range Christos Kollintzas
@ 2022-07-09 10:30 ` Greg KH
2022-07-10 13:00 ` Christos Kollintzas
0 siblings, 1 reply; 6+ messages in thread
From: Greg KH @ 2022-07-09 10:30 UTC (permalink / raw)
To: Christos Kollintzas; +Cc: dri-devel, linux-fbdev, linux-staging, linux-kernel
On Sat, Jul 09, 2022 at 01:06:56PM +0300, Christos Kollintzas wrote:
> Adhere to Linux kernel coding style.
>
> Reported by checkpatch:
>
> CHECK: usleep_range is preferred over udelay
>
> Signed-off-by: Christos Kollintzas <c.kollintzas.92@gmail.com>
> ---
> drivers/staging/fbtft/fb_upd161704.c | 18 +++++++++---------
> 1 file changed, 9 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/staging/fbtft/fb_upd161704.c b/drivers/staging/fbtft/fb_upd161704.c
> index c680160d6380..eeafbab4ace1 100644
> --- a/drivers/staging/fbtft/fb_upd161704.c
> +++ b/drivers/staging/fbtft/fb_upd161704.c
> @@ -32,27 +32,27 @@ static int init_display(struct fbtft_par *par)
>
> /* oscillator start */
> write_reg(par, 0x003A, 0x0001); /*Oscillator 0: stop, 1: operation */
> - udelay(100);
> + usleep_range(100, 110);
When doing these types of changes, you really need access to the
hardware involved in order to be able to properly test it.
Especially for this type of function which is trying to do timing
changes which the hardware requires.
Did you test this on the real hardware and did it work properly?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] staging: fbtft: replace udelay with usleep_range
2022-07-09 10:30 ` Greg KH
@ 2022-07-10 13:00 ` Christos Kollintzas
0 siblings, 0 replies; 6+ messages in thread
From: Christos Kollintzas @ 2022-07-10 13:00 UTC (permalink / raw)
To: Greg KH; +Cc: dri-devel, linux-fbdev, linux-staging, linux-kernel
On Sat, Jul 09, 2022 at 12:30:51PM +0200, Greg KH wrote:
> On Sat, Jul 09, 2022 at 01:06:56PM +0300, Christos Kollintzas wrote:
> > Adhere to Linux kernel coding style.
> >
> > Reported by checkpatch:
> >
> > CHECK: usleep_range is preferred over udelay
> >
> > Signed-off-by: Christos Kollintzas <c.kollintzas.92@gmail.com>
> > ---
> > drivers/staging/fbtft/fb_upd161704.c | 18 +++++++++---------
> > 1 file changed, 9 insertions(+), 9 deletions(-)
> >
> > diff --git a/drivers/staging/fbtft/fb_upd161704.c b/drivers/staging/fbtft/fb_upd161704.c
> > index c680160d6380..eeafbab4ace1 100644
> > --- a/drivers/staging/fbtft/fb_upd161704.c
> > +++ b/drivers/staging/fbtft/fb_upd161704.c
> > @@ -32,27 +32,27 @@ static int init_display(struct fbtft_par *par)
> >
> > /* oscillator start */
> > write_reg(par, 0x003A, 0x0001); /*Oscillator 0: stop, 1: operation */
> > - udelay(100);
> > + usleep_range(100, 110);
>
> When doing these types of changes, you really need access to the
> hardware involved in order to be able to properly test it.
>
> Especially for this type of function which is trying to do timing
> changes which the hardware requires.
>
> Did you test this on the real hardware and did it work properly?
>
> thanks,
>
> greg k-h
I did not.
I will try to find the hardware and send a patch that is
properly tested.
thanks,
Christos Kollintzas
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] staging: fbtft: replace udelay with usleep_range
@ 2026-01-15 8:40 WooYoung Jeon
2026-01-15 8:47 ` Andy Shevchenko
2026-01-15 8:59 ` Greg Kroah-Hartman
0 siblings, 2 replies; 6+ messages in thread
From: WooYoung Jeon @ 2026-01-15 8:40 UTC (permalink / raw)
To: Andy Shevchenko, Greg Kroah-Hartman
Cc: dri-devel, linux-fbdev, linux-staging, linux-kernel,
WooYoung Jeon
In the fb_ra8875 driver, udelay(100) is used for delay which
causes busy-waiting. Replacing it with usleep_range(100, 120)
allows the CPU to sleep during the delay, improving system
resource efficiency.
This change was suggested by checkpatch.pl.
Signed-off-by: WooYoung Jeon <chococookieman1@gmail.com>
---
drivers/staging/fbtft/fb_ra8875.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/fbtft/fb_ra8875.c b/drivers/staging/fbtft/fb_ra8875.c
index 0ab1de664..92c9e4e03 100644
--- a/drivers/staging/fbtft/fb_ra8875.c
+++ b/drivers/staging/fbtft/fb_ra8875.c
@@ -210,7 +210,7 @@ static void write_reg8_bus8(struct fbtft_par *par, int len, ...)
}
len--;
- udelay(100);
+ usleep_range(100, 120);
if (len) {
buf = (u8 *)par->buf;
--
2.43.0
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [PATCH] staging: fbtft: replace udelay with usleep_range
2026-01-15 8:40 WooYoung Jeon
@ 2026-01-15 8:47 ` Andy Shevchenko
2026-01-15 8:59 ` Greg Kroah-Hartman
1 sibling, 0 replies; 6+ messages in thread
From: Andy Shevchenko @ 2026-01-15 8:47 UTC (permalink / raw)
To: WooYoung Jeon
Cc: Andy Shevchenko, Greg Kroah-Hartman, dri-devel, linux-fbdev,
linux-staging, linux-kernel
On Thu, Jan 15, 2026 at 05:40:19PM +0900, WooYoung Jeon wrote:
> In the fb_ra8875 driver, udelay(100) is used for delay which
> causes busy-waiting. Replacing it with usleep_range(100, 120)
> allows the CPU to sleep during the delay, improving system
> resource efficiency.
>
> This change was suggested by checkpatch.pl.
Without HW test it's no go. See the previous attempts to "fix" the same place
over and over. (https://lore.kernel.org/ is at your service to dive into mail
archives)
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] staging: fbtft: replace udelay with usleep_range
2026-01-15 8:40 WooYoung Jeon
2026-01-15 8:47 ` Andy Shevchenko
@ 2026-01-15 8:59 ` Greg Kroah-Hartman
1 sibling, 0 replies; 6+ messages in thread
From: Greg Kroah-Hartman @ 2026-01-15 8:59 UTC (permalink / raw)
To: WooYoung Jeon
Cc: Andy Shevchenko, dri-devel, linux-fbdev, linux-staging,
linux-kernel
On Thu, Jan 15, 2026 at 05:40:19PM +0900, WooYoung Jeon wrote:
> In the fb_ra8875 driver, udelay(100) is used for delay which
> causes busy-waiting. Replacing it with usleep_range(100, 120)
> allows the CPU to sleep during the delay, improving system
> resource efficiency.
>
> This change was suggested by checkpatch.pl.
>
> Signed-off-by: WooYoung Jeon <chococookieman1@gmail.com>
> ---
> drivers/staging/fbtft/fb_ra8875.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/fbtft/fb_ra8875.c b/drivers/staging/fbtft/fb_ra8875.c
> index 0ab1de664..92c9e4e03 100644
> --- a/drivers/staging/fbtft/fb_ra8875.c
> +++ b/drivers/staging/fbtft/fb_ra8875.c
> @@ -210,7 +210,7 @@ static void write_reg8_bus8(struct fbtft_par *par, int len, ...)
> }
> len--;
>
> - udelay(100);
> + usleep_range(100, 120);
>
> if (len) {
> buf = (u8 *)par->buf;
> --
> 2.43.0
>
Hi,
This is the friendly patch-bot of Greg Kroah-Hartman. You have sent him
a patch that has triggered this response. He used to manually respond
to these common problems, but in order to save his sanity (he kept
writing the same thing over and over, yet to different people), I was
created. Hopefully you will not take offence and will fix the problem
in your patch and resubmit it so that it can be accepted into the Linux
kernel tree.
You are receiving this message because of the following common error(s)
as indicated below:
- You sent a patch that has been sent multiple times in the past and is
identical to ones that have been rejected. Please always look at the
mailing list traffic to determine if you are duplicating other
people's work.
If you wish to discuss this problem further, or you have questions about
how to resolve this issue, please feel free to respond to this email and
Greg will reply once he has dug out from the pending patches received
from other developers.
thanks,
greg k-h's patch email bot
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-01-15 9:00 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-09 10:06 [PATCH] staging: fbtft: replace udelay with usleep_range Christos Kollintzas
2022-07-09 10:30 ` Greg KH
2022-07-10 13:00 ` Christos Kollintzas
-- strict thread matches above, loose matches on Subject: below --
2026-01-15 8:40 WooYoung Jeon
2026-01-15 8:47 ` Andy Shevchenko
2026-01-15 8:59 ` Greg Kroah-Hartman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox