All of lore.kernel.org
 help / color / mirror / Atom feed
From: Liam Girdwood <liam.r.girdwood@linux.intel.com>
To: Koro Chen <koro.chen@mediatek.com>
Cc: alsa-devel@alsa-project.org, srv_heupstream@mediatek.com,
	tiwai@suse.de, s.hauer@pengutronix.de,
	linux-kernel@vger.kernel.org, broonie@kernel.org,
	linux-mediatek@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] ASoC: dpcm: Make BE prepare possible in suspend state
Date: Wed, 28 Oct 2015 08:34:25 +0000	[thread overview]
Message-ID: <1446021265.2443.3.camel@loki> (raw)
In-Reply-To: <1445998534-38246-1-git-send-email-koro.chen@mediatek.com>

On Wed, 2015-10-28 at 10:15 +0800, Koro Chen wrote:
> During suspend/resume, there is a flow that if a driver does not support
> SNDRV_PCM_INFO_RESUME, it will fail at snd_pcm_resume(), and user space
> can then issue SNDRV_PCM_IOCTL_PREPARE to let audio continue to play.
> 
> However, in dpcm_be_dai_prepare() it only allows BEs to be prepared
> in state SND_SOC_DPCM_STATE_HW_PARAMS or SND_SOC_DPCM_STATE_STOP.
> The BE state will then stay in SND_SOC_DPCM_STATE_SUSPEND, consequently
> dpcm_be_dai_shutdown() is skipped in the end of playback and
> be_substream->runtime is not cleared while this runtime is actually freed
> by snd_pcm_detach_substream(). If another suspend comes, a NULL pointer
> dereference will happen in snd_pcm_suspend() when accessing
> BE substream's runtime.
> 
> Signed-off-by: Koro Chen <koro.chen@mediatek.com>

Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>

WARNING: multiple messages have this Message-ID (diff)
From: liam.r.girdwood@linux.intel.com (Liam Girdwood)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ASoC: dpcm: Make BE prepare possible in suspend state
Date: Wed, 28 Oct 2015 08:34:25 +0000	[thread overview]
Message-ID: <1446021265.2443.3.camel@loki> (raw)
In-Reply-To: <1445998534-38246-1-git-send-email-koro.chen@mediatek.com>

On Wed, 2015-10-28 at 10:15 +0800, Koro Chen wrote:
> During suspend/resume, there is a flow that if a driver does not support
> SNDRV_PCM_INFO_RESUME, it will fail at snd_pcm_resume(), and user space
> can then issue SNDRV_PCM_IOCTL_PREPARE to let audio continue to play.
> 
> However, in dpcm_be_dai_prepare() it only allows BEs to be prepared
> in state SND_SOC_DPCM_STATE_HW_PARAMS or SND_SOC_DPCM_STATE_STOP.
> The BE state will then stay in SND_SOC_DPCM_STATE_SUSPEND, consequently
> dpcm_be_dai_shutdown() is skipped in the end of playback and
> be_substream->runtime is not cleared while this runtime is actually freed
> by snd_pcm_detach_substream(). If another suspend comes, a NULL pointer
> dereference will happen in snd_pcm_suspend() when accessing
> BE substream's runtime.
> 
> Signed-off-by: Koro Chen <koro.chen@mediatek.com>

Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>

WARNING: multiple messages have this Message-ID (diff)
From: Liam Girdwood <liam.r.girdwood@linux.intel.com>
To: Koro Chen <koro.chen@mediatek.com>
Cc: broonie@kernel.org, tiwai@suse.de, srv_heupstream@mediatek.com,
	linux-mediatek@lists.infradead.org, s.hauer@pengutronix.de,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org
Subject: Re: [PATCH] ASoC: dpcm: Make BE prepare possible in suspend state
Date: Wed, 28 Oct 2015 08:34:25 +0000	[thread overview]
Message-ID: <1446021265.2443.3.camel@loki> (raw)
In-Reply-To: <1445998534-38246-1-git-send-email-koro.chen@mediatek.com>

On Wed, 2015-10-28 at 10:15 +0800, Koro Chen wrote:
> During suspend/resume, there is a flow that if a driver does not support
> SNDRV_PCM_INFO_RESUME, it will fail at snd_pcm_resume(), and user space
> can then issue SNDRV_PCM_IOCTL_PREPARE to let audio continue to play.
> 
> However, in dpcm_be_dai_prepare() it only allows BEs to be prepared
> in state SND_SOC_DPCM_STATE_HW_PARAMS or SND_SOC_DPCM_STATE_STOP.
> The BE state will then stay in SND_SOC_DPCM_STATE_SUSPEND, consequently
> dpcm_be_dai_shutdown() is skipped in the end of playback and
> be_substream->runtime is not cleared while this runtime is actually freed
> by snd_pcm_detach_substream(). If another suspend comes, a NULL pointer
> dereference will happen in snd_pcm_suspend() when accessing
> BE substream's runtime.
> 
> Signed-off-by: Koro Chen <koro.chen@mediatek.com>

Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>



  reply	other threads:[~2015-10-28  8:34 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-28  2:15 [PATCH] ASoC: dpcm: Make BE prepare possible in suspend state Koro Chen
2015-10-28  2:15 ` Koro Chen
2015-10-28  2:15 ` Koro Chen
2015-10-28  8:34 ` Liam Girdwood [this message]
2015-10-28  8:34   ` Liam Girdwood
2015-10-28  8:34   ` Liam Girdwood
2015-10-29  0:16 ` Applied "ASoC: dpcm: Make BE prepare possible in suspend state" to the asoc tree Mark Brown

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=1446021265.2443.3.camel@loki \
    --to=liam.r.girdwood@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=koro.chen@mediatek.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=s.hauer@pengutronix.de \
    --cc=srv_heupstream@mediatek.com \
    --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 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.