alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
To: Takashi Iwai <tiwai@suse.de>
Cc: alsa-devel@alsa-project.org,
	Jairaj Arava <jairaj.arava@intel.com>,
	broonie@kernel.org,
	Sathyanarayana Nujella <sathyanarayana.nujella@intel.com>,
	Shuming Fan <shumingf@realtek.com>,
	Pierre-Louis Bossart <pierre-louis.bossart@intel.com>
Subject: Re: [PATCH] ASoC: rt5682: Fix panic in rt5682_jack_detect_handler happening during system shutdown
Date: Thu, 04 Feb 2021 09:49:45 -0800	[thread overview]
Message-ID: <456785d40883f61636de9bd4ca0655b5b25fe464.camel@linux.intel.com> (raw)
In-Reply-To: <s5ha6sj688n.wl-tiwai@suse.de>

On Thu, 2021-02-04 at 18:41 +0100, Takashi Iwai wrote:
> On Thu, 04 Feb 2021 18:27:24 +0100,
> Ranjani Sridharan wrote:
> > From: Sathyanarayana Nujella <sathyanarayana.nujella@intel.com>
> > 
> > During Coldboot stress tests, system encountered the following
> > panic.
> > Panic logs depicts rt5682_i2c_shutdown() happened first and then
> > later
> > jack detect handler workqueue function triggered.
> > This situation causes panic as rt5682_i2c_shutdown() resets codec.
> > Fix this panic by cancelling properly delayed work.
> > 
> > Panic log:
> > [   20.936124] sof_pci_shutdown
> > [   20.940248] snd_sof_device_shutdown
> > [   20.945023] snd_sof_shutdown
> > [   21.126849] rt5682_i2c_shutdown
> > [   21.286053] rt5682_jack_detect_handler
> > [   21.291235] BUG: kernel NULL pointer dereference, address:
> > 000000000000037c
> > [   21.299302] #PF: supervisor read access in kernel mode
> > [   21.305254] #PF: error_code(0x0000) - not-present page
> > [   21.311218] PGD 0 P4D 0
> > [   21.314155] Oops: 0000 [#1] PREEMPT SMP NOPTI
> > [   21.319206] CPU: 2 PID: 123 Comm: kworker/2:3 Tainted:
> > G     U            5.4.68 #10
> > [   21.333687] ACPI: Preparing to enter system sleep state S5
> > [   21.337669] Workqueue: events_power_efficient
> > rt5682_jack_detect_handler [snd_soc_rt5682]
> > [   21.337671] RIP: 0010:rt5682_jack_detect_handler+0x6c/0x279
> > [snd_soc_rt5682]
> > 
> > Fixes: a50067d4f3c1d ('ASoC: rt5682: split i2c driver into separate
> > module')
> > Signed-off-by: Jairaj Arava <jairaj.arava@intel.com>
> > Signed-off-by: Sathyanarayana Nujella <
> > sathyanarayana.nujella@intel.com>
> > Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@intel.com>
> > Reviewed-by: Shuming Fan <shumingf@realtek.com>
> > Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com
> > >
> > ---
> >  sound/soc/codecs/rt5682-i2c.c | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/sound/soc/codecs/rt5682-i2c.c
> > b/sound/soc/codecs/rt5682-i2c.c
> > index 37d13120f5ba..6effd2611e3c 100644
> > --- a/sound/soc/codecs/rt5682-i2c.c
> > +++ b/sound/soc/codecs/rt5682-i2c.c
> > @@ -273,6 +273,8 @@ static void rt5682_i2c_shutdown(struct
> > i2c_client *client)
> >  {
> >  	struct rt5682_priv *rt5682 = i2c_get_clientdata(client);
> >  
> > +	cancel_delayed_work_sync(&rt5682->jack_detect_work);
> > +
> >  	rt5682_reset(rt5682);
> >  }
> 
> The driver has two works.  Doesn't another one need Canceling?
> 
> Just to be sure...
Good point, it looks like maybe we need to cancel &rt5682-
>jd_check_work as well.

Thanks,Ranjani
> 
> thanks,
> 
> Takashi


      reply	other threads:[~2021-02-04 17:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-04 17:27 [PATCH] ASoC: rt5682: Fix panic in rt5682_jack_detect_handler happening during system shutdown Ranjani Sridharan
2021-02-04 17:41 ` Takashi Iwai
2021-02-04 17:49   ` Ranjani Sridharan [this message]

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=456785d40883f61636de9bd4ca0655b5b25fe464.camel@linux.intel.com \
    --to=ranjani.sridharan@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=jairaj.arava@intel.com \
    --cc=pierre-louis.bossart@intel.com \
    --cc=sathyanarayana.nujella@intel.com \
    --cc=shumingf@realtek.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).