mbox series

[RESEND,SRU,F/G/Unstable/OEM-5.6,0/3] Fix broken MSI interrupt after HDA controller was suspended

Message ID 20201013075355.32709-1-kai.heng.feng@canonical.com
Headers show
Series Fix broken MSI interrupt after HDA controller was suspended | expand

Message

Kai-Heng Feng Oct. 13, 2020, 7:53 a.m. UTC
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.

[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.

Kai Vehmanen (1):
  UBUNTU: SAUCE: ALSA: hda: fix jack detection with Realtek codecs when
    in D3

Takashi Iwai (2):
  ALSA: hda: Skip controller resume if not needed
  ALSA: hda: Always use jackpoll helper for jack update after resume

 include/sound/hda_codec.h     |  6 ++++++
 sound/pci/hda/hda_codec.c     | 28 +++++++++++++++-----------
 sound/pci/hda/hda_intel.c     | 37 ++++++++++++++++++++---------------
 sound/pci/hda/patch_realtek.c |  1 +
 4 files changed, 45 insertions(+), 27 deletions(-)

Comments

Stefan Bader Oct. 13, 2020, 9:32 a.m. UTC | #1
On 13.10.20 09:53, Kai-Heng Feng 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.
> 
> [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.
> 
> Kai Vehmanen (1):
>   UBUNTU: SAUCE: ALSA: hda: fix jack detection with Realtek codecs when
>     in D3
> 
> Takashi Iwai (2):
>   ALSA: hda: Skip controller resume if not needed
>   ALSA: hda: Always use jackpoll helper for jack update after resume
> 
>  include/sound/hda_codec.h     |  6 ++++++
>  sound/pci/hda/hda_codec.c     | 28 +++++++++++++++-----------
>  sound/pci/hda/hda_intel.c     | 37 ++++++++++++++++++++---------------
>  sound/pci/hda/patch_realtek.c |  1 +
>  4 files changed, 45 insertions(+), 27 deletions(-)
> 
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Timo Aaltonen Oct. 16, 2020, 9:30 a.m. UTC | #2
On 13.10.2020 10.53, Kai-Heng Feng 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.
> 
> [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.
> 
> Kai Vehmanen (1):
>    UBUNTU: SAUCE: ALSA: hda: fix jack detection with Realtek codecs when
>      in D3
> 
> Takashi Iwai (2):
>    ALSA: hda: Skip controller resume if not needed
>    ALSA: hda: Always use jackpoll helper for jack update after resume
> 
>   include/sound/hda_codec.h     |  6 ++++++
>   sound/pci/hda/hda_codec.c     | 28 +++++++++++++++-----------
>   sound/pci/hda/hda_intel.c     | 37 ++++++++++++++++++++---------------
>   sound/pci/hda/patch_realtek.c |  1 +
>   4 files changed, 45 insertions(+), 27 deletions(-)
> 

applied to oem-5.6, thanks
Stefan Bader Oct. 23, 2020, 8:29 a.m. UTC | #3
On 13.10.20 09:53, Kai-Heng Feng 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.
> 
> [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.
> 
> Kai Vehmanen (1):
>   UBUNTU: SAUCE: ALSA: hda: fix jack detection with Realtek codecs when
>     in D3
> 
> Takashi Iwai (2):
>   ALSA: hda: Skip controller resume if not needed
>   ALSA: hda: Always use jackpoll helper for jack update after resume
> 
>  include/sound/hda_codec.h     |  6 ++++++
>  sound/pci/hda/hda_codec.c     | 28 +++++++++++++++-----------
>  sound/pci/hda/hda_intel.c     | 37 ++++++++++++++++++++---------------
>  sound/pci/hda/patch_realtek.c |  1 +
>  4 files changed, 45 insertions(+), 27 deletions(-)
> 
Patches #1 and #2 are committed to Focal/master-next as part of upstream stable
release v5.4.69. Patch #3 has been committed with the bug report reference but
with the old cherry pick line. Also the bug report was not having any task for
the main kernels (F/G). I updated the committed patch to drop the SAUCE and
update the SHA1 (patch is now in upstream) and also added the missing tasks to
the bug report.

-Stefan