From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965650AbXCGUw1 (ORCPT ); Wed, 7 Mar 2007 15:52:27 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S2992569AbXCGUw0 (ORCPT ); Wed, 7 Mar 2007 15:52:26 -0500 Received: from ns2.suse.de ([195.135.220.15]:57214 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2992565AbXCGUwY (ORCPT ); Wed, 7 Mar 2007 15:52:24 -0500 Date: Wed, 07 Mar 2007 21:52:22 +0100 Message-ID: From: Takashi Iwai To: Michal Piotrowski Cc: perex@suse.cz, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: Re: 2.6.21-rc2-git3 oops snd_intel8x0_interrupt+0x104/0x1dc [snd_intel8x0] (crashdump kernel) In-Reply-To: <45EC5C76.3040703@googlemail.com> References: <45EC5C76.3040703@googlemail.com> User-Agent: Wanderlust/2.12.0 (Your Wildest Dreams) SEMI/1.14.6 (Maruoka) FLIM/1.14.7 (=?ISO-8859-4?Q?Sanj=F2?=) APEL/10.6 MULE XEmacs/21.5 (beta27) (fiddleheads) (+CVS-20060704) (i386-suse-linux) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org At Mon, 05 Mar 2007 19:07:50 +0100, Michal Piotrowski wrote: > > Hi, > > I hit this bug on crashdump kernel > > [ 8450.127374] divide error: 0000 [#1] > [ 8450.130876] PREEMPT > [ 8450.133098] Modules linked in: snd_intel8x0 snd_ac97_codec ac97_bus snd_seq_dummy snd_seq_oss snd_seq_midi_event snd_seq snd_seq_device snd_pcm_oss snd_mixer_oss snd_pcm snd_timer snd evdev intel_agp soundcore agpgart snd_page_alloc i2c_i801 skge rtc_cmos rtc_core rtc_lib ide_cd cdrom rtc unix > [ 8450.159726] CPU: 0 > [ 8450.159727] EIP: 0060:[] Not tainted VLI > [ 8450.159728] EFLAGS: 00010046 (2.6.21-rc2-git3 #12) > [ 8450.172304] EIP is at snd_intel8x0_interrupt+0x104/0x1dc [snd_intel8x0] > [ 8450.178921] eax: 00000000 ebx: c22f3590 ecx: 0000000e edx: 00000000 > [ 8450.185707] esi: c22f34f8 edi: 00700140 ebp: c2b47ce8 esp: c2b47cc0 > [ 8450.192501] ds: 007b es: 007b fs: 00d8 gs: 0033 ss: 0068 > [ 8450.198338] Process modprobe (pid: 1336, ti=c2b47000 task=c1e12070 task.ti=c2b47000) > [ 8450.205900] Stack: 00000001 c3197ab4 0000000e c165e6b6 0000000f 00000010 c22f37c0 00000202 > [ 8450.214466] c3197ab8 00000020 c2b47d08 c1643230 ca903172 0000000a 012f37f8 c22f34f8 > [ 8450.223032] 070000e0 00000001 c2b47dd4 ca902144 c26b44ac c22f34f8 c1e125f8 c1e12070 > [ 8450.231590] Call Trace: > [ 8450.234252] [] show_trace_log_lvl+0x1a/0x2f > [ 8450.239430] [] show_stack_log_lvl+0x9d/0xa5 > [ 8450.244600] [] show_registers+0x1ed/0x32c > [ 8450.249597] [] die+0x107/0x21e > [ 8450.253640] [] do_trap+0x79/0x91 > [ 8450.257860] [] do_divide_error+0x94/0x9e > [ 8450.262769] [] error_code+0x74/0x7c > [ 8450.267247] [] request_irq+0xac/0xf4 > [ 8450.271811] [] snd_intel8x0_probe+0x482/0xffb [snd_intel8x0] > [ 8450.278459] [] pci_device_probe+0x39/0x5b > [ 8450.283455] [] really_probe+0xbd/0x145 > [ 8450.288193] [] driver_probe_device+0x95/0xa1 > [ 8450.293448] [] __driver_attach+0x6a/0xa1 > [ 8450.298358] [] bus_for_each_dev+0x36/0x5b > [ 8450.303354] [] driver_attach+0x19/0x1b > [ 8450.308091] [] bus_add_driver+0x6a/0x170 > [ 8450.313001] [] driver_register+0x79/0x7e > [ 8450.317910] [] __pci_register_driver+0x7c/0xa9 > [ 8450.323338] [] alsa_card_intel8x0_init+0x17/0x19 [snd_intel8x0] > [ 8450.330246] [] sys_init_module+0x11b0/0x12f0 > [ 8450.335502] [] sysenter_past_esp+0x5f/0x99 > [ 8450.340584] ======================= > [ 8450.344172] Code: 29 c1 89 c8 83 c0 20 83 f9 ff 0f 4f c1 89 45 e0 89 53 38 8b 45 e0 0f af 43 20 03 43 24 89 43 24 f6 86 8c 02 00 00 40 75 08 31 d2 73 18 89 53 24 8b 45 e0 03 43 30 83 e0 1f 89 43 30 8b 55 ec > [ 8450.364659] EIP: [] snd_intel8x0_interrupt+0x104/0x1dc [snd_intel8x0] SS:ESP 0068:c2b47cc0 > [ 8450.373849] note: modprobe[1336] exited with preempt_count 1 > [ 8450.379518] BUG: sleeping function called from invalid context at kernel/rwsem.c:20 > [ 8450.387175] in_atomic():1, irqs_disabled():1 > [ 8450.391455] 1 lock held by modprobe/1336: > [ 8450.395474] #0: (&chip->reg_lock){....}, at: [] snd_intel8x0_interrupt+0x8c/0x1dc [snd_intel8x0] > [ 8450.405416] irq event stamp: 15590 > [ 8450.408828] hardirqs last enabled at (15589): [] kmem_cache_alloc+0x89/0xa9 > [ 8450.416798] hardirqs last disabled at (15590): [] request_irq+0xa3/0xf4 > [ 8450.424329] softirqs last enabled at (15566): [] __do_softirq+0xa5/0xaa > [ 8450.431943] softirqs last disabled at (15561): [] do_softirq+0x5b/0xc8 Hmm, it might be a race... Does the patch below fix the problem? thanks, Takashi diff -r bf193701a812 sound/pci/intel8x0.c --- a/sound/pci/intel8x0.c Mon Feb 26 16:07:42 2007 +0100 +++ b/sound/pci/intel8x0.c Wed Mar 07 14:40:58 2007 +0100 @@ -725,10 +725,11 @@ static inline void snd_intel8x0_update(s static inline void snd_intel8x0_update(struct intel8x0 *chip, struct ichdev *ichdev) { unsigned long port = ichdev->reg_offset; + unsigned long flags; int status, civ, i, step; int ack = 0; - spin_lock(&chip->reg_lock); + spin_lock_irqsave(&chip->reg_lock, flags); status = igetbyte(chip, port + ichdev->roff_sr); civ = igetbyte(chip, port + ICH_REG_OFF_CIV); if (!(status & ICH_BCIS)) { @@ -768,7 +769,7 @@ static inline void snd_intel8x0_update(s ack = 1; } } - spin_unlock(&chip->reg_lock); + spin_unlock_irqrestore(&chip->reg_lock, flags); if (ack && ichdev->substream) { snd_pcm_period_elapsed(ichdev->substream); }