[SRU][B/OEM-B/D/E/unstable][PATCH 0/2] reboot will introduce an alarm 'beep ...' during BIOS phase

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

[SRU][B/OEM-B/D/E/unstable][PATCH 0/2] reboot will introduce an alarm 'beep ...' during BIOS phase

Hui Wang
BugLink: http://bugs.launchpad.net/bugs/1840395

Since this fix is still in the maintainer's tree, I add the UBUNTU: SAUCE:
prefix in the patch title.

And this patchset is fixing a bug in the oem project, so please merge the
patchset to OEM-B asap.

[Impact]
We often hear the Beep noise when a couple of LENOVO laptops reboot, the
reproduce rate is about 3/10.

[Fix]
make the codec enter D3 before rebooting or poweroff, this can fix the issue.


[Test Case]
Tested on those LENOVO latpops, reboot 50 times, didn't reproduce the
noise issue.


[Regression Risk]
Low. We tested this patch on different lenovo and dell laptops, they
all worked well as bfore.


Hui Wang (2):
  UBUNTU: SAUCE: ALSA: hda - Let all conexant codec enter D3 when
    rebooting
  UBUNTU: SAUCE: ALSA: hda - Add a generic reboot_notify

 sound/pci/hda/hda_generic.c    | 19 +++++++++++++++++++
 sound/pci/hda/hda_generic.h    |  1 +
 sound/pci/hda/patch_conexant.c | 15 +--------------
 sound/pci/hda/patch_realtek.c  | 11 +----------
 4 files changed, 22 insertions(+), 24 deletions(-)

--
2.17.1


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

[SRU][B/OEM-B/D/E/unstable][PATCH 1/2] UBUNTU: SAUCE: ALSA: hda - Let all conexant codec enter D3 when rebooting

Hui Wang
BugLink: https://bugs.launchpad.net/bugs/1840395

We have 3 new lenovo laptops which have conexant codec 0x14f11f86,
these 3 laptops also have the noise issue when rebooting, after
letting the codec enter D3 before rebooting or poweroff, the noise
disappers.

Instead of adding a new ID again in the reboot_notify(), let us make
this function apply to all conexant codec. In theory make codec enter
D3 before rebooting or poweroff is harmless, and I tested this change
on a couple of other Lenovo laptops which have different conexant
codecs, there is no side effect so far.

Cc: [hidden email]
Signed-off-by: Hui Wang <[hidden email]>
Signed-off-by: Takashi Iwai <[hidden email]>
(cherry picked from commit 401714d9534aad8c24196b32600da683116bbe09
git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git)
Signed-off-by: Hui Wang <[hidden email]>
---
 sound/pci/hda/patch_conexant.c | 9 ---------
 1 file changed, 9 deletions(-)

diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c
index 0cc0ced1f2ed..d05d9037a450 100644
--- a/sound/pci/hda/patch_conexant.c
+++ b/sound/pci/hda/patch_conexant.c
@@ -210,15 +210,6 @@ static void cx_auto_reboot_notify(struct hda_codec *codec)
 {
  struct conexant_spec *spec = codec->spec;
 
- switch (codec->core.vendor_id) {
- case 0x14f12008: /* CX8200 */
- case 0x14f150f2: /* CX20722 */
- case 0x14f150f4: /* CX20724 */
- break;
- default:
- return;
- }
-
  /* Turn the problematic codec into D3 to avoid spurious noises
    from the internal speaker during (and after) reboot */
  cx_auto_turn_eapd(codec, spec->num_eapds, spec->eapds, false);
--
2.17.1


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

[SRU][B/OEM-B/D/E/unstable][PATCH 2/2] UBUNTU: SAUCE: ALSA: hda - Add a generic reboot_notify

Hui Wang
In reply to this post by Hui Wang
BugLink: https://bugs.launchpad.net/bugs/1840395

Make codec enter D3 before rebooting or poweroff can fix the noise
issue on some laptops. And in theory it is harmless for all codecs
to enter D3 before rebooting or poweroff, let us add a generic
reboot_notify, then realtek and conexant drivers can call this
function.

Cc: [hidden email]
Signed-off-by: Hui Wang <[hidden email]>
Signed-off-by: Takashi Iwai <[hidden email]>
(cherry picked from commit 871b9066027702e6e6589da0e1edd3b7dede7205
git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git)
Signed-off-by: Hui Wang <[hidden email]>
---
 sound/pci/hda/hda_generic.c    | 19 +++++++++++++++++++
 sound/pci/hda/hda_generic.h    |  1 +
 sound/pci/hda/patch_conexant.c |  6 +-----
 sound/pci/hda/patch_realtek.c  | 11 +----------
 4 files changed, 22 insertions(+), 15 deletions(-)

diff --git a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c
index 5cc65093d941..889294d674a8 100644
--- a/sound/pci/hda/hda_generic.c
+++ b/sound/pci/hda/hda_generic.c
@@ -5898,6 +5898,24 @@ void snd_hda_gen_free(struct hda_codec *codec)
 }
 EXPORT_SYMBOL_GPL(snd_hda_gen_free);
 
