From: Takashi Iwai Subject: Re: ALSA:aloop -- inconsistent {in-softirq-W} -> {softirq-on-W} usage Date: Fri, 14 Dec 2012 08:00:40 +0100 Message-ID: References: <20121213203605.GA23166@blumentopf> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id 36A662616F1 for ; Fri, 14 Dec 2012 08:00:41 +0100 (CET) In-Reply-To: <20121213203605.GA23166@blumentopf> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: Andreas Fenkart Cc: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org At Thu, 13 Dec 2012 21:36:05 +0100, Andreas Fenkart wrote: > > > Hi, > > Seen this error when stopping playback to loopback. > > # aplay -Dhw:0 -fcd /dev/urandom > Playing raw data '/dev/urandom' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo > ^CAborted by signa[ 65.562992] > [ 65.565493] ================================= > [ 65.570044] [ INFO: inconsistent lock state ] > [ 65.574601] 3.7.0-rc8+ #303 Not tainted > [ 65.578605] --------------------------------- > [ 65.583156] inconsistent {IN-SOFTIRQ-W} -> {SOFTIRQ-ON-W} usage. > [ 65.589436] aplay/156 [HC0[0]:SC0[0]:HE1:SE1] takes: > [ 65.594620] (&(&dpcm->timer_lock)->rlock){+.?...}, at: [] loopback_close+0x29/0x98 > [ 65.603604] {IN-SOFTIRQ-W} state was registered at: > [ 65.608699] [] mark_irqflags+0xa3/0x11c > [ 65.613820] [] __lock_acquire+0x339/0x77c > [ 65.619112] [] lock_acquire+0x65/0xac > [ 65.624038] [] _raw_spin_lock+0x1f/0x2c > [ 65.629155] [] loopback_timer_start+0x3d/0x108 > [ 65.634899] [] loopback_timer_function+0x21/0x3c > [ 65.640821] [] call_timer_fn+0x63/0xfc > [ 65.645849] [] run_timer_softirq+0x14f/0x190 > [ 65.651410] [] __do_softirq+0xb1/0x174 > [ 65.656426] [] irq_exit+0x6d/0x70 > [ 65.660989] [] handle_IRQ+0x2d/0x60 > [ 65.665743] [] omap3_intc_handle_irq+0x59/0x60 > [ 65.671484] [] __irq_svc+0x3f/0x64 > [ 65.676138] [] default_idle+0x22/0x24 > [ 65.681063] [] cpu_idle+0x89/0x94 > [ 65.685626] [] start_kernel+0x25b/0x264 > [ 65.690743] irq event stamp: 74155 > [ 65.694296] hardirqs last enabled at (74155): [] __mutex_unlock_slowpath+0x85/0xec > [ 65.703215] hardirqs last disabled at (74154): [] __mutex_unlock_slowpath+0x3b/0xec > [ 65.712132] softirqs last enabled at (72724): [] __do_softirq+0xf5/0x174 > [ 65.720141] softirqs last disabled at (72717): [] irq_exit+0x6d/0x70 > [ 65.727697] > [ 65.727697] other info that might help us debug this: > [ 65.734516] Possible unsafe locking scenario: > [ 65.734516] > [ 65.740697] CPU0 > [ 65.743250] ---- > [ 65.745802] lock(&(&dpcm->timer_lock)->rlock); > [ 65.750639] > [ 65.753373] lock(&(&dpcm->timer_lock)->rlock); > [ 65.758392] > [ 65.758392] *** DEADLOCK *** > [ 65.758392] > [ 65.764581] 1 lock held by aplay/156: > [ 65.768404] #0: (&pcm->open_mutex){+.+.+.}, at: [] snd_pcm_release+0x1d/0x7c > [ 65.776907] > [ 65.776907] stack backtrace: > [ 65.781487] [] (unwind_backtrace+0x1/0xa0) from [] (print_usage_bug+0x149/0x184) > [ 65.791039] [] (print_usage_bug+0x149/0x184) from [] (mark_lock_irq+0x1c1/0x1e0) > [ 65.800590] [] (mark_lock_irq+0x1c1/0x1e0) from [] (mark_lock+0x113/0x368) > [ 65.809597] [] (mark_lock+0x113/0x368) from [] (mark_irqflags+0xc9/0x11c) > [ 65.818514] [] (mark_irqflags+0xc9/0x11c) from [] (__lock_acquire+0x339/0x77c) > [ 65.827884] [] (__lock_acquire+0x339/0x77c) from [] (lock_acquire+0x65/0xac) > [ 65.846083] [] (_raw_spin_lock+0x1f/0x2c) from [] (loopback_close+0x29/0x98) > [ 65.855273] [] (loopback_close+0x29/0x98) from [] (snd_pcm_release_substream+0x39/0x74) > [ 65.865458] [] (snd_pcm_release_substream+0x39/0x74) from [] (snd_pcm_release+0x23/0x7c) > [ 65.875748] [] (snd_pcm_release+0x23/0x7c) from [] (__fput+0x61/0x170) > [ 65.884409] [] (__fput+0x61/0x170) from [] (task_work_run+0x5d/0x8c) > [ 65.892879] [] (task_work_run+0x5d/0x8c) from [] (do_work_pending+0x67/0x7c) > [ 65.902069] [] (do_work_pending+0x67/0x7c) from [] (work_pending+0x9/0x18) > > This seems to be a real deadlock, since loopback_timer_stop is > triggered from ioctl, while loopback_timer_start can be called > from softirq. Could you check the latest Linus tree? The spinlocks of aloop have been already fixed there. Takashi