From patchwork Sat Mar 7 16:32:41 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 5959661 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A02269F380 for ; Sat, 7 Mar 2015 16:33:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A0535202B4 for ; Sat, 7 Mar 2015 16:33:05 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 616D42022A for ; Sat, 7 Mar 2015 16:33:04 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 69F982605E1; Sat, 7 Mar 2015 17:32:58 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id C704A2605F1; Sat, 7 Mar 2015 17:32:49 +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 19808260614; Sat, 7 Mar 2015 17:32:49 +0100 (CET) Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id 380D62605D0 for ; Sat, 7 Mar 2015 17:32:42 +0100 (CET) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id BDF58AAF3; Sat, 7 Mar 2015 16:32:41 +0000 (UTC) Date: Sat, 07 Mar 2015 17:32:41 +0100 Message-ID: From: Takashi Iwai To: Alnie In-Reply-To: <54FB272D.1080004@comcast.net> References: <54F52C68.6010504@comcast.net> <54F5614C.9010402@comcast.net> <54F57D07.9020900@comcast.net> <54F62CDC.1010607@comcast.net> <54F66A0F.1050603@comcast.net> <54F6C9EC.3080100@comcast.net> <54FA38D4.6090206@comcast.net> <54FB272D.1080004@comcast.net> 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.4 (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] Issues w/ Creative Labs [SB X-Fi Xtreme Audio] CA0110-IBG 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 Sat, 07 Mar 2015 08:28:29 -0800, Alnie wrote: > > On 03/06/2015 11:56 PM, Takashi Iwai wrote: > > At Fri, 06 Mar 2015 15:31:32 -0800, > > Alnie wrote: > >> > >> On 03/04/2015 01:35 AM, Takashi Iwai wrote: > >>> At Wed, 04 Mar 2015 01:01:32 -0800, > >>> Alnie wrote: > >>>> > >>>> > >>>> > >>>> On 03/04/2015 12:00 AM, Takashi Iwai wrote: > >>>>> At Tue, 03 Mar 2015 18:12:31 -0800, > >>>>> Alnie wrote: > >>>>>> > >>>>>>> My suggestion isn't about a compile option but that you add some debug > >>>>>>> printk() calls manually around some codes. We need to know the value > >>>>>>> written and read by azx_write*() and azx_read*() calls. Especially > >>>>>>> the value read in pci_azx_read*() is more interesting. You can try to > >>>>>>> modify sound/pci/hda/hda_intel.c and add a printk() to each > >>>>>>> pci_azx_read*() function for printing the value to be returned. > >>>>>>> Beware that this will likely flood many messages, so just try once. > >>>>>>> > >>>>>>> > >>>>>>> Takashi > >>>>>>> > >>>>>> > >>>>>> I can not find any reference to pci_azx_read in hda_intel.c > >>>>> > >>>>> You must be using a too old kernel, then. Please use the latest > >>>>> kernel for debugging. > >>>>> > >>>>> > >>>>> Takashi > >>>>> > >>>> > >>>> Ok. I now have latest kernel. > >>>> > >>>> Here is a small portion... > >>>> > >>>> /* PCI register access. */ > >>>> static void pci_azx_writel(u32 value, u32 __iomem *addr) > >>>> { > >>>> writel(value, addr); > >>>> } > >>>> > >>>> static u32 pci_azx_readl(u32 __iomem *addr) > >>>> { > >>>> return readl(addr); > >>>> } > >>>> > >>>> Can you show me how I can properly place printk without breaking things > >>>> and produce relevant messages? > >>> > >>> Something like: > >>> > >>> static u32 pci_azx_readl(u32 __iomem *addr) > >>> { > >>> u32 val = readl(addr); > >>> pr_info("XXX readl %p %x\n", addr, val); > >>> return val; > >>> } > >>> > >>> But since there are quite lots of accesses, it might be safer to use > >>> the ratelimited version. Use like the following: > >>> pr_info_ratelimited("XXX readl %p %x\n", addr, val); > >>> > >>> Also there are variants pci_azx_readw() and _readb(). > >>> > >>> > >>> Takashi > >>> > >> > >> > >> Ok, I was only able to guess through the code for the read values. If > >> you need write information too please show me how. > >> here are the mods I made... > >> > >> /* PCI register access. */ > >> static void pci_azx_writel(u32 value, u32 __iomem *addr) > >> { > >> writel(value, addr); > >> } > >> > >> static u32 pci_azx_readl(u32 __iomem *addr) > >> { > >> u32 val = readl(addr); > >> pr_info_ratelimited("XXX readl %p %x\n", addr, val); > >> return val; > >> } > >> > >> static void pci_azx_writew(u16 value, u16 __iomem *addr) > >> { > >> writew(value, addr); > >> } > >> > >> static u16 pci_azx_readw(u16 __iomem *addr) > >> { > >> u16 val = readw(addr); > >> pr_info_ratelimited("XXX readw %p %x\n", addr, val); > >> return val; > >> } > >> > >> static void pci_azx_writeb(u8 value, u8 __iomem *addr) > >> { > >> writeb(value, addr); > >> } > >> > >> static u8 pci_azx_readb(u8 __iomem *addr) > >> { > >> u8 val = readb(addr); > >> pr_info_ratelimited("XXX readb %p %x\n", addr, val); > >> return val; > >> } > >> > >> and i was able to produce this... > >> > >> dmesg | grep -i read > >> [ 0.764102] tpm_tis 00:05: A TPM error (7) occurred attempting to > >> read a pcr value > >> [ 0.769674] Write protecting the kernel read-only data: 12288k > >> [ 1.729952] sd 0:0:0:0: [sda] Write cache: enabled, read cache: > >> enabled, doesn't support DPO or FUA > >> [ 2.071100] sd 1:0:0:0: [sdb] Write cache: enabled, read cache: > >> enabled, doesn't support DPO or FUA > >> [ 2.778875] EXT4-fs (sda5): INFO: recovery required on readonly > >> filesystem > >> [ 2.817982] EXT4-fs (sda5): orphan cleanup on readonly fs > >> [ 4.662442] XXX readw ffffc90004f30000 4401 > > > > This reads good, but I thought you have two sound devices (onboard and > > Creative)? If so, disable the onboard one via enable=0 option (if the > > onboard one is assigned first). Otherwise the all good and bad > > results are mixed up. > > > > > > Takashi > > > > I included options snd-hda-intel enable=0 index=0 > > This is dmesg output (1b is onboard)... > dmesg | grep -i hda > [ 3.700213] snd_hda_intel: probe of 0000:00:1b.0 failed with error -2 > [ 37.729507] snd_hda_intel 0000:06:00.0: enabling device (0000 -> 0002) > [ 37.729703] snd_hda_intel 0000:06:00.0: enabling bus mastering > [ 37.736026] snd_hda_intel 0000:06:00.0: CORB reset timeout#1, CORBRP = 0 > [ 38.740090] snd_hda_intel 0000:06:00.0: Codec #1 probe error; > disabling it... > [ 38.747292] snd_hda_intel 0000:06:00.0: CORB reset timeout#1, CORBRP = 0 > [ 43.776089] snd_hda_intel 0000:06:00.0: no AFG or MFG node found > [ 43.776111] snd_hda_intel 0000:06:00.0: no codecs initialized > > dmesg | grep -i XXX > [ 37.729723] XXX readw ffffc90005188000 3300 > [ 37.729768] XXX readl ffffc90005188008 0 OK, so all read look fine. Right now we saw a bug report with git bisection showing a bad commit in HD-audio controller code. This might be your issue, too. Could you try the following oneliner? thanks, Takashi diff --git a/sound/pci/hda/hda_controller.c b/sound/pci/hda/hda_controller.c index 7b4377265b25..57c4575fac26 100644 --- a/sound/pci/hda/hda_controller.c +++ b/sound/pci/hda/hda_controller.c @@ -1194,7 +1194,7 @@ static unsigned int azx_rirb_get_response(struct hda_bus *bus, } } - if (!bus->no_response_fallback) + if (bus->no_response_fallback) return -1; if (!chip->polling_mode && chip->poll_count < 2) {