~vicamo/+git/ubuntu-kernel:bug-1942043/cirrus-pop-noise-at-reboot/impish

Last commit made on 2021-09-03
Get this branch:
git clone -b bug-1942043/cirrus-pop-noise-at-reboot/impish https://git.launchpad.net/~vicamo/+git/ubuntu-kernel
Only You-Sheng Yang can upload to this branch. If you are You-Sheng Yang please log in for upload directions.

Branch merges

Branch information

Name:
bug-1942043/cirrus-pop-noise-at-reboot/impish
Repository:
lp:~vicamo/+git/ubuntu-kernel

Recent commits

dfed3e6... by Takashi Iwai

ALSA: hda: Disable runtime resume at shutdown

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

Although we modified the codec shutdown callback to perform
runtime-suspend, it's still not fully effective, as this may be
resumed again at any time later.

For fixing such an unwanted resume, this patch replaces
pm_runtime_suspend() with pm_runtime_force_suspend(), and call
pm_runtime_disable() afterward. It assures to keep the device
suspended.

Also for code simplification, we apply the code unconditionally; when
it's been already suspended, nothing would happen by calls of
snd_pcm_suspend_all() and pm_runtime_force_suspend(), just proceed to
pm_runtime_disable().

Fixes: b98444ed597d ("ALSA: hda: Suspend codec at shutdown")
Reported-and-tested-by: Vitaly Rodionov <email address hidden>
Link: https://<email address hidden>
Signed-off-by: Takashi Iwai <email address hidden>
(cherry picked from commit 2eaf1635f9d62a2774c1c8114db24456dfd00721)
Signed-off-by: You-Sheng Yang <email address hidden>

f98f9db... by Takashi Iwai

ALSA: hda: Nuke unused reboot_notify callback

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

As reboot_notify callback is no longer used by the codec core, let's
get rid of the unused code. Conexant codec needs a slight code change
as it used to call the reboot_notify at the codec removal, too.

BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=214045
Link: https://<email address hidden>
Signed-off-by: Takashi Iwai <email address hidden>
(cherry picked from commit 327b34f2a97d72c41d4854d61336c9ae6ffe4a44)
Signed-off-by: You-Sheng Yang <email address hidden>

6cbcbb5... by Takashi Iwai

ALSA: hda: Suspend codec at shutdown

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

So far we have a few workarounds at shutdown for each codec,
e.g. turning off the display power and setting the codec to D3.
But all those are basically a part of the suspend procedure.
Moreover, the streams are still active after that call, hence it might
hit the update on the codec that has been already put to D3.

In this patch, instead of calling each reboot_notify callback, simply
put the codec into the runtime-suspended state after the manual
suspend of all PCM streams. It makes the code and the behavior more
consistent.

The reboot_notify callback is no longer used after this patch, and
will be cleaned up later.

BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=214045
Link: https://<email address hidden>
Signed-off-by: Takashi Iwai <email address hidden>
(cherry picked from commit b98444ed597dc42be620bcac241c93da50933e69)
Signed-off-by: You-Sheng Yang <email address hidden>

47a2416... by Takashi Iwai

ALSA: hda: conexant: Turn off EAPD at suspend, too

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

Conexant codecs have a workaround for the noise at shutdown to turn
off EAPD, but it wasn't applied at suspend. In the later patch, we'll
switch from reboot_notify callback to the general suspend-at-shutdown,
so let's apply the workaround to the suspend case, too.

BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=214045
Link: https://<email address hidden>
Signed-off-by: Takashi Iwai <email address hidden>
(cherry picked from commit 95dc85dba05fa8f84c6db5fee3990fa4dd9fb499)
Signed-off-by: You-Sheng Yang <email address hidden>

29ea6bd... by Imre Deak <email address hidden>

ALSA: hda: Release codec display power during shutdown/reboot

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

Similarly to the previous patch for the HDA controller make sure here
that codecs also drop the display power reference during shutdown and
reboot.

This fixes a power ref leaked WARN in i915 during shutdown if the HDA
driver is built with CONFIG_PM=n.

Suggested-by: Takashi Iwai <email address hidden>
References: https://gitlab.freedesktop.org/drm/intel/-/issues/3618
References: https://<email address hidden>
Signed-off-by: Imre Deak <email address hidden>
Link: https://<email address hidden>
Signed-off-by: Takashi Iwai <email address hidden>
(cherry picked from commit 3099406ef4832124ce572cfbbc914e8a385ca38f)
Signed-off-by: You-Sheng Yang <email address hidden>

2b2ae7e... by Imre Deak <email address hidden>

ALSA: hda: Release controller display power during shutdown/reboot

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

Make sure the HDA driver's display power reference is released during
shutdown/reboot.

During the shutdown/reboot sequence the pci device core calls the
pm_runtime_resume handler for all devices before calling the driver's
shutdown callback and so the HDA driver's runtime resume callback will
acquire a display power reference (on HSW/BDW). This triggers a power
reference held WARN on HSW/BDW in the i915 driver's subsequent shutdown
handler, which expects all display power references to be released by
that time.

Since the HDA controller is stopped in the shutdown handler in any case,
let's follow here the same sequence as the one during runtime suspend.
This will also reset the HDA link and drop the display power reference,
getting rid of the above WARN.

Tested on HSW.

v2:
- Fix the build for CONFIG_PM=n (Takashi)
- s/__azx_runtime_suspend/azx_shutdown_chip/

Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/3618
References: https://<email address hidden>
Reported-and-tested-by: Thomas Voegtle <email address hidden>
Signed-off-by: Imre Deak <email address hidden>
Link: https://<email address hidden>
Signed-off-by: Takashi Iwai <email address hidden>
(cherry picked from commit 472e18f63c425dda97b888f40f858ea54e3efc17)
Signed-off-by: You-Sheng Yang <email address hidden>

1673784... by You-Sheng Yang

Revert "UBUNTU: SAUCE: ALSA: hda/cs8409: Prevent pops and clicks during reboot"

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

This reverts commit 01552e89a593079d0004a94a4402b60589210ee5.

Signed-off-by: You-Sheng Yang <email address hidden>

64521e0... by You-Sheng Yang

UBUNTU: [Config] Enable Cirrus Logic HDA bridge support

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

Signed-off-by: You-Sheng Yang <email address hidden>

94facc2... by Stefan Binding <email address hidden>

ALSA: hda/cs8409: Prevent pops and clicks during reboot

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

During reboot, when the CS42L42 powers down, pops and clicks
may occur due to the codec not being shutdown gracefully.
This can be fixed by going through the suspend sequence,
which shuts down the codec cleanly inside the reboot_notify
hook, which is called on reboot.

Signed-off-by: Stefan Binding <email address hidden>
Signed-off-by: Vitaly Rodionov <email address hidden>
Signed-off-by: You-Sheng Yang <email address hidden>

bbce3d5... by Stefan Binding <email address hidden>

ALSA: hda/cs8409: Prevent pops and clicks during suspend

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

Some of the register values set for type detection cause pops during suspend,
ensure these are cleaned up after type detection completes, as well
ensuring that these are cleared when we suspend.

Signed-off-by: Stefan Binding <email address hidden>
Signed-off-by: Vitaly Rodionov <email address hidden>
Signed-off-by: You-Sheng Yang <email address hidden>