]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
ALSA: hda - add sanity check to force the separate stream tags
authorJaroslav Kysela <perex@perex.cz>
Wed, 15 Feb 2017 16:09:43 +0000 (17:09 +0100)
committerTakashi Iwai <tiwai@suse.de>
Wed, 15 Feb 2017 20:24:44 +0000 (21:24 +0100)
It seems that newer Intel chipsets have more than 15 I/O streams (total).
This patch forces the separate stream tags, when this hardware is detected
to avoid SDxCTL.STRM field overflow and an unexpected behaviour.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/hda/hda_intel.c

index 7d77bb504a16efd6b1f32a1b8270ed271f6c400c..16108f0eb68848bf189f47f0101273c14443565b 100644 (file)
@@ -1778,6 +1778,14 @@ static int azx_first_init(struct azx *chip)
        chip->playback_index_offset = chip->capture_streams;
        chip->num_streams = chip->playback_streams + chip->capture_streams;
 
+       /* sanity check for the SDxCTL.STRM field overflow */
+       if (chip->num_streams > 15 &&
+           (chip->driver_caps & AZX_DCAPS_SEPARATE_STREAM_TAG) == 0) {
+               dev_warn(chip->card->dev, "number of I/O streams is %d, "
+                        "forcing separate stream tags", chip->num_streams);
+               chip->driver_caps |= AZX_DCAPS_SEPARATE_STREAM_TAG;
+       }
+
        /* initialize streams */
        err = azx_init_streams(chip);
        if (err < 0)