From patchwork Tue May 13 04:36:13 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lin, Mengdong" X-Patchwork-Id: 4162271 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 341E39F271 for ; Tue, 13 May 2014 04:35:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 737C620306 for ; Tue, 13 May 2014 04:35:29 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 772B7202FF for ; Tue, 13 May 2014 04:35:28 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 8DDE026533F; Tue, 13 May 2014 06:35:27 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NO_DNS_FOR_FROM, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 4FD4D265367; Tue, 13 May 2014 06:35:02 +0200 (CEST) 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 55E75265363; Tue, 13 May 2014 06:35:00 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by alsa0.perex.cz (Postfix) with ESMTP id 8279E2652F1 for ; Tue, 13 May 2014 06:34:36 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 12 May 2014 21:34:35 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos; i="4.97,1041,1389772800"; d="scan'208"; a="538042036" Received: from amanda-hsw-pc.sh.intel.com ([10.239.37.27]) by fmsmga002.fm.intel.com with ESMTP; 12 May 2014 21:34:26 -0700 From: mengdong.lin@intel.com To: alsa-devel@alsa-project.org, tiwai@suse.de Date: Tue, 13 May 2014 12:36:13 +0800 Message-Id: <1399955773-3213-1-git-send-email-mengdong.lin@intel.com> X-Mailer: git-send-email 1.8.1.2 Cc: Mengdong Lin Subject: [alsa-devel] [PATCH 2/2] ALSA: hda - mask buggy stream DMA0 for Broadwell display controller 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 From: Mengdong Lin Broadwell display controller has 3 stream DMA engines. DMA0 cannot update DMA postion buffer properly while DMA1 and DMA2 can work well. So this patch masks the buggy DMA0. Signed-off-by: Mengdong Lin diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index 377c3a5..13b13a3 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c @@ -281,6 +281,9 @@ static char *driver_short_names[] = { [AZX_DRIVER_GENERIC] = "HD-Audio Generic", }; +#define is_broadwell_controller(pci) \ + ((pci)->vendor == 0x8086 && (pci)->device == 0x160c) + #ifdef CONFIG_X86 static void __mark_pages_wc(struct azx *chip, struct snd_dma_buffer *dmab, bool on) { @@ -1249,6 +1252,7 @@ static int azx_first_init(struct azx *chip) struct snd_card *card = chip->card; int err; unsigned short gcap; + unsigned int stream_mask = 0; #if BITS_PER_LONG != 64 /* Fix up base address on ULI M5461 */ @@ -1364,7 +1368,10 @@ static int azx_first_init(struct azx *chip) return err; /* initialize streams */ - azx_init_stream(chip, 0); + if (is_broadwell_controller(pci)) + stream_mask = 0x1; /* mask buggy stream DMA0 */ + + azx_init_stream(chip, stream_mask); /* initialize chip */ azx_init_pci(chip);