mbox series

[SRU,G/OEM-5.6,0/4] Fix no headset sound after S3 on Intel HDA

Message ID 20201117165429.1231318-1-kai.heng.feng@canonical.com
Headers show
Series Fix no headset sound after S3 on Intel HDA | expand

Message

Kai-Heng Feng Nov. 17, 2020, 4:54 p.m. UTC
BugLink: https://bugs.launchpad.net/bugs/1904595

[Impact]
After system S3, hotplugging headset cannot produce any sound despite of
being auto-selected as audio output.

[Fix]
Avoid using pm_runtime_force_{suspend,resume} helpers to ensure codec
suspend/resume flow, and also ensure HDA driver and PCI set correct
wakeup settings.

[Test case]
Plug headset, unplug headset, switch audio ouput from speakers to HDMI
to let Intel HDA auto suspend. Suspend/resume the system, plug the
headset again, hear no sound.

With the patch series applied, the issue is gone.

[Where problems could occur]
If there is bad firmware/hardware that makes codec have system-wide
wakeup capability, direct-complete flow may trigger unwanted system
wakeup or even break system suspend. The series was tested on both AMD
and Intel platforms, with Realtek and Connexant codecs respectively.

Kai-Heng Feng (3):
  ALSA: hda: Refactor codec PM to use direct-complete optimization
  ALSA: hda: Separate runtime and system suspend
  ALSA: hda: Reinstate runtime_allow() for all hda controllers

Takashi Iwai (1):
  ALSA: hda: Workaround for spurious wakeups on some Intel platforms

 sound/pci/hda/hda_codec.c      | 45 +++++++++++++++++++-----------
 sound/pci/hda/hda_controller.h |  1 +
 sound/pci/hda/hda_intel.c      | 50 +++++++++++++++++++++++-----------
 3 files changed, 64 insertions(+), 32 deletions(-)

Comments

Stefan Bader Nov. 18, 2020, 8:55 a.m. UTC | #1
On 17.11.20 17:54, Kai-Heng Feng wrote:
> BugLink: https://bugs.launchpad.net/bugs/1904595
> 
> [Impact]
> After system S3, hotplugging headset cannot produce any sound despite of
> being auto-selected as audio output.
> 
> [Fix]
> Avoid using pm_runtime_force_{suspend,resume} helpers to ensure codec
> suspend/resume flow, and also ensure HDA driver and PCI set correct
> wakeup settings.
> 
> [Test case]
> Plug headset, unplug headset, switch audio ouput from speakers to HDMI
> to let Intel HDA auto suspend. Suspend/resume the system, plug the
> headset again, hear no sound.
> 
> With the patch series applied, the issue is gone.
> 
> [Where problems could occur]
> If there is bad firmware/hardware that makes codec have system-wide
> wakeup capability, direct-complete flow may trigger unwanted system
> wakeup or even break system suspend. The series was tested on both AMD
> and Intel platforms, with Realtek and Connexant codecs respectively.
> 
> Kai-Heng Feng (3):
>   ALSA: hda: Refactor codec PM to use direct-complete optimization
>   ALSA: hda: Separate runtime and system suspend
>   ALSA: hda: Reinstate runtime_allow() for all hda controllers
> 
> Takashi Iwai (1):
>   ALSA: hda: Workaround for spurious wakeups on some Intel platforms
> 
>  sound/pci/hda/hda_codec.c      | 45 +++++++++++++++++++-----------
>  sound/pci/hda/hda_controller.h |  1 +
>  sound/pci/hda/hda_intel.c      | 50 +++++++++++++++++++++++-----------
>  3 files changed, 64 insertions(+), 32 deletions(-)
> 
The first patch for Groovy is a bit scary just because it changes (from my
knowledge) a rather central part of the stack. Things seem to be already in the
upstream tree, so I hope there is no surprises.


