diff mbox

Applied "ASoC: rt5514-spi: Check the validity of drvdata pointer on resume" to the asoc tree

Message ID E1eeN5q-0004lO-5c@debutante (mailing list archive)
State New, archived
Headers show

Commit Message

Mark Brown Jan. 24, 2018, 3:36 p.m. UTC
The patch

   ASoC: rt5514-spi: Check the validity of drvdata pointer on resume

has been applied to the asoc tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

From 509bf3a7d43ab173abc354df2a859229ede043c0 Mon Sep 17 00:00:00 2001
From: Marc Zyngier <marc.zyngier@arm.com>
Date: Wed, 24 Jan 2018 14:50:00 +0000
Subject: [PATCH] ASoC: rt5514-spi: Check the validity of drvdata pointer on
 resume

The rt5514-spi driver seem to assume the validity of the drvdata pointer
on resume, which it may not be populated, leading to a not-so-nice crash.

This stems from the fact that rt5514_spi_pcm_probe() is never called on
my system (a kevin Chromebook). No idea why, but if it can happen, it
is worth fixing.

Fixes: e9c50aa6bd39 ("ASoC: rt5514-spi: check irq status to schedule data copy in resume function")
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
---
 sound/soc/codecs/rt5514-spi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Mark Brown Jan. 24, 2018, 3:47 p.m. UTC | #1
On Wed, Jan 24, 2018 at 03:36:06PM +0000, Mark Brown wrote:
> The patch
> 
>    ASoC: rt5514-spi: Check the validity of drvdata pointer on resume
> 
> has been applied to the asoc tree at
> 
>    https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

Dropped again - this was fixed with "ASoC: rt5514-spi: only enable wakeup
when fully initialized" which was already in Linus' tree.  Dunno if that
was part of why it went AWOL, I wouldn't have thought so as I usually
send a "this didn't apply" mail.  No idea what happened.
Brian Norris Jan. 24, 2018, 5:07 p.m. UTC | #2
Hi Marc and Mark,

Mark already noticed this was no longer needed, but I just wanted to
note things for the record, since Marc seemed curious.

On Wed, Jan 24, 2018 at 7:36 AM, Mark Brown <broonie@kernel.org> wrote:
...
>
> From 509bf3a7d43ab173abc354df2a859229ede043c0 Mon Sep 17 00:00:00 2001
> From: Marc Zyngier <marc.zyngier@arm.com>
> Date: Wed, 24 Jan 2018 14:50:00 +0000
> Subject: [PATCH] ASoC: rt5514-spi: Check the validity of drvdata pointer on
>  resume
>
> The rt5514-spi driver seem to assume the validity of the drvdata pointer
> on resume, which it may not be populated, leading to a not-so-nice crash.

This part was fixed with this:

346cccf88319 ASoC: rt5514: Add the sanity check for the driver_data in
the resume function

which is in 4.15-rc6

> This stems from the fact that rt5514_spi_pcm_probe() is never called on
> my system (a kevin Chromebook). No idea why, but if it can happen, it
> is worth fixing.

I believe the rk3399_gru_sound driver currently does not set up the
DAI links properly at the moment. This patch is still waiting, to fix
that:

https://patchwork.kernel.org/patch/10067725/
[PATCH] ASoC: rockchip: Use dummy_dai for rt5514 dsp dailinkgi

Brian

> Fixes: e9c50aa6bd39 ("ASoC: rt5514-spi: check irq status to schedule data copy in resume function")
> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
> Signed-off-by: Mark Brown <broonie@kernel.org>
> Cc: stable@vger.kernel.org
> ---
>  sound/soc/codecs/rt5514-spi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/sound/soc/codecs/rt5514-spi.c b/sound/soc/codecs/rt5514-spi.c
> index 2df91db765ac..9255afcf2c3a 100644
> --- a/sound/soc/codecs/rt5514-spi.c
> +++ b/sound/soc/codecs/rt5514-spi.c
> @@ -482,7 +482,7 @@ static int __maybe_unused rt5514_resume(struct device *dev)
>         if (device_may_wakeup(dev))
>                 disable_irq_wake(irq);
>
> -       if (rt5514_dsp->substream) {
> +       if (rt5514_dsp && rt5514_dsp->substream) {
>                 rt5514_spi_burst_read(RT5514_IRQ_CTRL, (u8 *)&buf, sizeof(buf));
>                 if (buf[0] & RT5514_IRQ_STATUS_BIT)
>                         rt5514_schedule_copy(rt5514_dsp);
> --
> 2.15.1
>
diff mbox

Patch

diff --git a/sound/soc/codecs/rt5514-spi.c b/sound/soc/codecs/rt5514-spi.c
index 2df91db765ac..9255afcf2c3a 100644
--- a/sound/soc/codecs/rt5514-spi.c
+++ b/sound/soc/codecs/rt5514-spi.c
@@ -482,7 +482,7 @@  static int __maybe_unused rt5514_resume(struct device *dev)
 	if (device_may_wakeup(dev))
 		disable_irq_wake(irq);
 
-	if (rt5514_dsp->substream) {
+	if (rt5514_dsp && rt5514_dsp->substream) {
 		rt5514_spi_burst_read(RT5514_IRQ_CTRL, (u8 *)&buf, sizeof(buf));
 		if (buf[0] & RT5514_IRQ_STATUS_BIT)
 			rt5514_schedule_copy(rt5514_dsp);