Subject: [Kernel-janitors] [PATCH] video/bttv-driver: replace schedule_timeout() with msleep() - msg#00320
List: linux.kernel.janitors
I would appreciate any comments from the janitors list. This is one (of
many) cases where I made a decision about replacing
set_current_state(TASK_INTERRUPTIBLE);
schedule_timeout(some_time);
with
msleep(jiffies_to_msecs(some_time));
msleep() is not exactly the same as the previous code, but I only did
this replacement where I thought long delays were *desired*. If this is
not the case here, then just disregard this patch.
Thanks,
Nish
Applys-to: 2.6.7
Description: Replace schedule_timeout() with msleep() to guarantee the
task delays for the desired time.
Signed-off-by: Nishanth Aravamudan <nacc@xxxxxxxxxx>
--- linux-vanilla/drivers/media/video/bttv-driver.c 2004-06-16
05:19:44.000000000 +0000
+++ linux-dev/drivers/media/video/bttv-driver.c 2004-07-12 18:48:48.000000000
+0000
@@ -743,8 +743,7 @@ static void set_pll(struct bttv *btv)
for (i=0; i<10; i++) {
/* Let other people run while the PLL stabilizes */
vprintk(".");
- set_current_state(TASK_INTERRUPTIBLE);
- schedule_timeout(HZ/50);
+ msleep(20);
if (btread(BT848_DSTATUS) & BT848_DSTATUS_PLOCK) {
btwrite(0,BT848_DSTATUS);
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@xxxxxxxxxxxxxx
http://lists.osdl.org/mailman/listinfo/kernel-janitors
Was this page helpful?
Thread at a glance:
Previous Message by Date:
click to view message preview
[Kernel-janitors] [PATCH] video/c-qcam: replace schedule_timeout() with msleep()
I would appreciate any comments from the janitors list. This is one (of
many) cases where I made a decision about replacing
set_current_state(TASK_INTERRUPTIBLE);
schedule_timeout(some_time);
with
msleep(jiffies_to_msecs(some_time));
msleep() is not exactly the same as the previous code, but I only did
this replacement where I thought long delays were *desired*. If this is
not the case here, then just disregard this patch.
Thanks,
Nish
Applys-to: 2.6.7
Description: Replace schedule_timeout() with msleep() to guarantee the
task delays for the desired time.
Signed-off-by: Nishanth Aravamudan <nacc@xxxxxxxxxx>
--- linux-vanilla/drivers/media/video/c-qcam.c 2004-06-16 05:19:22.000000000
+0000
+++ linux-dev/drivers/media/video/c-qcam.c 2004-07-12 18:50:24.000000000
+0000
@@ -103,8 +103,7 @@ static unsigned int qcam_await_ready1(st
{
if (qcam_ready1(qcam) == value)
return 0;
- current->state=TASK_INTERRUPTIBLE;
- schedule_timeout(HZ/10);
+ msleep(100);
}
/* Probably somebody pulled the plug out. Not much we can do. */
@@ -129,8 +128,7 @@ static unsigned int qcam_await_ready2(st
{
if (qcam_ready2(qcam) == value)
return 0;
- current->state=TASK_INTERRUPTIBLE;
- schedule_timeout(HZ/10);
+ msleep(100);
}
/* Probably somebody pulled the plug out. Not much we can do. */
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@xxxxxxxxxxxxxx
http://lists.osdl.org/mailman/listinfo/kernel-janitors
Next Message by Date:
click to view message preview
[Kernel-janitors] [PATCH] video/planb: replace schedule_timeout() with msleep()
I would appreciate any comments from the janitors list. This is one (of
many) cases where I made a decision about replacing
set_current_state(TASK_INTERRUPTIBLE);
schedule_timeout(some_time);
with
msleep(jiffies_to_msecs(some_time));
msleep() is not exactly the same as the previous code, but I only did
this replacement where I thought long delays were *desired*. If this is
not the case here, then just disregard this patch.
Thanks,
Nish
Applys-to: 2.6.7
Description: Replace schedule_timeout() with msleep() to guarantee the
task delays for the desired time.
Signed-off-by: Nishanth Aravamudan <nacc@xxxxxxxxxx>
--- linux-vanilla/drivers/media/video/planb.c 2004-06-16 05:19:51.000000000
+0000
+++ linux-dev/drivers/media/video/planb.c 2004-07-12 18:54:09.000000000
+0000
@@ -178,8 +178,7 @@ static unsigned char saa_status(int byte
saa_write_reg (SAA7196_STDC, saa_regs[pb->win.norm][SAA7196_STDC]);
/* Let's wait 30msec for this one */
- current->state = TASK_INTERRUPTIBLE;
- schedule_timeout(30 * HZ / 1000);
+ msleep(30);
return (unsigned char)in_8 (&planb_regs->saa_status);
}
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@xxxxxxxxxxxxxx
http://lists.osdl.org/mailman/listinfo/kernel-janitors
Previous Message by Thread:
click to view message preview
[Kernel-janitors] [PATCH] video/c-qcam: replace schedule_timeout() with msleep()
I would appreciate any comments from the janitors list. This is one (of
many) cases where I made a decision about replacing
set_current_state(TASK_INTERRUPTIBLE);
schedule_timeout(some_time);
with
msleep(jiffies_to_msecs(some_time));
msleep() is not exactly the same as the previous code, but I only did
this replacement where I thought long delays were *desired*. If this is
not the case here, then just disregard this patch.
Thanks,
Nish
Applys-to: 2.6.7
Description: Replace schedule_timeout() with msleep() to guarantee the
task delays for the desired time.
Signed-off-by: Nishanth Aravamudan <nacc@xxxxxxxxxx>
--- linux-vanilla/drivers/media/video/c-qcam.c 2004-06-16 05:19:22.000000000
+0000
+++ linux-dev/drivers/media/video/c-qcam.c 2004-07-12 18:50:24.000000000
+0000
@@ -103,8 +103,7 @@ static unsigned int qcam_await_ready1(st
{
if (qcam_ready1(qcam) == value)
return 0;
- current->state=TASK_INTERRUPTIBLE;
- schedule_timeout(HZ/10);
+ msleep(100);
}
/* Probably somebody pulled the plug out. Not much we can do. */
@@ -129,8 +128,7 @@ static unsigned int qcam_await_ready2(st
{
if (qcam_ready2(qcam) == value)
return 0;
- current->state=TASK_INTERRUPTIBLE;
- schedule_timeout(HZ/10);
+ msleep(100);
}
/* Probably somebody pulled the plug out. Not much we can do. */
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@xxxxxxxxxxxxxx
http://lists.osdl.org/mailman/listinfo/kernel-janitors
Next Message by Thread:
click to view message preview
[Kernel-janitors] Re: [PATCH] video/bttv-driver: replace schedule_timeout() with msleep()
On Mon, Jul 26, 2004 at 03:47:30PM -0700, Nishanth Aravamudan wrote:
> I would appreciate any comments from the janitors list. This is one (of
> many) cases where I made a decision about replacing
>
> set_current_state(TASK_INTERRUPTIBLE);
> schedule_timeout(some_time);
>
> with
>
> msleep(jiffies_to_msecs(some_time));
>
> msleep() is not exactly the same as the previous code,
How does it differ? And what exactly is the point in replacing it?
Gerd
--
return -ENOSIG;
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@xxxxxxxxxxxxxx
http://lists.osdl.org/mailman/listinfo/kernel-janitors