mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Charles Keepax <ckeepax@opensource.cirrus.com>
To: Krzysztof Kozlowski <krzk@kernel.org>
Cc: Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
	Takashi Iwai <tiwai@suse.com>, <alsa-devel@alsa-project.org>,
	<linux-kernel@vger.kernel.org>,
	<linux-samsung-soc@vger.kernel.org>,
	Sylwester Nawrocki <s.nawrocki@samsung.com>,
	Marek Szyprowski <m.szyprowski@samsung.com>
Subject: Re: [BUG BISECT] NULL pointer after commit "ASoC: dapm: Only power up active channels from a DAI"
Date: Wed, 6 Feb 2019 09:58:22 +0000	[thread overview]
Message-ID: <20190206095822.GN3837@imbe.wolfsonmicro.main> (raw)
In-Reply-To: <20190205211622.GA5891@kozik-lap>

On Tue, Feb 05, 2019 at 10:16:22PM +0100, Krzysztof Kozlowski wrote:
> Bisect pointed to commit:
>     commit 078a85f2806f0ffd11289009462a6a390f9adb5c
>     Author: Charles Keepax <ckeepax@opensource.cirrus.com>
>     Date:   Thu Jan 31 13:30:18 2019 +0000
>         ASoC: dapm: Only power up active channels from a DAI
> 
> as a bad commit for NULL pointer on my Odroid XU3 and Odroid U3 board when
> doing "aplay /usr/share/sounds/alsa/Front_Right.wav".
> 
> 1. Arch ARM Linux
> 2. exynos_defconfig
> 3. Odroid U3, XU3, Exynos SoC, ARMv7
> 
> Last address is in calltrace:
> c079552c
> dapm_update_dai_unlocked
> sound/soc/soc-dapm.c:2586
> 

Apologies for this one, is a little strange. I am assuming either
we end up with a NULL widget or more likely given the line
number a NULL path/widget on the path. Having some difficulty seeing
how we get into that state though.

Could you confirm what machine driver/DT is being used here? I am
assuming this is arch/arm/boot/dts/exynos4412-odroidu3.dts and
sound/soc/samsung/odroid.c. So will investigate those see if I
can find anything.

And could you try this diff and send through the output:

diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index 482ddb825fb59..9ee44b0192874 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -2570,16 +2570,37 @@ static int dapm_update_dai_unlocked(struct snd_pcm_substream *substream,
        else
                w = dai->capture_widget;

+ if (!w) {
+         pr_err("CK -- NULL widget on %s\n", dai->name);
+         return 0;
+ }
+
        dev_dbg(dai->dev, "Update DAI routes for %s %s\n", dai->name,
                dir == SNDRV_PCM_STREAM_PLAYBACK ? "playback" : "capture");

        snd_soc_dapm_widget_for_each_sink_path(w, p) {
+         if (!p) {
+                 pr_err("DEBUG -- NULL sink path on %s\n", w->name);
+                 continue;
+         }
+         if (!p->sink) {
+                 pr_err("DEBUG -- NULL wink widget on %s\n", w->name);
+                 continue;
+         }
                ret = dapm_update_dai_chan(p, p->sink, channels);
                if (ret < 0)
                        return ret;
        }

        snd_soc_dapm_widget_for_each_source_path(w, p) {
+         if (!p) {
+                 pr_err("DEBUG -- NULL source path on %s\n", w->name);
+                 continue;
+         }
+         if (!p->source) {
+                 pr_err("DEBUG -- NULL source widget on %s\n", w->name);
+                 continue;
+         }
                ret = dapm_update_dai_chan(p, p->source, channels);
                if (ret < 0)
                        return ret;

Thanks,
Charles

      parent reply	other threads:[~2019-02-06  9:59 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20190205211638epcas3p409823d4acac8073473153d745151ea5f@epcas3p4.samsung.com>
2019-02-05 21:16 ` Krzysztof Kozlowski
2019-02-06  9:46   ` Sylwester Nawrocki
2019-02-06 10:05     ` [PATCH] ASoC: dapm: Check for NULL widget in dapm_update_dai_unlocked Charles Keepax
2019-02-06 10:18       ` Sylwester Nawrocki
2019-02-06 10:22       ` Krzysztof Kozlowski
2019-02-06 10:59         ` Charles Keepax
2019-02-06 11:14           ` Krzysztof Kozlowski
2019-02-06 11:45             ` Charles Keepax
2019-02-06 15:47               ` Sylwester Nawrocki
2019-02-06 10:11     ` [BUG BISECT] NULL pointer after commit "ASoC: dapm: Only power up active channels from a DAI" Sylwester Nawrocki
2019-02-06 11:03       ` Charles Keepax
2019-02-06  9:58   ` Charles Keepax [this message]

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=20190206095822.GN3837@imbe.wolfsonmicro.main \
    --to=ckeepax@opensource.cirrus.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=krzk@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=perex@perex.cz \
    --cc=s.nawrocki@samsung.com \
    --cc=tiwai@suse.com \
    /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

Powered by JetHome