public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Pshou <pshou@realtek.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Takashi Iwai" <tiwai@suse.de>,
	"Arava, Jairaj" <jairaj.arava@intel.com>,
	"Nujella, Sathyanarayana" <sathyanarayana.nujella@intel.com>,
	"Prabhu, Swarna" <swarna.prabhu@intel.com>,
	"Afzal, Naeem M" <naeem.m.afzal@intel.com>,
	Shui-Wen Hsu <swhsu4021@realtek.com>,
	"Perati, RK" <rk.perati@intel.com>,
	"Mandri, Padmashree" <padmashree.mandri@intel.com>,
	Kailang <kailang@realtek.com>
Subject: Re: Sarien/Dorset device: After system resumed from suspend, 3.5m jack is still shown as detected when unplugged during suspend
Date: Fri, 16 Sep 2022 12:07:43 +0200	[thread overview]
Message-ID: <874jx7vdhs.wl-tiwai@suse.de> (raw)
In-Reply-To: <ee87941f7f654213924aa1bc79db32f7@realtek.com>

On Fri, 16 Sep 2022 07:34:38 +0200,
Pshou wrote:
> 
> 
> Hi Takashi Iwai:
> 
> Can you help me update this PATCH file?
> 
> Check if ignore unsol events duing system suspend/resume and NVIDIA chip in
> hda_codec_unsol_event().
> 
> Signed-off-by:PeiSen Hou<pshou@realtek.com>
> 
> Signed-off-by: Jairaj Arava <jairaj.arava@intel.com>
> 
> diff --git a/sound/pci/hda/hda_bind.c b/sound/pci/hda/hda_bind.c
> 
> index 1a868dd9dc4b..75560ff6eb83 100644
> 
> --- a/sound/pci/hda/hda_bind.c
> 
> +++ b/sound/pci/hda/hda_bind.c
> 
> @@ -50,7 +50,8 @@ static void hda_codec_unsol_event(struct hdac_device *dev,
> unsigned int ev)
> 
>        /* ignore unsol events during system suspend/resume */
> 
>       if (codec->core.dev.power.power_state.event != PM_EVENT_ON)
> 
> -               return;
> 
> +              if (codec->core.vendor_id == PCI_VENDOR_ID_NVIDIA)
> 
> +                      return;
> 
>        if (codec->patch_ops.unsol_event)
> 
>               codec->patch_ops.unsol_event(codec, ev);

Hmm, this doesn't look safe.  We also want to avoid the unsol event
handling during the PM state transition, too.  So, if any, this should
be allowed only at PM_EVENT_SUSPEND or PM_EVENT_HIBERNATE.

Also, checking the codec vendor ID here is no good way.  We may add a
new flag for the special behavior (either allowing the unsol handling
or prohibiting).

But, from your patch, I don't see any reason *why* this has to be
changed in that way.  Could you give more backgrounds?


thanks,

Takashi

       reply	other threads:[~2022-09-16 10:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <ee87941f7f654213924aa1bc79db32f7@realtek.com>
2022-09-16 10:07 ` Takashi Iwai [this message]
2022-09-16 19:50   ` Sarien/Dorset device: After system resumed from suspend, 3.5m jack is still shown as detected when unplugged during suspend Arava, Jairaj
2022-09-17  5:51     ` Takashi Iwai
2022-09-17  6:29       ` Arava, Jairaj

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=874jx7vdhs.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=jairaj.arava@intel.com \
    --cc=kailang@realtek.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=naeem.m.afzal@intel.com \
    --cc=padmashree.mandri@intel.com \
    --cc=pshou@realtek.com \
    --cc=rk.perati@intel.com \
    --cc=sathyanarayana.nujella@intel.com \
    --cc=swarna.prabhu@intel.com \
    --cc=swhsu4021@realtek.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