All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rene Herman <rene.herman@gmail.com>
To: Takashi Iwai <tiwai@suse.de>
Cc: ALSA devel <alsa-devel@alsa-project.org>
Subject: Re: snd_mixart_send_msg / snd_mixart_send_msg_wait_notif
Date: Tue, 18 Sep 2007 15:13:42 +0200	[thread overview]
Message-ID: <46EFCF06.9000902@gmail.com> (raw)
In-Reply-To: <s5h6428cfjk.wl%tiwai@suse.de>

On 09/18/2007 02:40 PM, Takashi Iwai wrote:

> At Tue, 18 Sep 2007 13:54:23 +0200,
> Rene Herman wrote:
>> Hi.
>>
>> While looking through ALSA for schedule_timeout() calls, I ran into:
>>
>> int snd_mixart_send_msg(...)
>> {
>>
>> 	[ ... ]
>>
>>          set_current_state(TASK_UNINTERRUPTIBLE);
>>          add_wait_queue(&mgr->msg_sleep, &wait);
>>          spin_unlock_irq(&mgr->msg_lock);
>>          timeout = schedule_timeout(MSG_TIMEOUT_JIFFIES);
>>          remove_wait_queue(&mgr->msg_sleep, &wait);
>>
>>          if (! timeout) {
>>                  /* error - no ack */
>>                  mutex_unlock(&mgr->msg_mutex);
>>                  snd_printk(KERN_ERR "error: no reponse on msg %x\n", 
>> msg_frame);
>>                  return -EIO;
>>          }
>>
>> 	[ ... ]
>>
>> }
>>
>> and the same in snd_mixart_send_msg_wait_notif().
>>
>> I believe there to be  something wrong with this code. A schedule_timeout() 
>> in TASK_UNINTERRUPTIBLE is always going to return 0.
> 
> No, it returns the time left at the point it's woken up.
> *_uninterruptible() ignores signals but not wake_up() itself
> (otherwise it makes no sense).  The description in the kernel comment
> is misleading indeed.

And the wake_up() is done from interrupt here -- yes, okay, I understand 
now. Thanks.

(send email to digigram asking what happened to that alsa@ address by the way).

Rene.

      reply	other threads:[~2007-09-18 13:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-18 11:54 snd_mixart_send_msg / snd_mixart_send_msg_wait_notif Rene Herman
2007-09-18 11:57 ` Rene Herman
2007-09-18 12:40 ` Takashi Iwai
2007-09-18 13:13   ` Rene Herman [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=46EFCF06.9000902@gmail.com \
    --to=rene.herman@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.