All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Stephan Gerhold <stephan@gerhold.net>
Cc: alsa-devel@alsa-project.org,
	Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>,
	tomeu.vizoso@collabora.com, khilman@baylibre.com,
	mgalka@collabora.com,
	Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>,
	guillaume.tucker@collabora.com, enric.balletbo@collabora.com,
	Jerome Brunet <jbrunet@baylibre.com>
Subject: Re: next/master bisection: baseline.dmesg.alert on meson-sm1-sei610
Date: Fri, 17 Apr 2020 13:27:32 +0100	[thread overview]
Message-ID: <20200417122732.GC5315@sirena.org.uk> (raw)
In-Reply-To: <5e997ca0.1c69fb81.f69a1.620e@mx.google.com>

[-- Attachment #1: Type: text/plain, Size: 7678 bytes --]

On Fri, Apr 17, 2020 at 02:53:36AM -0700, kernelci.org bot wrote:

> next/master bisection: baseline.dmesg.alert on meson-sm1-sei610

> Summary:
>   Start:      a3ca59b9af21e Add linux-next specific files for 20200416
>   Plain log:  https://storage.kernelci.org//next/master/next-20200416/arm64/defconfig+CONFIG_RANDOMIZE_BASE=y/gcc-8/lab-baylibre/baseline-meson-sm1-sei610.txt
>   HTML log:   https://storage.kernelci.org//next/master/next-20200416/arm64/defconfig+CONFIG_RANDOMIZE_BASE=y/gcc-8/lab-baylibre/baseline-meson-sm1-sei610.html
>   Result:     9b5db059366ae ASoC: soc-pcm: dpcm: Only allow playback/capture if supported

This change to check the playback and capture constraints is also
causing issues on at least Meson - I'm a bit worried that this is also
causing oopses here, not just audio problems so copying in Morimoto-san
too.  We should fix the things that are broken by this change since it's
a thing we should be able to rely on and do enforce for non-DPCm links
but I'm wondering if we should revert for 5.7 and reapply for 5.8.

Including complete report so people have it.

> Checks:
>   revert:     PASS
>   verify:     PASS

> Parameters:
>   Tree:       next
>   URL:        https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
>   Branch:     master
>   Target:     meson-sm1-sei610
>   CPU arch:   arm64
>   Lab:        lab-baylibre
>   Compiler:   gcc-8
>   Config:     defconfig+CONFIG_RANDOMIZE_BASE=y
>   Test case:  baseline.dmesg.alert
> 
> Breaking commit found:
> 
> -------------------------------------------------------------------------------
> commit 9b5db059366ae2087e07892b5fc108f81f4ec189
> Author: Stephan Gerhold <stephan@gerhold.net>
> Date:   Wed Apr 15 12:49:28 2020 +0200
> 
>     ASoC: soc-pcm: dpcm: Only allow playback/capture if supported
>     
>     At the moment, PCM devices for DPCM are only created based on the
>     dpcm_playback/capture parameters of the DAI link, without considering
>     if the CPU/FE DAI is actually capable of playback/capture.
>     
>     Normally the dpcm_playback/capture parameter should match the
>     capabilities of the CPU DAI. However, there is no way to set that
>     parameter from the device tree (e.g. with simple-audio-card or
>     qcom sound cards). dpcm_playback/capture are always both set to 1.
>     
>     This causes problems when the CPU DAI does only support playback
>     or capture. Attemting to open that PCM device with an unsupported
>     stream type then results in a null pointer dereference:
>     
>         Unable to handle kernel NULL pointer dereference at virtual address 0000000000000128
>         Internal error: Oops: 96000044 [#1] PREEMPT SMP
>         CPU: 3 PID: 1582 Comm: arecord Not tainted 5.7.0-rc1
>         pc : invalidate_paths_ep+0x30/0xe0
>         lr : snd_soc_dapm_dai_get_connected_widgets+0x170/0x1a8
>         Call trace:
>          invalidate_paths_ep+0x30/0xe0
>          snd_soc_dapm_dai_get_connected_widgets+0x170/0x1a8
>          dpcm_path_get+0x38/0xd0
>          dpcm_fe_dai_open+0x70/0x920
>          snd_pcm_open_substream+0x564/0x840
>          snd_pcm_open+0xfc/0x228
>          snd_pcm_capture_open+0x4c/0x78
>          snd_open+0xac/0x1a8
>          ...
>     
>     ... because the DAI playback/capture_widget is not set in that case.
>     
>     We could add checks there to fix the problem (maybe we should
>     anyway), but much easier is to not expose the device as
>     playback/capture in the first place. Attemting to use that
>     device would always fail later anyway.
>     
>     Add checks for snd_soc_dai_stream_valid() to the DPCM case
>     to avoid exposing playback/capture if it is not supported.
>     
>     Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
>     Link: https://lore.kernel.org/r/20200415104928.86091-1-stephan@gerhold.net
>     Signed-off-by: Mark Brown <broonie@kernel.org>
> 
> diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
> index 289aebc155293..1f302de440525 100644
> --- a/sound/soc/soc-pcm.c
> +++ b/sound/soc/soc-pcm.c
> @@ -2911,8 +2911,17 @@ int soc_new_pcm(struct snd_soc_pcm_runtime *rtd, int num)
>  	int i;
>  
>  	if (rtd->dai_link->dynamic || rtd->dai_link->no_pcm) {
> -		playback = rtd->dai_link->dpcm_playback;
> -		capture = rtd->dai_link->dpcm_capture;
> +		cpu_dai = asoc_rtd_to_cpu(rtd, 0);
> +		if (rtd->num_cpus > 1) {
> +			dev_err(rtd->dev,
> +				"DPCM doesn't support Multi CPU yet\n");
> +			return -EINVAL;
> +		}
> +
> +		playback = rtd->dai_link->dpcm_playback &&
> +			   snd_soc_dai_stream_valid(cpu_dai, SNDRV_PCM_STREAM_PLAYBACK);
> +		capture = rtd->dai_link->dpcm_capture &&
> +			  snd_soc_dai_stream_valid(cpu_dai, SNDRV_PCM_STREAM_CAPTURE);
>  	} else {
>  		/* Adapt stream for codec2codec links */
>  		int cpu_capture = rtd->dai_link->params ?
> -------------------------------------------------------------------------------
> 
> 
> Git bisection log:
> 
> -------------------------------------------------------------------------------
> git bisect start
> # good: [87b0f983f66f23762921129fd35966eddc3f2dae] net: mscc: ocelot: fix untagged packet drops when enslaving to vlan aware bridge
> git bisect good 87b0f983f66f23762921129fd35966eddc3f2dae
> # bad: [a3ca59b9af21e68069555ffff1ad89bd2a7c40fc] Add linux-next specific files for 20200416
> git bisect bad a3ca59b9af21e68069555ffff1ad89bd2a7c40fc
> # bad: [feb09551bfe34ccf0ba462188a1aee651be0f2c3] Merge remote-tracking branch 'i2c/i2c/for-next'
> git bisect bad feb09551bfe34ccf0ba462188a1aee651be0f2c3
> # good: [a4721ced760684d1776bf31f7925aa41bb3f4846] Merge v5.7-rc1 into drm-misc-fixes
> git bisect good a4721ced760684d1776bf31f7925aa41bb3f4846
> # bad: [e75043c693af6a10c9e2087adeef243cf05ce3bd] Merge remote-tracking branch 'rockchip/for-next'
> git bisect bad e75043c693af6a10c9e2087adeef243cf05ce3bd
> # bad: [08a315860a1b462fef5969d2e6ab4cdab26df8e3] Merge remote-tracking branch 'arm-soc/for-next'
> git bisect bad 08a315860a1b462fef5969d2e6ab4cdab26df8e3
> # bad: [80dbfa57508c36c2b3798b387ef3eb92954b9c09] Merge remote-tracking branch 'slave-dma-fixes/fixes'
> git bisect bad 80dbfa57508c36c2b3798b387ef3eb92954b9c09
> # good: [a723380c6f0a3723db72da6c6097b32b23f5564c] Merge remote-tracking branch 'sound-current/for-linus'
> git bisect good a723380c6f0a3723db72da6c6097b32b23f5564c
> # bad: [5bd70440cb0a6f5c6a84019bb2aa93ab8310a5cd] ASoC: soc-dai: revert all changes to DAI startup/shutdown sequence
> git bisect bad 5bd70440cb0a6f5c6a84019bb2aa93ab8310a5cd
> # good: [4d1a015a203c0249e3332ea217a38ec978118daa] ASoC: convert rockchip spdif bindings to yaml
> git bisect good 4d1a015a203c0249e3332ea217a38ec978118daa
> # good: [0f2a3b02274c02eb97697c4d89c019d1d21ac225] ASoC: wsa881x: mark read_only_wordlength flag
> git bisect good 0f2a3b02274c02eb97697c4d89c019d1d21ac225
> # good: [aa7812737f2877e192d57626cbe8825cc7cf6de9] ASoC: sgtl5000: Fix VAG power-on handling
> git bisect good aa7812737f2877e192d57626cbe8825cc7cf6de9
> # bad: [0c824ec094b5cda766c80d88c2036e28c24a4cb1] ASoC: q6dsp6: q6afe-dai: add missing channels to MI2S DAIs
> git bisect bad 0c824ec094b5cda766c80d88c2036e28c24a4cb1
> # bad: [9b5db059366ae2087e07892b5fc108f81f4ec189] ASoC: soc-pcm: dpcm: Only allow playback/capture if supported
> git bisect bad 9b5db059366ae2087e07892b5fc108f81f4ec189
> # first bad commit: [9b5db059366ae2087e07892b5fc108f81f4ec189] ASoC: soc-pcm: dpcm: Only allow playback/capture if supported
> -------------------------------------------------------------------------------

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

       reply	other threads:[~2020-04-17 12:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <5e997ca0.1c69fb81.f69a1.620e@mx.google.com>
2020-04-17 12:27 ` Mark Brown [this message]
2020-04-17 13:08   ` next/master bisection: baseline.dmesg.alert on meson-sm1-sei610 Jerome Brunet
2020-04-17 13:52     ` Pierre-Louis Bossart
2020-04-17 14:28     ` Mark Brown
2020-04-17 15:48   ` Jerome Brunet

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=20200417122732.GC5315@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=enric.balletbo@collabora.com \
    --cc=guillaume.tucker@collabora.com \
    --cc=jbrunet@baylibre.com \
    --cc=khilman@baylibre.com \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=mgalka@collabora.com \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=stephan@gerhold.net \
    --cc=tomeu.vizoso@collabora.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.