Subject: [Kernel-janitors] [PATCH] radio/radio-cadet: replace schedule_timeout() with msleep() - msg#00287
List: linux.kernel.janitors
I would appreciate any comments from the janitors list.
Thanks,
Nish
Applys-to: 2.6.7
Description: Uses msleep() instead of schedule_timeout() so the task
is guaranteed to delay the desired time.
Signed-off-by: Nishanth Aravamudan <nacc@xxxxxxxxxx>
--- linux-vanilla/drivers/media/radio/radio-cadet.c 2004-06-16
05:19:22.000000000 +0000
+++ linux-dev/drivers/media/radio/radio-cadet.c 2004-07-02 20:30:07.000000000
+0000
@@ -69,8 +69,7 @@ static int cadet_getrds(void)
outb(inb(io+1)&0x7f,io+1); /* Reset RDS detection */
spin_unlock(&cadet_io_lock);
- set_current_state(TASK_UNINTERRUPTIBLE);
- schedule_timeout(HZ/10);
+ msleep(100);
spin_lock(&cadet_io_lock);
outb(3,io); /* Select Decoder Control/Status */
@@ -243,8 +242,7 @@ static void cadet_setfreq(unsigned freq)
outb(curvol,io+1);
spin_unlock(&cadet_io_lock);
- set_current_state(TASK_UNINTERRUPTIBLE);
- schedule_timeout(HZ/10);
+ msleep(100);
cadet_gettune();
if((tunestat & 0x40) == 0) { /* Tuned */
_______________________________________________
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] dvb/grundig_29504-491: replace schedule_timeout() with msleep()
I would appreciate any comments from the janitors list.
Thanks,
Nish
Applys-to: 2.6.7
Description: Replace dvb_delay() with msleep() to guarantee the
task delays the desired time.
Signed-off-by: Nishanth Aravamudan <nacc@xxxxxxxxxx>
--- linux-vanilla/drivers/media/dvb/frontends/grundig_29504-491.c
2004-06-16 05:19:52.000000000 +0000
+++ linux-dev/drivers/media/dvb/frontends/grundig_29504-491.c 2004-07-21
17:11:09.000000000 +0000
@@ -29,6 +29,7 @@
#include <linux/module.h>
#include <linux/string.h>
#include <linux/slab.h>
+#include <linux/delay.h>
#include "dvb_frontend.h"
#include "dvb_functions.h"
@@ -231,7 +232,7 @@ static void tda8083_wait_diseqc_fifo (st
while (jiffies - start < timeout &&
!(tda8083_readreg(i2c, 0x02) & 0x80))
{
- dvb_delay(50);
+ msleep(50);
};
}
_______________________________________________
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] Re: [PATCH] md: replace schedule_timeout() with msleep()
On Sat, Jul 24, 2004 at 07:33:31AM -0400, Ingo Molnar wrote:
>
> On Fri, 23 Jul 2004, Nishanth Aravamudan wrote:
>
> > --- linux-vanilla/drivers/md/md.c 2004-06-16 05:19:03.000000000 +0000
> > +++ linux-dev/drivers/md/md.c 2004-07-12 18:47:53.000000000 +0000
> > @@ -3438,8 +3438,7 @@ static void md_do_sync(mddev_t *mddev)
> > if (currspeed > sysctl_speed_limit_min) {
> > if ((currspeed > sysctl_speed_limit_max) ||
> > !is_mddev_idle(mddev)) {
> > - current->state = TASK_INTERRUPTIBLE;
> > - schedule_timeout(HZ/4);
> > + msleep(250);
>
> well, it's not 100% equivalent because msleep() is uninterruptible so
> stoppage of the md thread (upon shutdown) will occur with only a 250 msec
> delay. Someone should add a msleep_interruptible() function to
> kernel/timer.c.
You are exactly right. That's what I tried to indicated in my posts.
There isn't any msleep_interruptible() unfortunately, so the code can just
be left as is.
Thanks,
Nish
_______________________________________________
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] dvb/grundig_29504-491: replace schedule_timeout() with msleep()
I would appreciate any comments from the janitors list.
Thanks,
Nish
Applys-to: 2.6.7
Description: Replace dvb_delay() with msleep() to guarantee the
task delays the desired time.
Signed-off-by: Nishanth Aravamudan <nacc@xxxxxxxxxx>
--- linux-vanilla/drivers/media/dvb/frontends/grundig_29504-491.c
2004-06-16 05:19:52.000000000 +0000
+++ linux-dev/drivers/media/dvb/frontends/grundig_29504-491.c 2004-07-21
17:11:09.000000000 +0000
@@ -29,6 +29,7 @@
#include <linux/module.h>
#include <linux/string.h>
#include <linux/slab.h>
+#include <linux/delay.h>
#include "dvb_frontend.h"
#include "dvb_functions.h"
@@ -231,7 +232,7 @@ static void tda8083_wait_diseqc_fifo (st
while (jiffies - start < timeout &&
!(tda8083_readreg(i2c, 0x02) & 0x80))
{
- dvb_delay(50);
+ msleep(50);
};
}
_______________________________________________
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] [PATCH] dvb/grundig_29504-401: replace schedule_timeout() with msleep()
I would appreciate any comments from the janitors list.
Thanks,
Nish
Applys-to: 2.6.7
Description: Replace dvb_delay() with msleep() to guarantee the
task delays the desired time.
Signed-off-by: Nishanth Aravamudan <nacc@xxxxxxxxxx>
--- linux-vanilla/drivers/media/dvb/frontends/grundig_29504-401.c
2004-06-16 05:18:58.000000000 +0000
+++ linux-dev/drivers/media/dvb/frontends/grundig_29504-401.c 2004-07-21
17:11:24.000000000 +0000
@@ -27,6 +27,7 @@
#include <linux/module.h>
#include <linux/string.h>
#include <linux/slab.h>
+#include <linux/delay.h>
#include "dvb_frontend.h"
#include "dvb_functions.h"
@@ -546,7 +547,7 @@ int grundig_29504_401_ioctl (struct dvb_
res = init (i2c);
if ((res == 0) && (state->first)) {
state->first = 0;
- dvb_delay(200);
+ msleep(200);
}
return res;
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@xxxxxxxxxxxxxx
http://lists.osdl.org/mailman/listinfo/kernel-janitors