Acked-by: Stefan Bader <stefan.bader@canonical.com>
Kleber Souza Nov. 20, 2020, 10:56 a.m. UTC | #2
On 17.11.20 17:54, Kai-Heng Feng wrote:
> BugLink: https://bugs.launchpad.net/bugs/1904595
> 
> [Impact]
> After system S3, hotplugging headset cannot produce any sound despite of
> being auto-selected as audio output.
> 
> [Fix]
> Avoid using pm_runtime_force_{suspend,resume} helpers to ensure codec
> suspend/resume flow, and also ensure HDA driver and PCI set correct
> wakeup settings.
> 
> [Test case]
> Plug headset, unplug headset, switch audio ouput from speakers to HDMI
> to let Intel HDA auto suspend. Suspend/resume the system, plug the
> headset again, hear no sound.
> 
> With the patch series applied, the issue is gone.
> 
> [Where problems could occur]
> If there is bad firmware/hardware that makes codec have system-wide
> wakeup capability, direct-complete flow may trigger unwanted system
> wakeup or even break system suspend. The series was tested on both AMD
> and Intel platforms, with Realtek and Connexant codecs respectively.
> 
> Kai-Heng Feng (3):
>    ALSA: hda: Refactor codec PM to use direct-complete optimization
>    ALSA: hda: Separate runtime and system suspend
>    ALSA: hda: Reinstate runtime_allow() for all hda controllers
> 
> Takashi Iwai (1):
>    ALSA: hda: Workaround for spurious wakeups on some Intel platforms
> 
>   sound/pci/hda/hda_codec.c      | 45 +++++++++++++++++++-----------
>   sound/pci/hda/hda_controller.h |  1 +
>   sound/pci/hda/hda_intel.c      | 50 +++++++++++++++++++++++-----------
>   3 files changed, 64 insertions(+), 32 deletions(-)
> 

Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
William Breathitt Gray Nov. 20, 2020, 4:19 p.m. UTC | #3
On Wed, Nov 18, 2020 at 12:54:25AM +0800, Kai-Heng Feng wrote:
> BugLink: https://bugs.launchpad.net/bugs/1904595
> 
> [Impact]
> After system S3, hotplugging headset cannot produce any sound despite of
> being auto-selected as audio output.
> 
> [Fix]
> Avoid using pm_runtime_force_{suspend,resume} helpers to ensure codec
> suspend/resume flow, and also ensure HDA driver and PCI set correct
> wakeup settings.
> 
> [Test case]
> Plug headset, unplug headset, switch audio ouput from speakers to HDMI
> to let Intel HDA auto suspend. Suspend/resume the system, plug the
> headset again, hear no sound.
> 
> With the patch series applied, the issue is gone.
> 
> [Where problems could occur]
> If there is bad firmware/hardware that makes codec have system-wide
> wakeup capability, direct-complete flow may trigger unwanted system
> wakeup or even break system suspend. The series was tested on both AMD
> and Intel platforms, with Realtek and Connexant codecs respectively.
> 
> Kai-Heng Feng (3):
>   ALSA: hda: Refactor codec PM to use direct-complete optimization
>   ALSA: hda: Separate runtime and system suspend
>   ALSA: hda: Reinstate runtime_allow() for all hda controllers
> 
> Takashi Iwai (1):
>   ALSA: hda: Workaround for spurious wakeups on some Intel platforms
> 
>  sound/pci/hda/hda_codec.c      | 45 +++++++++++++++++++-----------
>  sound/pci/hda/hda_controller.h |  1 +
>  sound/pci/hda/hda_intel.c      | 50 +++++++++++++++++++++++-----------
>  3 files changed, 64 insertions(+), 32 deletions(-)
> 
> -- 
> 2.28.0

Applied to Groovy:linux.

William Breathitt Gray
Timo Aaltonen Dec. 3, 2020, 11:16 a.m. UTC | #4
On 17.11.2020 18.54, Kai-Heng Feng wrote:
> BugLink: https://bugs.launchpad.net/bugs/1904595
> 
> [Impact]
> After system S3, hotplugging headset cannot produce any sound despite of
> being auto-selected as audio output.
> 
> [Fix]
> Avoid using pm_runtime_force_{suspend,resume} helpers to ensure codec
> suspend/resume flow, and also ensure HDA driver and PCI set correct
> wakeup settings.
> 
> [Test case]
> Plug headset, unplug headset, switch audio ouput from speakers to HDMI
> to let Intel HDA auto suspend. Suspend/resume the system, plug the
> headset again, hear no sound.
> 
> With the patch series applied, the issue is gone.
> 
> [Where problems could occur]
> If there is bad firmware/hardware that makes codec have system-wide
> wakeup capability, direct-complete flow may trigger unwanted system
> wakeup or even break system suspend. The series was tested on both AMD
> and Intel platforms, with Realtek and Connexant codecs respectively.
> 
> Kai-Heng Feng (3):
>    ALSA: hda: Refactor codec PM to use direct-complete optimization
>    ALSA: hda: Separate runtime and system suspend
>    ALSA: hda: Reinstate runtime_allow() for all hda controllers
> 
> Takashi Iwai (1):
>    ALSA: hda: Workaround for spurious wakeups on some Intel platforms
> 
>   sound/pci/hda/hda_codec.c      | 45 +++++++++++++++++++-----------
>   sound/pci/hda/hda_controller.h |  1 +
>   sound/pci/hda/hda_intel.c      | 50 +++++++++++++++++++++++-----------
>   3 files changed, 64 insertions(+), 32 deletions(-)
> 

applied to oem-5.6, thanks