From patchwork Mon Aug 31 22:48:30 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shuah Khan X-Patchwork-Id: 7101981 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 616DCBEEC1 for ; Mon, 31 Aug 2015 22:48:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5FC9F2066B for ; Mon, 31 Aug 2015 22:48:47 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 0163D20668 for ; Mon, 31 Aug 2015 22:48:46 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 221C8261A53; Tue, 1 Sep 2015 00:48:44 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 6809F261735; Tue, 1 Sep 2015 00:48:41 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id E4AE62617BB; Tue, 1 Sep 2015 00:48:40 +0200 (CEST) Received: from lists.s-osg.org (lists.s-osg.org [54.187.51.154]) by alsa0.perex.cz (Postfix) with ESMTP id 70CB52616F3 for ; Tue, 1 Sep 2015 00:48:33 +0200 (CEST) Received: from [192.168.1.40] (c-73-181-52-62.hsd1.co.comcast.net [73.181.52.62]) by lists.s-osg.org (Postfix) with ESMTPSA id 95BC5462CB; Mon, 31 Aug 2015 15:48:31 -0700 (PDT) To: Takashi Iwai From: Shuah Khan X-Enigmail-Draft-Status: N1110 Organization: Samsung Open Source Group Message-ID: <55E4D9BE.2040308@osg.samsung.com> Date: Mon, 31 Aug 2015 16:48:30 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 Cc: Shuah Khan , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Linux Media Mailing List Subject: [alsa-devel] Linux 4.2 ALSA snd-usb-audio inconsistent lock state warn in PCM nonatomic mode X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" 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 X-Virus-Scanned: ClamAV using ClamSMTP Hi Takashi, I am seeing the following inconsistent lock state warning when PCM is run in nonatomic mode. This is on 4.2.0 and with the following change to force PCM on nonatomic mode: The device Bus 003 Device 002: ID 2040:7200 Hauppauge Please let me know if you need more information and any ideas on how to fix this problem. thanks, -- Shuah [ 120.283960] ================================= [ 120.283964] [ INFO: inconsistent lock state ] [ 120.283968] 4.2.0+ #29 Not tainted [ 120.283972] --------------------------------- [ 120.283975] inconsistent {HARDIRQ-ON-W} -> {IN-HARDIRQ-W} usage. [ 120.283980] swapper/1/0 [HC1[1]:SC0[0]:HE0:SE1] takes: [ 120.283983] (&(&subs->lock)->rlock){?.+...}, at: [] retire_capture_urb+0x140/0x2b0 [snd_usb_audio] [ 120.284005] {HARDIRQ-ON-W} state was registered at: [ 120.284008] [] __lock_acquire+0xc50/0x2380 [ 120.284016] [] lock_acquire+0xb1/0x130 [ 120.284022] [] _raw_spin_lock+0x31/0x40 [ 120.284028] [] snd_usb_pcm_pointer+0x5d/0xc0 [snd_usb_audio] [ 120.284040] [] snd_pcm_update_hw_ptr0+0x38/0x3a0 [snd_pcm] [ 120.284052] [] snd_pcm_update_hw_ptr+0x10/0x20 [snd_pcm] [ 120.284063] [] snd_pcm_hwsync+0x45/0xa0 [snd_pcm] [ 120.284071] [] snd_pcm_common_ioctl1+0x277/0xce0 [snd_pcm] [ 120.284081] [] snd_pcm_capture_ioctl1+0x1be/0x2d0 [snd_pcm] [ 120.284090] [] snd_pcm_capture_ioctl+0x34/0x40 [snd_pcm] [ 120.284100] [] do_vfs_ioctl+0x301/0x560 [ 120.284107] [] SyS_ioctl+0x79/0x90 [ 120.284112] [] entry_SYSCALL_64_fastpath+0x12/0x6f [ 120.284119] irq event stamp: 823304 [ 120.284122] hardirqs last enabled at (823301): [] cpuidle_enter_state+0xed/0x230 [ 120.284129] hardirqs last disabled at (823302): [] common_interrupt+0x68/0x6d [ 120.284135] softirqs last enabled at (823304): [] _local_bh_enable+0x21/0x50 [ 120.284139] softirqs last disabled at (823303): [] irq_enter+0x4c/0x70 [ 120.284143] other info that might help us debug this: [ 120.284146] Possible unsafe locking scenario: [ 120.284149] CPU0 [ 120.284150] ---- [ 120.284152] lock(&(&subs->lock)->rlock); [ 120.284155] [ 120.284157] lock(&(&subs->lock)->rlock); [ 120.284160] *** DEADLOCK *** [ 120.284163] no locks held by swapper/1/0. [ 120.284165] stack backtrace: [ 120.284170] CPU: 1 PID: 0 Comm: swapper/1 Not tainted 4.2.0+ #29 [ 120.284173] Hardware name: Hewlett-Packard HP ProBook 6475b/180F, BIOS 68TTU Ver. F.04 08/03/2012 [ 120.284176] ffffffff828d5630 ffff88023ec83a68 ffffffff817f4ea0 0000000000000007 [ 120.284181] ffff880235a6a500 ffff88023ec83ac8 ffffffff810ad97f 0000000000000000 [ 120.284186] 0000000000000000 ffff880200000001 ffffffff810134df ffffffff827c5390 [ 120.284192] Call Trace: [ 120.284194] [] dump_stack+0x45/0x57 [ 120.284203] [] print_usage_bug+0x1ff/0x210 [ 120.284209] [] ? save_stack_trace+0x2f/0x50 [ 120.284214] [] mark_lock+0x66e/0x6f0 [ 120.284218] [] ? print_shortest_lock_dependencies+0x1d0/0x1d0 [ 120.284222] [] __lock_acquire+0xdcb/0x2380 [ 120.284226] [] ? __enqueue_entity+0x6c/0x70 [ 120.284230] [] ? __lock_is_held+0x4d/0x70 [ 120.284234] [] ? __lock_is_held+0x4d/0x70 [ 120.284238] [] ? __lock_is_held+0x4d/0x70 [ 120.284242] [] ? __lock_is_held+0x4d/0x70 [ 120.284246] [] lock_acquire+0xb1/0x130 [ 120.284256] [] ? retire_capture_urb+0x140/0x2b0 [snd_usb_audio] [ 120.284261] [] _raw_spin_lock_irqsave+0x3c/0x50 [ 120.284270] [] ? retire_capture_urb+0x140/0x2b0 [snd_usb_audio] [ 120.284276] [] ? usb_hcd_get_frame_number+0x25/0x30 [ 120.284285] [] retire_capture_urb+0x140/0x2b0 [snd_usb_audio] [ 120.284294] [] snd_complete_urb+0x13c/0x250 [snd_usb_audio] [ 120.284298] [] __usb_hcd_giveback_urb+0x72/0x110 [ 120.284303] [] usb_hcd_giveback_urb+0x43/0x140 [ 120.284307] [] xhci_irq+0xd42/0x1fc0 [ 120.284312] [] xhci_msi_irq+0x11/0x20 [ 120.284317] [] handle_irq_event_percpu+0x80/0x1a0 [ 120.284322] [] handle_irq_event+0x4a/0x70 [ 120.284325] [] ? handle_edge_irq+0x24/0x150 [ 120.284329] [] handle_edge_irq+0x81/0x150 [ 120.284333] [] handle_irq+0x25/0x40 [ 120.284337] [] do_IRQ+0x4f/0xe0 [ 120.284341] [] common_interrupt+0x6d/0x6d [ 120.284343] [] ? cpuidle_enter_state+0xf2/0x230 [ 120.284351] [] ? cpuidle_enter_state+0xed/0x230 [ 120.284355] [] cpuidle_enter+0x17/0x20 [ 120.284360] [] call_cpuidle+0x32/0x60 [ 120.284364] [] ? cpuidle_select+0x13/0x20 [ 120.284369] [] cpu_startup_entry+0x216/0x2d0 [ 120.284374] [] start_secondary+0x12d/0x150 [ 125.426447] device: 'ep_84': device_unregister [ 125.426511] PM: Removing info for No Bus:ep_84 [ 125.426542] device: 'ep_84': device_add [ 125.426602] PM: Adding info for No Bus:ep_84 diff --git a/sound/usb/stream.c b/sound/usb/stream.c index 310a382..16bbb71 100644 --- a/sound/usb/stream.c +++ b/sound/usb/stream.c @@ -370,6 +370,7 @@ int snd_usb_add_audio_stream(struct snd_usb_audio *chip, pcm->private_data = as; pcm->private_free = snd_usb_audio_pcm_free; pcm->info_flags = 0; + pcm->nonatomic = true; if (chip->pcm_devs > 0) sprintf(pcm->name, "USB Audio #%d", chip->pcm_devs); else