Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Duncan Sands <baldrick@wanadoo.fr>
To: Takashi Iwai <tiwai@suse.de>
Cc: alsa-devel@lists.sourceforge.net
Subject: Re: 2.5.50: sleeping function called from illegal context
Date: Tue, 3 Dec 2002 04:55:15 +0100	[thread overview]
Message-ID: <200212030455.16379.baldrick@wanadoo.fr> (raw)
In-Reply-To: <s5hk7ir9ura.wl@alsa2.suse.de>

On Tuesday 03 December 2002 13:01, Takashi Iwai wrote:
> At Tue, 3 Dec 2002 04:07:52 +0100,
>
> Duncan Sands wrote:
> > Got this with today 2.5 BK tree:
> >
> > Debug: sleeping function called from illegal context at
> > include/asm/semaphore.h:119 Call Trace:
> >  [<c0113f1a>] __might_sleep+0x52/0x58
> >  [<c024291a>] snd_cs46xx_iec958_put+0x36/0xf8
> >  [<c0217f28>] snd_ctl_elem_write+0xe0/0x1a4
> >  [<c0218360>] snd_ctl_ioctl+0x184/0x2c8
> >  [<c01462e6>] sys_ioctl+0x1fa/0x244
> >  [<c01088f7>] syscall_call+0x7/0xb
>
> ouch, we are using rwlock in the control ioctls.
>
> mutex is necessary for many controls, so we cannot suppress the use of
> mutex in control callbacks.
> but temporary unlocking looks ad-hoc, too...

If I understand right, the problem is that snd_ctl_elem_write
acquires control_rwlock, which is a rw spinlock.  It then calls
snd_cs46xx_iec958_put which acquires chip->spos_mutex,
which is a semaphore.  Thus the message.  Now I deduce
from the fact that  you don't use read_lock_irqsave that the
data structure is not read from interrupt context.  That means
you are only protecting against other CPUs.  So why not use
a semaphore instead of a spinlock?

All the best,

Duncan.


-------------------------------------------------------
This SF.net email is sponsored by: Get the new Palm Tungsten T 
handheld. Power & Color in a compact size! 
http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0002en

  reply	other threads:[~2002-12-03  3:55 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-03  3:07 2.5.50: sleeping function called from illegal context Duncan Sands
2002-12-03 12:01 ` Takashi Iwai
2002-12-03  3:55   ` Duncan Sands [this message]
2002-12-03 13:56     ` Takashi Iwai
2002-12-03  5:57       ` Duncan Sands
2002-12-03 14:56         ` Takashi Iwai
2002-12-03  6:39           ` Duncan Sands
2002-12-06 13:13           ` Duncan Sands
2002-12-03 18:34         ` Paul Davis
     [not found] <3DE3F32200B4A5E8@mel-rti20.wanadoo.fr>
2002-12-03 12:21 ` Duncan Sands
2002-12-04 15:41   ` Takashi Iwai

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=200212030455.16379.baldrick@wanadoo.fr \
    --to=baldrick@wanadoo.fr \
    --cc=alsa-devel@lists.sourceforge.net \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox