Linux Sound subsystem development
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: joakim.zhang@cixtech.com
Cc: perex@perex.cz, tiwai@suse.com, linux-sound@vger.kernel.org,
	chris.chiu@canonical.com, kailang@realtek.com,
	geans_chen@realsil.com.cn, cix-kernel-upstream@cixtech.com
Subject: Re: [PATCH V1 3/4] ALSA: hda: disable jackpoll_in_suspend when system shutdown
Date: Fri, 20 Jun 2025 14:12:29 +0200	[thread overview]
Message-ID: <87bjqiwr0y.wl-tiwai@suse.de> (raw)
In-Reply-To: <20250619020844.2974160-4-joakim.zhang@cixtech.com>

On Thu, 19 Jun 2025 04:08:43 +0200,
joakim.zhang@cixtech.com wrote:
> 
> From: Joakim Zhang <joakim.zhang@cixtech.com>
> 
> When do reboot test, kernel panic when system shutdown since
> jackpoll delayed work tries to read registers via hda bus
> but the drivers are all shut down.
> 
> The root cause is that when system shutdown but codec may in
> runtime resume state, call runtime force suspend would trigger
> jackpoll delayed work active again, finally cause the kernel
> panic since it access registers with clocks/reset/power off.
> 
> Signed-off-by: Joakim Zhang <joakim.zhang@cixtech.com>
> ---
>  sound/pci/hda/hda_codec.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
> index 12caa5b2e678..e3424ac7b5a7 100644
> --- a/sound/pci/hda/hda_codec.c
> +++ b/sound/pci/hda/hda_codec.c
> @@ -3026,6 +3026,7 @@ void snd_hda_codec_shutdown(struct hda_codec *codec)
>  	list_for_each_entry(cpcm, &codec->pcm_list_head, list)
>  		snd_pcm_suspend_all(cpcm->pcm);
>  
> +	codec->bus->jackpoll_in_suspend = 0;
>  	pm_runtime_force_suspend(hda_codec_dev(codec));

This one should be better with codec->jackpoll_interval = 0, set
before cancel_work_sync().  Then it'll guarantee that the jackpoll
work won't be called any more.


thanks,

Takashi

  reply	other threads:[~2025-06-20 12:12 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-19  2:08 [PATCH V1 0/4] ALSA: hda: jack detect fixes joakim.zhang
2025-06-19  2:08 ` [PATCH V1 1/4] ALSA: hda: fix controller cannot suspend when codec using jackpoll joakim.zhang
2025-06-20 12:00   ` Takashi Iwai
2025-06-21  6:12     ` 回复: " Joakim  Zhang
2025-06-19  2:08 ` [PATCH V1 2/4] ALSA: hda: add no_pin_sense_update flag for jack detection joakim.zhang
2025-06-20 12:11   ` Takashi Iwai
2025-06-21  6:14     ` 回复: " Joakim  Zhang
2025-06-23 10:39       ` Joakim  Zhang
2025-06-23 13:11         ` Takashi Iwai
2025-06-19  2:08 ` [PATCH V1 3/4] ALSA: hda: disable jackpoll_in_suspend when system shutdown joakim.zhang
2025-06-20 12:12   ` Takashi Iwai [this message]
2025-06-19  2:08 ` [PATCH V1 4/4] ALSA: hda/realtek: fix mic jack detect failed on alc256 joakim.zhang
2025-06-20 12:13   ` Takashi Iwai
2025-06-24  2:31     ` Kailang
2025-06-24  3:32       ` Joakim  Zhang
2025-06-24  6:17         ` Kailang
2025-06-25  1:32           ` Joakim  Zhang
2025-06-25  3:05             ` Kailang
2025-06-26  3:44               ` Joakim  Zhang
2025-06-26  5:51                 ` Kailang
2025-07-01  3:28                   ` Joakim  Zhang
2025-07-01  5:51                     ` Takashi Iwai
2025-07-01  6:35                       ` Joakim  Zhang
2025-07-01  6:42                         ` Takashi Iwai
2025-07-01  6:48                           ` Joakim  Zhang
2025-07-01  6:50                             ` Takashi Iwai
2025-07-01  8:40                               ` Joakim  Zhang
2025-07-01  9:14                                 ` Takashi Iwai
2025-07-01 10:27                                   ` Joakim  Zhang
2025-07-01 11:42                                     ` Takashi Iwai
2025-07-02  1:59                                       ` Joakim  Zhang
2025-07-02 14:27                                         ` Takashi Iwai
2025-07-03  1:39                                           ` Joakim  Zhang
2025-06-20 11:51 ` [PATCH V1 0/4] ALSA: hda: jack detect fixes Takashi Iwai

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=87bjqiwr0y.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=chris.chiu@canonical.com \
    --cc=cix-kernel-upstream@cixtech.com \
    --cc=geans_chen@realsil.com.cn \
    --cc=joakim.zhang@cixtech.com \
    --cc=kailang@realtek.com \
    --cc=linux-sound@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.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