Skip to content

Commit e8a7f13

Browse files
Danny Tholenperexg
authored andcommitted
[ALSA] hda-intel - Improve HD-audio codec probing robustness
When modem is disabled in the BIOS, detection of the number of codecs always fails after booting if STATESTS is not cleared first. This patch fixes this problem and also adds an error check in a place where a read error would lead to a very large number of pointless loops. Signed-off-by: Danny Tholen <obiwan@mailmij.org> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
1 parent 768d8c7 commit e8a7f13

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

‎sound/pci/hda/hda_codec.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,8 @@ int snd_hda_get_sub_nodes(struct hda_codec *codec, hda_nid_t nid,
155155
unsigned int parm;
156156

157157
parm = snd_hda_param_read(codec, nid, AC_PAR_NODE_COUNT);
158+
if (parm == -1)
159+
return 0;
158160
*start_id = (parm >> 16) & 0x7fff;
159161
return (int)(parm & 0x7fff);
160162
}

‎sound/pci/hda/hda_intel.c‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -687,6 +687,9 @@ static int azx_reset(struct azx *chip)
687687
{
688688
int count;
689689

690+
/* clear STATESTS */
691+
azx_writeb(chip, STATESTS, STATESTS_INT_MASK);
692+
690693
/* reset controller */
691694
azx_writel(chip, GCTL, azx_readl(chip, GCTL) & ~ICH6_GCTL_RESET);
692695

0 commit comments

Comments
 (0)