+/**
+ * snd_hda_gen_reboot_notify - Make codec enter D3 before rebooting
+ * @codec: the HDA codec
+ *
+ * This can be put as patch_ops reboot_notify function.
+ */
+void snd_hda_gen_reboot_notify(struct hda_codec *codec)
+{
+ /* Make the codec enter D3 to avoid spurious noises from the internal
+ * speaker during (and after) reboot
+ */
+ snd_hda_codec_set_power_to_all(codec, codec->core.afg, AC_PWRST_D3);
+ snd_hda_codec_write(codec, codec->core.afg, 0,
+    AC_VERB_SET_POWER_STATE, AC_PWRST_D3);
+ msleep(10);
+}
+EXPORT_SYMBOL_GPL(snd_hda_gen_reboot_notify);
+
 #ifdef CONFIG_PM
 /**
  * snd_hda_gen_check_power_status - check the loopback power save state
@@ -5925,6 +5943,7 @@ static const struct hda_codec_ops generic_patch_ops = {
  .init = snd_hda_gen_init,
  .free = snd_hda_gen_free,
  .unsol_event = snd_hda_jack_unsol_event,
+ .reboot_notify = snd_hda_gen_reboot_notify,
 #ifdef CONFIG_PM
  .check_power_status = snd_hda_gen_check_power_status,
 #endif
diff --git a/sound/pci/hda/hda_generic.h b/sound/pci/hda/hda_generic.h
index 61772317de46..d82c09db0276 100644
--- a/sound/pci/hda/hda_generic.h
+++ b/sound/pci/hda/hda_generic.h
@@ -323,6 +323,7 @@ int snd_hda_gen_parse_auto_config(struct hda_codec *codec,
   struct auto_pin_cfg *cfg);
 int snd_hda_gen_build_controls(struct hda_codec *codec);
 int snd_hda_gen_build_pcms(struct hda_codec *codec);
+void snd_hda_gen_reboot_notify(struct hda_codec *codec);
 
 /* standard jack event callbacks */
 void snd_hda_gen_hp_automute(struct hda_codec *codec,
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c
index d05d9037a450..33e172758638 100644
--- a/sound/pci/hda/patch_conexant.c
+++ b/sound/pci/hda/patch_conexant.c
@@ -213,11 +213,7 @@ static void cx_auto_reboot_notify(struct hda_codec *codec)
  /* Turn the problematic codec into D3 to avoid spurious noises
    from the internal speaker during (and after) reboot */
  cx_auto_turn_eapd(codec, spec->num_eapds, spec->eapds, false);
-
- snd_hda_codec_set_power_to_all(codec, codec->core.afg, AC_PWRST_D3);
- snd_hda_codec_write(codec, codec->core.afg, 0,
-    AC_VERB_SET_POWER_STATE, AC_PWRST_D3);
- msleep(10);
+ snd_hda_gen_reboot_notify(codec);
 }
 
 static void cx_auto_free(struct hda_codec *codec)
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index a9c2334c91ba..849b9174120b 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -861,15 +861,6 @@ static void alc_reboot_notify(struct hda_codec *codec)
  alc_shutup(codec);
 }
 
-/* power down codec to D3 at reboot/shutdown; set as reboot_notify ops */
-static void alc_d3_at_reboot(struct hda_codec *codec)
-{
- snd_hda_codec_set_power_to_all(codec, codec->core.afg, AC_PWRST_D3);
- snd_hda_codec_write(codec, codec->core.afg, 0,
-    AC_VERB_SET_POWER_STATE, AC_PWRST_D3);
- msleep(10);
-}
-
 #define alc_free snd_hda_gen_free
 
 #ifdef CONFIG_PM
