Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Rene Herman <rene.herman@gmail.com>
To: Digigram <alsa@digigram.com>
Cc: ALSA devel <alsa-devel@alsa-project.org>
Subject: snd_mixart_send_msg / snd_mixart_send_msg_wait_notif
Date: Tue, 18 Sep 2007 13:54:23 +0200	[thread overview]
Message-ID: <46EFBC6F.2050800@gmail.com> (raw)

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. Didn't you intend to 
use a wait_event_timeout() or something like that? Puzzled, since you err 
out on !timeout, and it seems every run through this would end up there.

Rene.

             reply	other threads:[~2007-09-18 11:55 UTC|newest]

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

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=46EFBC6F.2050800@gmail.com \
    --to=rene.herman@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=alsa@digigram.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox