linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [BUG 2.6.0-test9] sleep from invalid function (ALSA related?)
@ 2003-11-13 11:33 Erik Mouw
  2003-11-14 11:16 ` Takashi Iwai
  0 siblings, 1 reply; 3+ messages in thread
From: Erik Mouw @ 2003-11-13 11:33 UTC (permalink / raw)
  To: linux-kernel

Hi,

I compiled 2.6.0-test9 on my desktop last night. Not too many problems
so far, but this debug trace caught my attention:

Debug: sleeping function called from invalid context at include/asm/semaphore.h:119
in_atomic():1, irqs_disabled():0
Call Trace:
 [<c011df5b>] __might_sleep+0xab/0xd0
 [<e0c2d608>] ap_cs8427_sendbytes+0x38/0xd0 [snd_ice1712]
 [<e0b5a292>] snd_i2c_sendbytes+0x22/0x30 [snd_i2c]
 [<e0bcd14c>] snd_cs8427_reg_read+0x2c/0xa0 [snd_cs8427]
 [<e0bcd432>] snd_cs8427_create+0x92/0x320 [snd_cs8427]
 [<e0b4c320>] snd_device_new+0x20/0x70 [snd]
 [<e0c2954f>] snd_ice1712_init_cs8427+0x2f/0x70 [snd_ice1712]
 [<e0c2dfad>] snd_ice1712_delta_init+0x23d/0x2d0 [snd_ice1712]
 [<e0c2d112>] snd_ice1712_probe+0x322/0x350 [snd_ice1712]
 [<c0169de4>] dput+0x24/0x220
 [<c01ad55b>] pci_device_probe_static+0x4b/0x60
 [<c01ad5a6>] __pci_device_probe+0x36/0x50
 [<c01ad5ec>] pci_device_probe+0x2c/0x50
 [<c01ed34d>] bus_match+0x3d/0x70
 [<c01ed47a>] driver_attach+0x5a/0x90
 [<c01ed774>] bus_add_driver+0xa4/0xc0
 [<c01edbd1>] driver_register+0x31/0x40
 [<c01ad7cb>] pci_register_driver+0x5b/0x80
 [<e0af3015>] alsa_card_ice1712_init+0x15/0x4c [snd_ice1712]
 [<c0136670>] sys_init_module+0x130/0x280
 [<c010a36f>] syscall_call+0x7/0xb

It looks ALSA related to me, the soundcard I use is a Midiman
Audiophile 2496, which uses the ice1712 driver.


Erik

-- 
+-- Erik Mouw -- www.harddisk-recovery.com -- +31 70 370 12 90 --
| Lab address: Delftechpark 26, 2628 XH, Delft, The Netherlands
| Data lost? Stay calm and contact Harddisk-recovery.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [BUG 2.6.0-test9] sleep from invalid function (ALSA related?)
  2003-11-13 11:33 [BUG 2.6.0-test9] sleep from invalid function (ALSA related?) Erik Mouw
@ 2003-11-14 11:16 ` Takashi Iwai
  2003-11-18 23:40   ` Erik Mouw
  0 siblings, 1 reply; 3+ messages in thread
From: Takashi Iwai @ 2003-11-14 11:16 UTC (permalink / raw)
  To: Erik Mouw; +Cc: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 435 bytes --]

At Thu, 13 Nov 2003 12:33:16 +0100,
Erik Mouw wrote:
> 
> Hi,
> 
> I compiled 2.6.0-test9 on my desktop last night. Not too many problems
> so far, but this debug trace caught my attention:
(snip)
> It looks ALSA related to me, the soundcard I use is a Midiman
> Audiophile 2496, which uses the ice1712 driver.

the attached patch should fix.
please give a try.


--
Takashi Iwai <tiwai@suse.de>		ALSA Developer - www.alsa-project.org

[-- Attachment #2: i2c-lock-fix.dif --]
[-- Type: application/octet-stream, Size: 1431 bytes --]

diff -ru linux/include/sound linux/include/sound
--- linux/include/sound/i2c.h	23 Apr 2002 13:20:58 -0000	1.3
+++ linux/include/sound/i2c.h	13 Nov 2003 11:18:12 -0000	1.4
@@ -58,7 +58,7 @@
 	snd_card_t *card;	/* card which I2C belongs to */
 	char name[32];		/* some useful label */
 
-	spinlock_t lock;
+	struct semaphore lock_mutex;
 
 	snd_i2c_bus_t *master;	/* master bus when SCK/SCL is shared */
 	struct list_head buses;	/* master: slave buses sharing SCK/SCL, slave: link list */
@@ -84,15 +84,15 @@
 
 static inline void snd_i2c_lock(snd_i2c_bus_t *bus) {
 	if (bus->master)
-		spin_lock(&bus->master->lock);
+		down(&bus->master->lock_mutex);
 	else
-		spin_lock(&bus->lock);
+		down(&bus->lock_mutex);
 }
 static inline void snd_i2c_unlock(snd_i2c_bus_t *bus) {
 	if (bus->master)
-		spin_unlock(&bus->master->lock);
+		up(&bus->master->lock_mutex);
 	else
-		spin_unlock(&bus->lock);
+		up(&bus->lock_mutex);
 }
 
 int snd_i2c_sendbytes(snd_i2c_device_t *device, unsigned char *bytes, int count);
diff -ru linux/sound linux/sound
--- linux/sound/i2c/i2c.c	2 Jun 2003 10:04:44 -0000	1.7
+++ linux/sound/i2c/i2c.c	13 Nov 2003 11:18:25 -0000	1.8
@@ -84,7 +84,7 @@
 	bus = (snd_i2c_bus_t *)snd_magic_kcalloc(snd_i2c_bus_t, 0, GFP_KERNEL);
 	if (bus == NULL)
 		return -ENOMEM;
-	spin_lock_init(&bus->lock);
+	init_MUTEX(&bus->lock_mutex);
 	INIT_LIST_HEAD(&bus->devices);
 	INIT_LIST_HEAD(&bus->buses);
 	bus->card = card;

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [BUG 2.6.0-test9] sleep from invalid function (ALSA related?)
  2003-11-14 11:16 ` Takashi Iwai
@ 2003-11-18 23:40   ` Erik Mouw
  0 siblings, 0 replies; 3+ messages in thread
From: Erik Mouw @ 2003-11-18 23:40 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: linux-kernel

On Fri, Nov 14, 2003 at 12:16:37PM +0100, Takashi Iwai wrote:
> At Thu, 13 Nov 2003 12:33:16 +0100,
> Erik Mouw wrote:
> > I compiled 2.6.0-test9 on my desktop last night. Not too many problems
> > so far, but this debug trace caught my attention:
> (snip)
> > It looks ALSA related to me, the soundcard I use is a Midiman
> > Audiophile 2496, which uses the ice1712 driver.
> 
> the attached patch should fix.
> please give a try.

Yes, that fixes it indeed, no debug warnings on load/unload. Thanks!


Erik

-- 
----  Erik Mouw  ----  www.bitwizard.nl  ----  +31 15 2600 998  ----

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-11-18 23:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-11-13 11:33 [BUG 2.6.0-test9] sleep from invalid function (ALSA related?) Erik Mouw
2003-11-14 11:16 ` Takashi Iwai
2003-11-18 23:40   ` Erik Mouw

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).