From patchwork Wed Oct 29 13:20:04 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 5187791 X-Patchwork-Delegate: tiwai@suse.de Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 6EAEDC11AC for ; Wed, 29 Oct 2014 13:20:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8FB772024C for ; Wed, 29 Oct 2014 13:20:29 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id B432C201FA for ; Wed, 29 Oct 2014 13:20:27 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 5EFD2260572; Wed, 29 Oct 2014 14:20:26 +0100 (CET) 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, RCVD_IN_DNSWL_NONE,UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 4E8A9260515; Wed, 29 Oct 2014 14:20:15 +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 4BF43260537; Wed, 29 Oct 2014 14:20:14 +0100 (CET) Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id 59D762604FF for ; Wed, 29 Oct 2014 14:20:06 +0100 (CET) Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 20EC9AD55; Wed, 29 Oct 2014 13:20:05 +0000 (UTC) Date: Wed, 29 Oct 2014 14:20:04 +0100 Message-ID: From: Takashi Iwai To: Geoffrey McRae In-Reply-To: References: <1407328755-1021-1-git-send-email-tiwai@suse.de> <20141029072124.2cc32661@sarah.home.spacevs.com> <20141029231315.77e79b70@sarah.home.spacevs.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/24.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Cc: alsa-devel@alsa-project.org Subject: Re: [alsa-devel] [PATCH 1/2] ALSA: hda - Fix probing and stuttering on CMI8888 HD-audio 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP At Wed, 29 Oct 2014 14:01:20 +0100, Takashi Iwai wrote: > > At Wed, 29 Oct 2014 23:13:15 +1100, > Geoffrey McRae wrote: > > > > On Wed, 29 Oct 2014 08:50:53 +0100 > > Takashi Iwai wrote: > > > > > At Wed, 29 Oct 2014 07:21:24 +1100, > > > Geoffrey McRae wrote: > > > > > > > > I can confirm that disable of MSI is required as even Windows 7 > > > > 64bit does not enable this for Intel HDA. Out of curiosity I altered > > > > the driver to use MSI-X with the same results, interrupts are never > > > > received even though the PCI caps state that MSI is supported. > > > > > > > > Playback is very poor and stutters if I do not allow snoop by > > > > commenting out "case AZX_DRIVER_CMEDIA:" in > > > > azx_check_snoop_available. > > > > > > OK, so we have some conflicting results. Possibly we need non-cached > > > pages only for CORB/RIRB but leave the stream buffers? Could you > > > check the patch below? > > > > > > > The patch works fine, no errors reported, if I however disable snoop it > > continues to stutter. > > OK, so the stuttering comes from the noncached pages of stream > buffers, not CORB/RIRB coherency. I'll cook it up as a proper patch, > then. Once when we confirm that the snoop for CORB/RIRB is really > superfluous, we can drop that hack, too. Hold on. The previous patch was wrong. My intention was to set wc for CORB/RIRB but not for buffers, but the patch enabled snoop wrongly for all. Below is the fixed one. It also covers the pgprot setup for mmap, which is also relevant. Please check whether it results in stuttering, too. If yes, we just need to enable snoop again. thanks, Takashi diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index cfcca4c30d4d..9ab1e631cb32 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c @@ -374,6 +374,8 @@ static void __mark_pages_wc(struct azx *chip, struct snd_dma_buffer *dmab, bool #ifdef CONFIG_SND_DMA_SGBUF if (dmab->dev.type == SNDRV_DMA_TYPE_DEV_SG) { struct snd_sg_buf *sgbuf = dmab->private_data; + if (chip->driver_type == AZX_DRIVER_CMEDIA) + return; /* deal with only CORB/RIRB buffers */ if (on) set_pages_array_wc(sgbuf->page_table, sgbuf->pages); else @@ -1769,7 +1771,7 @@ static void pcm_mmap_prepare(struct snd_pcm_substream *substream, #ifdef CONFIG_X86 struct azx_pcm *apcm = snd_pcm_substream_chip(substream); struct azx *chip = apcm->chip; - if (!azx_snoop(chip)) + if (!azx_snoop(chip) && chip->driver_type != AZX_DRIVER_CMEDIA) area->vm_page_prot = pgprot_writecombine(area->vm_page_prot); #endif }