[PATCH 0/1][SRU][OEM-5.6] Fix broken MSI interrupt after HDA controller was suspended

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH 0/1][SRU][OEM-5.6] Fix broken MSI interrupt after HDA controller was suspended

AceLan Kao
BugLink: https://bugs.launchpad.net/bugs/1899586

[Impact]
After HDA controller gets suspended and resumed, no MSI interrupt raised
when plugging headset to the audio jack.
This commit has been CC'ed stable, so we only have to cherry pick this
commit to OEM-5.6 kernel.

[Fix]
Power up the Realtek codec when HDA controller runtime resumes.

[Test]
1) Make sure both codec and HDA controller are runtime suspended.
2) Runtime resume the HDA controller without runtime resume the codec.
3) Plug a headset and see if the system can detect anything.

With the fix applied, we can see azx_interrupt() is working again by
using ftrace.

[Regression Potential]
If there's any system that is not affected by this issue, runtime-resume
the HDA controller will take a slightly longer time. It's rather
unlikely, since _all_ systems with Realtek codec we tested have this
issue, regardless of AMD or Intel.

Hui Wang (1):
  ALSA: hda - let hs_mic be picked ahead of hp_mic

 sound/pci/hda/hda_auto_parser.c | 6 ++++++
 1 file changed, 6 insertions(+)

--
2.25.1


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

[PATCH 1/1][SRU][OEM-5.6] ALSA: hda - let hs_mic be picked ahead of hp_mic

AceLan Kao
From: Hui Wang <[hidden email]>

BugLink: https://bugs.launchpad.net/bugs/1899586

We have a Dell AIO, there is neither internal speaker nor internal
mic, only a multi-function audio jack on it.

Users reported that after freshly installing the OS and plug
a headset to the audio jack, the headset can't output sound. I
reproduced this bug, at that moment, the Input Source is as below:
Simple mixer control 'Input Source',0
  Capabilities: cenum
  Items: 'Headphone Mic' 'Headset Mic'
  Item0: 'Headphone Mic'

That is because the patch_realtek will set this audio jack as mic_in
mode if Input Source's value is hp_mic.

If it is not fresh installing, this issue will not happen since the
systemd will run alsactl restore -f /var/lib/alsa/asound.state, this
will set the 'Input Source' according to history value.

If there is internal speaker or internal mic, this issue will not
happen since there is valid sink/source in the pulseaudio, the PA will
set the 'Input Source' according to active_port.

To fix this issue, change the parser function to let the hs_mic be
stored ahead of hp_mic.

Cc: [hidden email]
Signed-off-by: Hui Wang <[hidden email]>
Link: https://lore.kernel.org/r/20200625083833.11264-1-hui.wang@...
Signed-off-by: Takashi Iwai <[hidden email]>
(cherry picked from commit 6a6ca7881b1ab1c13fe0d70bae29211a65dd90de)
Signed-off-by: AceLan Kao <[hidden email]>
---
 sound/pci/hda/hda_auto_parser.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/sound/pci/hda/hda_auto_parser.c b/sound/pci/hda/hda_auto_parser.c
index 2c6d2becfe1a..824f4ac1a8ce 100644
--- a/sound/pci/hda/hda_auto_parser.c
+++ b/sound/pci/hda/hda_auto_parser.c
@@ -72,6 +72,12 @@ static int compare_input_type(const void *ap, const void *bp)
  if (a->type != b->type)
  return (int)(a->type - b->type);
 
+ /* If has both hs_mic and hp_mic, pick the hs_mic ahead of hp_mic. */
+ if (a->is_headset_mic && b->is_headphone_mic)
+ return -1; /* don't swap */
+ else if (a->is_headphone_mic && b->is_headset_mic)
+ return 1; /* swap */
+
  /* In case one has boost and the other one has not,
    pick the one with boost first. */
  return (int)(b->has_boost_on_pin - a->has_boost_on_pin);
--
2.25.1


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

APPLIED [OEM-5.6] Re: [PATCH 0/1][SRU][OEM-5.6] Fix broken MSI interrupt after HDA controller was suspended

Timo Aaltonen-6
In reply to this post by AceLan Kao
On 15.10.2020 12.31, AceLan Kao wrote:

> BugLink: https://bugs.launchpad.net/bugs/1899586
>
> [Impact]
> After HDA controller gets suspended and resumed, no MSI interrupt raised
> when plugging headset to the audio jack.
> This commit has been CC'ed stable, so we only have to cherry pick this
> commit to OEM-5.6 kernel.
>
> [Fix]
> Power up the Realtek codec when HDA controller runtime resumes.
>
> [Test]
> 1) Make sure both codec and HDA controller are runtime suspended.
> 2) Runtime resume the HDA controller without runtime resume the codec.
> 3) Plug a headset and see if the system can detect anything.
>
> With the fix applied, we can see azx_interrupt() is working again by
> using ftrace.
>
> [Regression Potential]
> If there's any system that is not affected by this issue, runtime-resume
> the HDA controller will take a slightly longer time. It's rather
> unlikely, since _all_ systems with Realtek codec we tested have this
> issue, regardless of AMD or Intel.
>
> Hui Wang (1):
>    ALSA: hda - let hs_mic be picked ahead of hp_mic
>
>   sound/pci/hda/hda_auto_parser.c | 6 ++++++
>   1 file changed, 6 insertions(+)
>

applied to oem-5.6, thanks

--
t

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team