@@ -5081,7 +5072,7 @@ static void alc_fixup_tpt440_dock(struct hda_codec *codec,
  struct alc_spec *spec = codec->spec;
 
  if (action == HDA_FIXUP_ACT_PRE_PROBE) {
- spec->reboot_notify = alc_d3_at_reboot; /* reduce noise */
+ spec->reboot_notify = snd_hda_gen_reboot_notify; /* reduce noise */
  spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
  codec->power_save_node = 0; /* avoid click noises */
  snd_hda_apply_pincfgs(codec, pincfgs);
--
2.17.1


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

ACK/APPLIED[OEM-B]: [SRU][B/OEM-B/D/E/unstable][PATCH 0/2] reboot will introduce an alarm 'beep ...' during BIOS phase

AceLan Kao
In reply to this post by Hui Wang
Applied on Ubuntu-oem-4.15.0-1051.59
Acked-By: AceLan Kao <[hidden email]>

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

ACK/cmt / APPLIED[E]: [SRU][B/OEM-B/D/E/unstable][PATCH 0/2] reboot will introduce an alarm 'beep ...' during BIOS phase

Seth Forshee
In reply to this post by Hui Wang
On Fri, Aug 16, 2019 at 10:13:47AM +0800, Hui Wang wrote:

> BugLink: http://bugs.launchpad.net/bugs/1840395
>
> Since this fix is still in the maintainer's tree, I add the UBUNTU: SAUCE:
> prefix in the patch title.
>
> And this patchset is fixing a bug in the oem project, so please merge the
> patchset to OEM-B asap.
>
> [Impact]
> We often hear the Beep noise when a couple of LENOVO laptops reboot, the
> reproduce rate is about 3/10.
>
> [Fix]
> make the codec enter D3 before rebooting or poweroff, this can fix the issue.
>
>
> [Test Case]
> Tested on those LENOVO latpops, reboot 50 times, didn't reproduce the
> noise issue.
>
>
> [Regression Risk]
> Low. We tested this patch on different lenovo and dell laptops, they
> all worked well as bfore.

These patches are upstream now, so the "UBUNTU: SAUCE:" and reference to
the sound tree can be removed when applying.

Acked-by: Seth Forshee <[hidden email]>

Applied to eoan/master-next with the above changes. The patches were in
5.3-rc5 and are thus already present in unstable. Thanks!

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

ACK: [SRU][B/OEM-B/D/E/unstable][PATCH 0/2] reboot will introduce an alarm 'beep ...' during BIOS phase

Connor Kuehl
In reply to this post by Hui Wang
On 8/15/19 7:13 PM, Hui Wang wrote:

> BugLink: http://bugs.launchpad.net/bugs/1840395
>
> Since this fix is still in the maintainer's tree, I add the UBUNTU: SAUCE:
> prefix in the patch title.
>
> And this patchset is fixing a bug in the oem project, so please merge the
> patchset to OEM-B asap.
>
> [Impact]
> We often hear the Beep noise when a couple of LENOVO laptops reboot, the
> reproduce rate is about 3/10.
>
> [Fix]
> make the codec enter D3 before rebooting or poweroff, this can fix the issue.
>
>
> [Test Case]
> Tested on those LENOVO latpops, reboot 50 times, didn't reproduce the
> noise issue.
>
>
> [Regression Risk]
> Low. We tested this patch on different lenovo and dell laptops, they
> all worked well as bfore.
>
>
> Hui Wang (2):
>    UBUNTU: SAUCE: ALSA: hda - Let all conexant codec enter D3 when
>      rebooting
>    UBUNTU: SAUCE: ALSA: hda - Add a generic reboot_notify
>
>   sound/pci/hda/hda_generic.c    | 19 +++++++++++++++++++
>   sound/pci/hda/hda_generic.h    |  1 +
>   sound/pci/hda/patch_conexant.c | 15 +--------------
>   sound/pci/hda/patch_realtek.c  | 11 +----------
>   4 files changed, 22 insertions(+), 24 deletions(-)
>

+1 to Seth's reminder.

Acked-by: Connor Kuehl <[hidden email]>

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

APPLIED[B/D]: [SRU][B/OEM-B/D/E/unstable][PATCH 0/2] reboot will introduce an alarm 'beep ...' during BIOS phase

Kleber Souza
In reply to this post by Hui Wang
On 8/16/19 4:13 AM, Hui Wang wrote:

> BugLink: http://bugs.launchpad.net/bugs/1840395
>
> Since this fix is still in the maintainer's tree, I add the UBUNTU: SAUCE:
> prefix in the patch title.
>
> And this patchset is fixing a bug in the oem project, so please merge the
> patchset to OEM-B asap.
>
> [Impact]
> We often hear the Beep noise when a couple of LENOVO laptops reboot, the
> reproduce rate is about 3/10.
>
> [Fix]
> make the codec enter D3 before rebooting or poweroff, this can fix the issue.
>
>
> [Test Case]
> Tested on those LENOVO latpops, reboot 50 times, didn't reproduce the
> noise issue.
>
>
> [Regression Risk]
> Low. We tested this patch on different lenovo and dell laptops, they
> all worked well as bfore.
>
>
> Hui Wang (2):
>   UBUNTU: SAUCE: ALSA: hda - Let all conexant codec enter D3 when
>     rebooting
>   UBUNTU: SAUCE: ALSA: hda - Add a generic reboot_notify
>
>  sound/pci/hda/hda_generic.c    | 19 +++++++++++++++++++
>  sound/pci/hda/hda_generic.h    |  1 +
>  sound/pci/hda/patch_conexant.c | 15 +--------------
>  sound/pci/hda/patch_realtek.c  | 11 +----------
>  4 files changed, 22 insertions(+), 24 deletions(-)
>

Applied to bionic/master-next and disco/master-next branches.

Thanks,
Kleber

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