diff mbox series

[SRU,Artful,OEM] ALSA: hda - Force polling mode on CFL for fixing codec communication

Message ID 1522046276-6936-2-git-send-email-hui.wang@canonical.com
State New
Headers show
Series [SRU,Artful,OEM] ALSA: hda - Force polling mode on CFL for fixing codec communication | expand

Commit Message

Hui Wang March 26, 2018, 6:37 a.m. UTC
From: Takashi Iwai <tiwai@suse.de>

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

We've observed too long probe time with Coffee Lake (CFL) machines,
and the likely cause is some communication problem between the
HD-audio controller and the codec chips.  While the controller expects
an IRQ wakeup for each codec response, it seems sometimes missing, and
it takes one second for the controller driver to time out and read the
response in the polling mode.

Although we aren't sure about the real culprit yet, in this patch, we
put a workaround by forcing the polling mode as default for CFL
machines; the polling mode itself isn't too heavy, and much better
than other workarounds initially suggested (e.g. disabling
power-save), at least.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=199007
Fixes: e79b0006c45c ("ALSA: hda - Add Coffelake PCI ID")
Reported-and-tested-by: Hui Wang <hui.wang@canonical.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
(cherry picked from commit a8d7bde23e7130686b76624b099f3e22dd38aef7)
Signed-off-by: Hui Wang <hui.wang@canonical.com>
---
 sound/pci/hda/hda_intel.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Aaron Ma March 27, 2018, 5:24 a.m. UTC | #1
Acked-by: Aaron Ma <aaron.ma@canonical.com>
Stefan Bader March 28, 2018, 10:22 a.m. UTC | #2
On 26.03.2018 08:37, Hui Wang wrote:
> From: Takashi Iwai <tiwai@suse.de>
> 
> BugLink: https://bugs.launchpad.net/bugs/1758800
> 
> We've observed too long probe time with Coffee Lake (CFL) machines,
> and the likely cause is some communication problem between the
> HD-audio controller and the codec chips.  While the controller expects
> an IRQ wakeup for each codec response, it seems sometimes missing, and
> it takes one second for the controller driver to time out and read the
> response in the polling mode.
> 
> Although we aren't sure about the real culprit yet, in this patch, we
> put a workaround by forcing the polling mode as default for CFL
> machines; the polling mode itself isn't too heavy, and much better
> than other workarounds initially suggested (e.g. disabling
> power-save), at least.
> 
> Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=199007
> Fixes: e79b0006c45c ("ALSA: hda - Add Coffelake PCI ID")
> Reported-and-tested-by: Hui Wang <hui.wang@canonical.com>
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Takashi Iwai <tiwai@suse.de>
> (cherry picked from commit a8d7bde23e7130686b76624b099f3e22dd38aef7)
> Signed-off-by: Hui Wang <hui.wang@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>

> ---

Is this one needed in Bionic still or already included (either by 4.15 release
or stable update)?

>  sound/pci/hda/hda_intel.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
> index 5ae8dda..f23db5f 100644
> --- a/sound/pci/hda/hda_intel.c
> +++ b/sound/pci/hda/hda_intel.c
> @@ -371,6 +371,7 @@ enum {
>  					((pci)->device == 0x160c))
>  
>  #define IS_BXT(pci) ((pci)->vendor == 0x8086 && (pci)->device == 0x5a98)
> +#define IS_CFL(pci) ((pci)->vendor == 0x8086 && (pci)->device == 0xa348)
>  
>  static char *driver_short_names[] = {
>  	[AZX_DRIVER_ICH] = "HDA Intel",
> @@ -1740,6 +1741,10 @@ static int azx_create(struct snd_card *card, struct pci_dev *pci,
>  	else
>  		chip->bdl_pos_adj = bdl_pos_adj[dev];
>  
> +	/* Workaround for a communication error on CFL (bko#199007) */
> +	if (IS_CFL(pci))
> +		chip->polling_mode = 1;
> +
>  	err = azx_bus_init(chip, model[dev], &pci_hda_io_ops);
>  	if (err < 0) {
>  		kfree(hda);
>
Kleber Sacilotto de Souza March 29, 2018, 4:18 p.m. UTC | #3
On 03/26/18 08:37, Hui Wang wrote:
> From: Takashi Iwai <tiwai@suse.de>
> 
> BugLink: https://bugs.launchpad.net/bugs/1758800
> 
> We've observed too long probe time with Coffee Lake (CFL) machines,
> and the likely cause is some communication problem between the
> HD-audio controller and the codec chips.  While the controller expects
> an IRQ wakeup for each codec response, it seems sometimes missing, and
> it takes one second for the controller driver to time out and read the
> response in the polling mode.
> 
> Although we aren't sure about the real culprit yet, in this patch, we
> put a workaround by forcing the polling mode as default for CFL
> machines; the polling mode itself isn't too heavy, and much better
> than other workarounds initially suggested (e.g. disabling
> power-save), at least.
> 
> Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=199007
> Fixes: e79b0006c45c ("ALSA: hda - Add Coffelake PCI ID")
> Reported-and-tested-by: Hui Wang <hui.wang@canonical.com>
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Takashi Iwai <tiwai@suse.de>
> (cherry picked from commit a8d7bde23e7130686b76624b099f3e22dd38aef7)
> Signed-off-by: Hui Wang <hui.wang@canonical.com>
> ---
>  sound/pci/hda/hda_intel.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
> index 5ae8dda..f23db5f 100644
> --- a/sound/pci/hda/hda_intel.c
> +++ b/sound/pci/hda/hda_intel.c
> @@ -371,6 +371,7 @@ enum {
>  					((pci)->device == 0x160c))
>  
>  #define IS_BXT(pci) ((pci)->vendor == 0x8086 && (pci)->device == 0x5a98)
> +#define IS_CFL(pci) ((pci)->vendor == 0x8086 && (pci)->device == 0xa348)
>  
>  static char *driver_short_names[] = {
>  	[AZX_DRIVER_ICH] = "HDA Intel",
> @@ -1740,6 +1741,10 @@ static int azx_create(struct snd_card *card, struct pci_dev *pci,
>  	else
>  		chip->bdl_pos_adj = bdl_pos_adj[dev];
>  
> +	/* Workaround for a communication error on CFL (bko#199007) */
> +	if (IS_CFL(pci))
> +		chip->polling_mode = 1;
> +
>  	err = azx_bus_init(chip, model[dev], &pci_hda_io_ops);
>  	if (err < 0) {
>  		kfree(hda);
> 

Applied to artful/master-next branch.

Thanks,
Kleber
diff mbox series

Patch

diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index 5ae8dda..f23db5f 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -371,6 +371,7 @@  enum {
 					((pci)->device == 0x160c))
 
 #define IS_BXT(pci) ((pci)->vendor == 0x8086 && (pci)->device == 0x5a98)
+#define IS_CFL(pci) ((pci)->vendor == 0x8086 && (pci)->device == 0xa348)
 
 static char *driver_short_names[] = {
 	[AZX_DRIVER_ICH] = "HDA Intel",
@@ -1740,6 +1741,10 @@  static int azx_create(struct snd_card *card, struct pci_dev *pci,
 	else
 		chip->bdl_pos_adj = bdl_pos_adj[dev];
 
+	/* Workaround for a communication error on CFL (bko#199007) */
+	if (IS_CFL(pci))
+		chip->polling_mode = 1;
+
 	err = azx_bus_init(chip, model[dev], &pci_hda_io_ops);
 	if (err < 0) {
 		kfree(hda);