* Re: [PATCH 30/39] sound/vx_core: replace schedule_timeout() with msleep()
[not found] <20050121194731.GK3340@us.ibm.com>
@ 2005-01-24 14:10 ` Takashi Iwai
0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2005-01-24 14:10 UTC (permalink / raw)
To: Nishanth Aravamudan; +Cc: perex, alsa-devel, kernel-janitors
At Fri, 21 Jan 2005 11:47:31 -0800,
Nishanth Aravamudan wrote:
>
> Hi,
>
> Please consider applying.
>
> Description: Use msleep() instead of schedule_timeout() to guarantee the task
> delays as expected. The check for xmsec >= 1000 / HZ seems wrong to me, as well,
> since if HZ==100, that means we could mdelay() for 9 msecs!
Yes, and that's intentional. Originally there were places to call
like snd_vx_delay(1) for just 1 or 2 ms in a long loop. The loop
calls schedule() occasionally to take control back.
So, we didn't want to do schedule_timeout(1) for HZ=100 in such a
case. This results in 10 times longer loop execution.
> msleep() should be
> usable in all cases when not in an interrupt handler.
I agree in general, but, msleep() isn't always a replacement of
mdelay() if the delay time really matters.
Takashi
-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH 30/39] sound/vx_core: replace schedule_timeout() with msleep()
@ 2005-01-21 19:47 Nishanth Aravamudan
0 siblings, 0 replies; 2+ messages in thread
From: Nishanth Aravamudan @ 2005-01-21 19:47 UTC (permalink / raw)
To: tiwai, perex; +Cc: alsa-devel, kernel-janitors
Hi,
Please consider applying.
Description: Use msleep() instead of schedule_timeout() to guarantee the task
delays as expected. The check for xmsec >= 1000 / HZ seems wrong to me, as well,
since if HZ==100, that means we could mdelay() for 9 msecs! msleep() should be
usable in all cases when not in an interrupt handler.
Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
--- 2.6.11-rc1-kj-v/sound/drivers/vx/vx_core.c 2005-01-15 16:55:45.000000000 -0800
+++ 2.6.11-rc1-kj/sound/drivers/vx/vx_core.c 2005-01-18 13:26:06.000000000 -0800
@@ -45,9 +45,8 @@ MODULE_LICENSE("GPL");
*/
void snd_vx_delay(vx_core_t *chip, int xmsec)
{
- if (! in_interrupt() && xmsec >= 1000 / HZ) {
- set_current_state(TASK_UNINTERRUPTIBLE);
- schedule_timeout((xmsec * HZ + 999) / 1000);
+ if (!in_interrupt()) {
+ msleep(xmsec);
} else {
mdelay(xmsec);
}
-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2005-01-24 14:10 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20050121194731.GK3340@us.ibm.com>
2005-01-24 14:10 ` [PATCH 30/39] sound/vx_core: replace schedule_timeout() with msleep() Takashi Iwai
2005-01-21 19:47 Nishanth Aravamudan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox