* [PATCH] staging: av7110: Replace msleep() with usleep_range() in tuner function
@ 2025-06-26 16:08 Pratibimba Khadka
2025-06-26 18:05 ` Dan Carpenter
0 siblings, 1 reply; 3+ messages in thread
From: Pratibimba Khadka @ 2025-06-26 16:08 UTC (permalink / raw)
To: mchehab
Cc: Pratibimba Khadka, Greg Kroah-Hartman, Al Viro,
open list:MEDIA INPUT INFRASTRUCTURE (V4L/DVB),
open list:STAGING SUBSYSTEM, open list
Replace msleep(10) with usleep_range(10000, 12000) in the PLL lock
waiting loop of nexusca_stv0297_tuner_set_params().
usleep_range() is preferred over msleep() for short delays (< 20ms) as
it provides better accuracy and allows the scheduler flexibility for
power management optimizations. The 10-12ms range maintains the same
timing behavior while giving the kernel scheduler room to optimize.
This change improves timing precision during the PLL lock detection
phase without affecting the overall functionality of the tuner
configuration process.
Signed-off-by: Pratibimba Khadka <pratibimbakhadka@gmail.com>
---
drivers/staging/media/av7110/av7110.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/media/av7110/av7110.c b/drivers/staging/media/av7110/av7110.c
index bc9a2a40afcb..7f6c610579c8 100644
--- a/drivers/staging/media/av7110/av7110.c
+++ b/drivers/staging/media/av7110/av7110.c
@@ -1827,7 +1827,7 @@ static int nexusca_stv0297_tuner_set_params(struct dvb_frontend *fe)
if (i2c_transfer(&av7110->i2c_adap, &readmsg, 1) == 1)
if (data[0] & 0x40)
break;
- msleep(10);
+ usleep_range(10000, 12000);
}
return 0;
--
2.49.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH] staging: av7110: Replace msleep() with usleep_range() in tuner function
@ 2025-06-26 17:27 Pratibimba Khadka
0 siblings, 0 replies; 3+ messages in thread
From: Pratibimba Khadka @ 2025-06-26 17:27 UTC (permalink / raw)
To: mchehab
Cc: Pratibimba Khadka, Greg Kroah-Hartman, Al Viro,
open list:MEDIA INPUT INFRASTRUCTURE (V4L/DVB),
open list:STAGING SUBSYSTEM, open list
Replace msleep(10) with usleep_range(10000, 12000) in the PLL lock
waiting loop of nexusca_stv0297_tuner_set_params().
usleep_range() is preferred over msleep() for short delays (< 20ms) as
it provides better accuracy and allows the scheduler flexibility for
power management optimizations. The 10-12ms range maintains the same
timing behavior while giving the kernel scheduler room to optimize.
This change improves timing precision during the PLL lock detection
phase without affecting the overall functionality of the tuner
configuration process.
Signed-off-by: Pratibimba Khadka <pratibimbakhadka@gmail.com>
---
drivers/staging/media/av7110/av7110.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/media/av7110/av7110.c b/drivers/staging/media/av7110/av7110.c
index bc9a2a40afcb..7f6c610579c8 100644
--- a/drivers/staging/media/av7110/av7110.c
+++ b/drivers/staging/media/av7110/av7110.c
@@ -1827,7 +1827,7 @@ static int nexusca_stv0297_tuner_set_params(struct dvb_frontend *fe)
if (i2c_transfer(&av7110->i2c_adap, &readmsg, 1) == 1)
if (data[0] & 0x40)
break;
- msleep(10);
+ usleep_range(10000, 12000);
}
return 0;
--
2.49.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] staging: av7110: Replace msleep() with usleep_range() in tuner function
2025-06-26 16:08 [PATCH] staging: av7110: Replace msleep() with usleep_range() in tuner function Pratibimba Khadka
@ 2025-06-26 18:05 ` Dan Carpenter
0 siblings, 0 replies; 3+ messages in thread
From: Dan Carpenter @ 2025-06-26 18:05 UTC (permalink / raw)
To: Pratibimba Khadka
Cc: mchehab, Greg Kroah-Hartman, Al Viro,
open list:MEDIA INPUT INFRASTRUCTURE (V4L/DVB),
open list:STAGING SUBSYSTEM, open list
On Thu, Jun 26, 2025 at 09:53:50PM +0545, Pratibimba Khadka wrote:
> Replace msleep(10) with usleep_range(10000, 12000) in the PLL lock
> waiting loop of nexusca_stv0297_tuner_set_params().
>
> usleep_range() is preferred over msleep() for short delays (< 20ms) as
> it provides better accuracy and allows the scheduler flexibility for
> power management optimizations. The 10-12ms range maintains the same
> timing behavior while giving the kernel scheduler room to optimize.
>
> This change improves timing precision during the PLL lock detection
> phase without affecting the overall functionality of the tuner
> configuration process.
>
> Signed-off-by: Pratibimba Khadka <pratibimbakhadka@gmail.com>
Sorry, these msleep() need to be tested on real hardware for us to
accept them.
regards,
dan carpenter
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-06-26 18:05 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-26 16:08 [PATCH] staging: av7110: Replace msleep() with usleep_range() in tuner function Pratibimba Khadka
2025-06-26 18:05 ` Dan Carpenter
-- strict thread matches above, loose matches on Subject: below --
2025-06-26 17:27 Pratibimba Khadka
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).