From patchwork Wed Feb 15 16:09:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jaroslav Kysela X-Patchwork-Id: 9574419 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 007EE60493 for ; Wed, 15 Feb 2017 16:20:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E4B5728477 for ; Wed, 15 Feb 2017 16:20:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D9D3528499; Wed, 15 Feb 2017 16:20:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_NONE,T_DKIM_INVALID autolearn=no version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E1D1328477 for ; Wed, 15 Feb 2017 16:20:37 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id F01BA266CDA; Wed, 15 Feb 2017 17:11:00 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 33549266CDB; Wed, 15 Feb 2017 17:11:00 +0100 (CET) Received: from mail1.perex.cz (mail1.perex.cz [77.48.224.245]) by alsa0.perex.cz (Postfix) with ESMTP id 8EB2C265142 for ; Wed, 15 Feb 2017 17:10:58 +0100 (CET) Received: from mail1.perex.cz (localhost [127.0.0.1]) by smtp1.perex.cz (Perex's E-mail Delivery System) with ESMTP id 6973EA0040; Wed, 15 Feb 2017 17:10:58 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.perex.cz 6973EA0040 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=perex.cz; s=default; t=1487175058; bh=LOYsHs2OGxe3ENVq/zliXY689stejfa9g35F5DiKMkE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CXnfJEn7UdXq8RC/otkvpebq0lGzubJ7Os9R+fp+fDVyTHB1KkUFBv06mhwE5Fg6u 4em7nUuSc0PEXeNAV+hNiXBuhf3olmMCbY6hJkKgxFOnBvycSLAaHfrgf7lGrJ4BKd LljZ7cb607rcpKd3/T+3ndKHUBE2pAaop372CALM= Received: from t510.perex-int.cz (t510.perex-int.cz [192.168.100.96]) by mail1.perex.cz (Perex's E-mail Delivery System) with ESMTP; Wed, 15 Feb 2017 17:10:21 +0100 (CET) From: Jaroslav Kysela To: ALSA development Date: Wed, 15 Feb 2017 17:09:43 +0100 Message-Id: <20170215160943.26504-2-perex@perex.cz> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170215160943.26504-1-perex@perex.cz> References: <20170215160943.26504-1-perex@perex.cz> Cc: Takashi Iwai Subject: [alsa-devel] [PATCH 2/2] ALSA: hda - add sanity check to force the separate stream tags X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- sound/pci/hda/hda_intel.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index 7d77bb5..16108f0e 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c @@ -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)