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 2/4] ALSA: hda: add no_pin_sense_update flag for jack detection
Date: Fri, 20 Jun 2025 14:11:14 +0200	[thread overview]
Message-ID: <87cyaywr31.wl-tiwai@suse.de> (raw)
In-Reply-To: <20250619020844.2974160-3-joakim.zhang@cixtech.com>

On Thu, 19 Jun 2025 04:08:42 +0200,
joakim.zhang@cixtech.com wrote:
> 
> From: Joakim Zhang <joakim.zhang@cixtech.com>
> 
> snd_hda_jack_detect_* functions should be called when want to
> detect then report jack status immediately, however it now called
> from other points such as patch_ops.init which just want to
> judge if the device is attached and no report behaviour.
> 
> Let take corner case into account:
> 1) device is de-attached before suspended, old pin sense is not present
> 2) attach the device when device in suspended
> 3) when codec resume back and the device is attached, it will update
>    pin sense as present from codec init function (patch_ops.init),
>    when it tries to read pin sense from jackpoll delayed work,
>    the old pin sense would be present (but actaully it is not present),
>    and the new pin sense also is present, so decides no changes, cause
>    the device cannot be detected.
> 
> Add no_pin_sense_update flag to control if we need update the pin
> sense when read the hardware pin sense.

I don't understand the situation well.  Do you mean "device" in the
steps 1/2/3 as a device to be connected to the jack, such as a
headphone, not the HD-audio codec device, right?

Even with that assumption, I still don't follow your logic fully...
Basically, when snd_hda_jack_report_sync() is called, this should
report the jack state changes.  I believe we should simply call
snd_hda_jack_report_sync() unconditionally, then schedule the jackpoll
work, as done in my PoC patch.


thanks,

Takashi

  reply	other threads:[~2025-06-20 12:11 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 [this message]
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
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=87cyaywr31.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