Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Arthur Marsh <arthur.marsh@internode.on.net>
To: Takashi Iwai <tiwai@suse.de>
Cc: alsa-devel@alsa-project.org
Subject: Re: lock-up when loading desktop
Date: Tue, 14 Oct 2014 16:54:08 +1030	[thread overview]
Message-ID: <543CC188.9050401@internode.on.net> (raw)
In-Reply-To: <s5hfvery8nt.wl-tiwai@suse.de>



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*:

---
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);

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.

  reply	other threads:[~2014-10-14  6:24 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-13  1:00 lock-up when loading desktop Arthur Marsh
2014-10-13  6:00 ` Takashi Iwai
2014-10-13 11:36   ` Arthur Marsh
2014-10-13 12:40     ` Takashi Iwai
2014-10-13 13:04       ` Arthur Marsh
2014-10-13 14:25         ` Takashi Iwai
2014-10-13 18:08           ` Arthur Marsh
2014-10-13 20:57             ` Takashi Iwai
2014-10-13 21:14               ` Takashi Iwai
2014-10-14  6:24                 ` Arthur Marsh [this message]
2014-10-14  3:26               ` Arthur Marsh
2014-10-14  7:01                 ` Arthur Marsh
2014-10-14  7:12                   ` Takashi Iwai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=543CC188.9050401@internode.on.net \
    --to=arthur.marsh@internode.on.net \
    --cc=alsa-devel@alsa-project.org \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox