mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: b-ak <anur.bhargav@gmail.com>
To: Mark Brown <broonie@kernel.org>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ASoC: tlv320aic32x4: Kernel OOPS while entering DAPM standby mode
Date: Fri, 4 Jan 2019 22:10:40 +0530	[thread overview]
Message-ID: <20190104164040.GA10873@Ideapad-330S> (raw)
In-Reply-To: <20190103193421.GB18413@Ideapad-330S>

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

On Fri, Jan 04, 2019 at 01:04:21AM +0530, b-ak wrote:
> On Thu, Jan 03, 2019 at 12:45:54PM +0000, Mark Brown wrote:
> > On Wed, Jan 02, 2019 at 10:36:33PM +0530, b-ak wrote:
> > > During the bootup of the kernel, as soon as the DAPM framework kicks in
> > > it pushes the codec into standy mode.
> > > 
> > > The existing TVL320AIC32x4 codec driver doesn't prepare the clock in
> > > the probe function.
> > > This leads to an OOPS when the DAPM tries to put it into standy by calling
> > > clk_disable_unprepare()
> > > 
> > > This patch fixes that problem.
> > 
> > This isn't the best way of fixing this because it makes it look like
> > there's a missing disable in the removal process.  What would be better
> > would be to do what other drivers do and check to see what state we're
> > transitioning from before we disable the clock in set_bias_level().  See
> > drivers like wm8903.c for examples.
> 
> Hello Mark,
> 
> I will test the change and update the patch.
> 
> Thanks,
> Bhargav
> 

Hi Mark,

I have updated the patch with the changes.

Regards,
Bhargav


[-- Attachment #2: 0001-ASoC-tlv320aic32x4-Kernel-OOPS-while-entering-DAPM-s.patch --]
[-- Type: text/x-diff, Size: 1341 bytes --]

From 5c0530506bd6d167db4f40d5af5bb82b14debad5 Mon Sep 17 00:00:00 2001
From: b-ak <anur.bhargav@gmail.com>
Date: Tue, 1 Jan 2019 22:52:40 +0530
Subject: [PATCH] ASoC: tlv320aic32x4: Kernel OOPS while entering DAPM standby
 mode

During the bootup of the kernel, the DAPM bias level is in the OFF
state. As soon as the DAPM framework kicks in it pushes the codec
into STANDBY state.

The probe function doesn't prepare the clock, and STANDBY state
does a clk_disable_unprepare() without checking the previous state.
This leads to an OOPS.

Not transitioning from an OFF state to the STANDBY state fixes the
problem.

Signed-off-by: b-ak <anur.bhargav@gmail.com>
---
 sound/soc/codecs/tlv320aic32x4.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/sound/soc/codecs/tlv320aic32x4.c b/sound/soc/codecs/tlv320aic32x4.c
index e2b5a11b16d1..395f892776cd 100644
--- a/sound/soc/codecs/tlv320aic32x4.c
+++ b/sound/soc/codecs/tlv320aic32x4.c
@@ -822,6 +822,10 @@ static int aic32x4_set_bias_level(struct snd_soc_component *component,
 	case SND_SOC_BIAS_PREPARE:
 		break;
 	case SND_SOC_BIAS_STANDBY:
+		/* Initial cold start */
+		if (snd_soc_codec_get_bias_level(codec) == SND_SOC_BIAS_OFF)
+			break;
+
 		/* Switch off BCLK_N Divider */
 		snd_soc_component_update_bits(component, AIC32X4_BCLKN,
 				    AIC32X4_BCLKEN, 0);
-- 
2.19.1


  reply	other threads:[~2019-01-04 16:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-02 17:06 b-ak
2019-01-03 12:45 ` Mark Brown
2019-01-03 19:34   ` b-ak
2019-01-04 16:40     ` b-ak [this message]
2019-01-05  4:46       ` b-ak
2019-01-07 12:59         ` Mark Brown
2019-01-07 17:40           ` b-ak
2019-01-07 17:45           ` [PATCH v2] " b-ak

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=20190104164040.GA10873@Ideapad-330S \
    --to=anur.bhargav@gmail.com \
    --cc=broonie@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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®