From patchwork Tue Oct 14 06:24:08 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arthur Marsh X-Patchwork-Id: 5078031 X-Patchwork-Delegate: tiwai@suse.de Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 1A4AD9F30B for ; Tue, 14 Oct 2014 06:24:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5636920148 for ; Tue, 14 Oct 2014 06:24:39 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id E834A20120 for ; Tue, 14 Oct 2014 06:24:36 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 437AD260513; Tue, 14 Oct 2014 08:24:35 +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=-1.9 required=5.0 tests=BAYES_00, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 122D02604AE; Tue, 14 Oct 2014 08:24:24 +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 A18FC2604CF; Tue, 14 Oct 2014 08:24:22 +0200 (CEST) Received: from ipmail05.adl6.internode.on.net (ipmail05.adl6.internode.on.net [150.101.137.143]) by alsa0.perex.cz (Postfix) with ESMTP id D38B42604A2 for ; Tue, 14 Oct 2014 08:24:13 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AmMGAGDAPFQOAiO//2dsb2JhbABbgw5TWMwQh1UCgRkXAX2EAwEBAwEnER4iARAIAw4TFg8JAwIBAgEnHgYNAQcCiDIHxWQBAQEBAQUBAQEBHpBFB4RLAQSTAIM7nSGECiovgkoBAQE Received: from ppp14-2-35-191.lns21.adl2.internode.on.net (HELO localhost) ([14.2.35.191]) by ipmail05.adl6.internode.on.net with ESMTP; 14 Oct 2014 16:54:09 +1030 Received: from localhost ([127.0.0.1] ident=amarsh04) by localhost with esmtp (Exim 4.84) (envelope-from ) id 1XdvWi-0001Rt-Nt; Tue, 14 Oct 2014 16:54:08 +1030 Message-ID: <543CC188.9050401@internode.on.net> Date: Tue, 14 Oct 2014 16:54:08 +1030 From: Arthur Marsh User-Agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Icedove/24.8.1 MIME-Version: 1.0 To: Takashi Iwai References: <543B2438.1050002@internode.on.net> <543BB942.5060602@internode.on.net> <543BCDE9.7010308@internode.on.net> <543C153A.4060607@internode.on.net> In-Reply-To: Cc: alsa-devel@alsa-project.org Subject: Re: [alsa-devel] lock-up when loading desktop 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 Takashi Iwai wrote, on 14/10/14 07:44: >>> had a similar lock-up (see second photo) >> >> I looked at the relevant code now, and this indeed seems like a >> deadlock. But it's nothing new, the code is a decade old. I wonder >> why it appears out of sudden. Maybe the change of the spin lock path >> triggers. >> >> The patch below is the fix, just removing the superfluous spinlock. After applying *both*: --- and the patch to pcm_native.c below: > > Also below is another thing I spotted now, but this is likely > irrelevant from the lockup, supposedly. In anyway, try this one > together with the previous patch, too. > > > Takashi > > --- > diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c > index 85fe1a216225..bfe1cf6b492f 100644 > --- a/sound/core/pcm_native.c > +++ b/sound/core/pcm_native.c > @@ -818,7 +818,7 @@ static int snd_pcm_action_group(struct action_ops *ops, > /* unlock streams */ > snd_pcm_group_for_each_entry(s1, substream) { > if (s1 != substream) { > - if (s->pcm->nonatomic) > + if (s1->pcm->nonatomic) > mutex_unlock(&s1->self_group.mutex); > else > spin_unlock(&s1->self_group.lock); > against current Linus git head, I can run alsa-info.sh successfully and launch the desktop and play sounds generally (tested with MIDI and running aplay somefile.wav) Thank you very much for the patches! Regards, Arthur. diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c index 85fe1a216225..bfe1cf6b492f 100644 --- a/sound/core/pcm_native.c +++ b/sound/core/pcm_native.c @@ -818,7 +818,7 @@ static int snd_pcm_action_group(struct action_ops *ops, /* unlock streams */ snd_pcm_group_for_each_entry(s1, substream) { if (s1 != substream) { - if (s->pcm->nonatomic) + if (s1->pcm->nonatomic) mutex_unlock(&s1->self_group.mutex); else spin_unlock(&s1->self_group.lock);