Skip to content

Commit

Permalink
ALSA: hda - Force polling mode on CFL for fixing codec communication
Browse files Browse the repository at this point in the history
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: e79b000 ("ALSA: hda - Add Coffelake PCI ID")
Reported-and-tested-by: Hui Wang <[email protected]>
Cc: <[email protected]>
Signed-off-by: Takashi Iwai <[email protected]>
  • Loading branch information
tiwai committed Mar 21, 2018
1 parent a6618f4 commit a8d7bde
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions sound/pci/hda/hda_intel.c
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,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",
Expand Down Expand Up @@ -1744,6 +1745,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);
Expand Down

0 comments on commit a8d7bde

Please sign in to comment.