mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: Eugeniu Rosca <erosca@de.adit-jv.com>
Cc: Yanmin Zhang <yanmin_zhang@linux.intel.com>,
	alsa-devel@alsa-project.org,
	Eugeniu Rosca <roscaeugeniu@gmail.com>,
	Jiada Wang <jiada_wang@mentor.com>,
	linux-kernel@vger.kernel.org,
	Cezary Rojewski <cezary.rojewski@intel.com>,
	Zhang Yanmin <yanmin.zhang@intel.com>,
	Takashi Iwai <tiwai@suse.com>,
	Ramesh Babu <ramesh.babu@intel.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Dean Jenkins <Dean_Jenkins@mentor.com>,
	Mark Brown <broonie@kernel.org>,
	Ramesh Babu B <ramesh.babu.b@intel.com>,
	xiao jin <jin.xiao@intel.com>
Subject: Re: [PATCH] ASoC: soc-pcm: fix fe and be race when accessing substream->runtime
Date: Wed, 28 Sep 2022 10:36:32 +0200	[thread overview]
Message-ID: <9cb844a7-6eac-0085-3c8c-32004a22c849@linux.intel.com> (raw)
In-Reply-To: <20220927123043.GB4547@lxhi-065>



On 9/27/22 14:30, Eugeniu Rosca wrote:
> Hi Pierre,
> 
> On Di, Sep 27, 2022 at 09:51:46 +0200, Pierre-Louis Bossart wrote:
>> On 9/26/22 18:35, Eugeniu Rosca wrote:
>>> From: xiao jin <jin.xiao@intel.com>
>>>
>>> After start of fe and be, fe might go to close without triggering
>>> STOP, and substream->runtime is freed. However, be is still at
>>> START state and its substream->runtime still points to the
>>> freed runtime.
>>>
>>> Later on, FE is opened/started again, and triggers STOP.
>>> snd_pcm_do_stop => dpcm_fe_dai_trigger
>>>                 => dpcm_fe_dai_do_trigger
>>>                 => dpcm_be_dai_trigger
>>>                 => dpcm_do_trigger
>>>                 => soc_pcm_trigger
>>>                 => skl_platform_pcm_trigger
>>> skl_platform_pcm_trigger accesses the freed old runtime data and
>>> kernel panic.
>>>
>>> The patch fixes it by assigning be_substream->runtime in
>>> dpcm_be_dai_startup when be's state is START.
>>
>> Can I ask on which kernel this patch was validated and on what platform?
> 
> As shared with Czarek in https://lore.kernel.org/alsa-devel/20220927110022.GA3802@lxhi-065/ ,
> this patch was originally extracted from the out-of-tree Intel Apollo
> Lake v4.1 KNL releases, hence it was validated on Intel ref.boards.
> 
> No re-testing/re-validation has been performed on the latest vanilla.

There's no way to predict how a patch for a kernel 4.1 - released 7
years ago - would behave with a new kernel. If it's not tested it cannot
be merged.

> One of the goals behind submitting the patch is getting in touch
> with the original authors, as well as the members of alsa-devel,
> to assess if the patch is still relevant.

The only thing we could do is have more clarity on the test case and try
to reproduce it.

>>
>> We've done a lot of work since last year on DPCM states, 
> 
> Could you please feedback if the work on the DPCM states is
> pre- or post-v5.10?

It doesn't matter for this discussion on the upstream kernel. But yes
it's post v5.10.

> 
>> and I wonder
>> the problem mentioned above actually exists on recent kernels.
>>
>> Specifically, if the FE is closed, I don't get how the BE is not closed
>> as well. And if this problem is found on a recent kernel, then it should
>> be seen in the AVS driver as well, no?
> 
> It is totally conceivable (if not very likely) that the mainline
> advancements in the sound subsystem make this patch obsolete.
> 
> I would be happy if that's the final outcome of our discussion
> (since this will allow dropping the patch in our downstream kernel).
> 
> Best Regards,
> Eugeniu

  reply	other threads:[~2022-09-28  8:39 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1664210154-11552-1-git-send-email-erosca@de.adit-jv.com>
2022-09-27  7:34 ` Amadeusz Sławiński
2022-09-27 11:56   ` Eugeniu Rosca
2022-09-27  7:50 ` Cezary Rojewski
2022-09-27 11:00   ` Eugeniu Rosca
2022-09-28 14:24     ` Cezary Rojewski
2022-09-29 16:25       ` Eugeniu Rosca
2022-09-27  7:51 ` Pierre-Louis Bossart
2022-09-27 12:30   ` Eugeniu Rosca
2022-09-28  8:36     ` Pierre-Louis Bossart [this message]
2022-09-29 16:36       ` Eugeniu Rosca

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=9cb844a7-6eac-0085-3c8c-32004a22c849@linux.intel.com \
    --to=pierre-louis.bossart@linux.intel.com \
    --cc=Dean_Jenkins@mentor.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=cezary.rojewski@intel.com \
    --cc=erosca@de.adit-jv.com \
    --cc=jiada_wang@mentor.com \
    --cc=jin.xiao@intel.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ramesh.babu.b@intel.com \
    --cc=ramesh.babu@intel.com \
    --cc=roscaeugeniu@gmail.com \
    --cc=tiwai@suse.com \
    --cc=yanmin.zhang@intel.com \
    --cc=yanmin_zhang@linux.intel.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

all inboxes | Powered by JetHome®