Skip to content

Commit 130bce3

Browse files
RanderWangtiwai
authored andcommitted
ALSA: hdac: clear link output stream mapping
Fix potential DMA hang upon starting playback on devices in HDA mode on Intel platforms (Gemini Lake/Whiskey Lake/Comet Lake/Ice Lake). It doesn't affect platforms before Gemini Lake or any Intel device in non-HDA mode. The reset value for the LOSDIV register is all output streams valid. Clear this register to invalidate non-existent streams when the bus is powered up. Signed-off-by: Rander Wang <[email protected]> Signed-off-by: Pierre-Louis Bossart <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
1 parent 1099f48 commit 130bce3

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

include/sound/hda_register.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,9 @@ enum { SDI0, SDI1, SDI2, SDI3, SDO0, SDO1, SDO2, SDO3 };
264264
#define AZX_REG_ML_LOUTPAY 0x20
265265
#define AZX_REG_ML_LINPAY 0x30
266266

267+
/* bit0 is reserved, with BIT(1) mapping to stream1 */
268+
#define ML_LOSIDV_STREAM_MASK 0xFFFE
269+
267270
#define ML_LCTL_SCF_MASK 0xF
268271
#define AZX_MLCTL_SPA (0x1 << 16)
269272
#define AZX_MLCTL_CPA (0x1 << 23)

sound/hda/ext/hdac_ext_controller.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,11 @@ int snd_hdac_ext_bus_link_get(struct hdac_bus *bus,
270270

271271
ret = snd_hdac_ext_bus_link_power_up(link);
272272

273+
/*
274+
* clear the register to invalidate all the output streams
275+
*/
276+
snd_hdac_updatew(link->ml_addr, AZX_REG_ML_LOSIDV,
277+
ML_LOSIDV_STREAM_MASK, 0);
273278
/*
274279
* wait for 521usec for codec to report status
275280
* HDA spec section 4.3 - Codec Discovery

0 commit comments

Comments
 (0)