All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alnie <memobook80@comcast.net>
To: Takashi Iwai <tiwai@suse.de>
Cc: alsa-devel@alsa-project.org
Subject: Re: Issues w/ Creative Labs [SB X-Fi Xtreme Audio] CA0110-IBG
Date: Fri, 06 Mar 2015 14:38:45 -0800	[thread overview]
Message-ID: <54FA2C75.3070802@comcast.net> (raw)
In-Reply-To: <s5hegp56r78.wl-tiwai@suse.de>

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
>

These are the mods I made...

/* PCI register access. */
static void pci_azx_writel(u32 value, u32 __iomem *addr)
{
	writel(value, addr);
	pr_info_ratelimited("XXX writel %p %x\n", addr, val);
	return val;
}

static u32 pci_azx_readl(u32 __iomem *addr)
{
	return 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);
	pr_info_ratelimited("XXX writew %p %x\n", addr, val);
	return val;
}

static u16 pci_azx_readw(u16 __iomem *addr)
{
	return 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);
	pr_info_ratelimited("XXX writeb %p %x\n", addr, val);
	return val;
}

static u8 pci_azx_readb(u8 __iomem *addr)
{
	return readb(addr);
	pr_info_ratelimited("XXX readb %p %x\n", addr, val);
	return val;
}

But I am getting errors for each pci_azx value...

In file included from include/linux/kernel.h:13:0,
                  from include/linux/delay.h:10,
                  from sound/pci/hda/hda_intel.c:37:
sound/pci/hda/hda_intel.c: In function ‘pci_azx_writel’:
sound/pci/hda/hda_intel.c:1701:50: error: ‘val’ undeclared (first use in 
this function)
   pr_info_ratelimited("XXX writel %p %x\n", addr, val);
                                                   ^
include/linux/printk.h:361:17: note: in definition of macro 
‘printk_ratelimited’
    printk(fmt, ##__VA_ARGS__);    \
                  ^
sound/pci/hda/hda_intel.c:1701:2: note: in expansion of macro 
‘pr_info_ratelimited’
   pr_info_ratelimited("XXX writel %p %x\n", addr, val);
   ^
sound/pci/hda/hda_intel.c:1701:50: note: each undeclared identifier is 
reported only once for each function it appears in
   pr_info_ratelimited("XXX writel %p %x\n", addr, val);
                                                   ^
include/linux/printk.h:361:17: note: in definition of macro 
‘printk_ratelimited’
    printk(fmt, ##__VA_ARGS__);    \
                  ^
sound/pci/hda/hda_intel.c:1701:2: note: in expansion of macro 
‘pr_info_ratelimited’
   pr_info_ratelimited("XXX writel %p %x\n", addr, val);
   ^
sound/pci/hda/hda_intel.c:1702:2: warning: ‘return’ with a value, in 
function returning void [enabled by default]
   return val;
   ^

-Alnie

  reply	other threads:[~2015-03-06 22:38 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-03  3:37 Issues w/ Creative Labs [SB X-Fi Xtreme Audio] CA0110-IBG Alnie
2015-03-03  6:10 ` Takashi Iwai
2015-03-03  7:22   ` Alnie
2015-03-03  7:48     ` Takashi Iwai
2015-03-03  9:21       ` Alnie
2015-03-03 21:51         ` Alnie
2015-03-03 21:58           ` Alnie
2015-03-03 22:07           ` Takashi Iwai
2015-03-04  2:12             ` Alnie
2015-03-04  8:00               ` Takashi Iwai
2015-03-04  9:01                 ` Alnie
2015-03-04  9:35                   ` Takashi Iwai
2015-03-06 22:38                     ` Alnie [this message]
2015-03-06 22:50                       ` Alnie
2015-03-06 23:31                     ` Alnie
2015-03-07  7:56                       ` Takashi Iwai
2015-03-07 16:28                         ` Alnie
2015-03-07 16:32                           ` Takashi Iwai
2015-03-07 18:06                             ` Alnie
2015-03-09 15:22                               ` Alnie
2015-03-09 16:00                                 ` Takashi Iwai
2015-03-12  3:59                                   ` Alnie
2015-03-12  6:19                                     ` Takashi Iwai
2015-03-13  2:41                                       ` Alnie
     [not found] <54E10F0C.7070802@yahoo.com>
2015-02-15 21:33 ` Alnie
2015-02-16 16:05   ` Takashi Iwai
2015-02-16 19:03     ` Alnie
2015-02-16 19:52       ` Takashi Iwai
2015-02-22 20:47         ` Alnie
2015-02-22 20:55           ` Alnie
2015-02-24 15:37             ` Takashi Iwai
2015-02-24 18:14               ` Alnie
2015-02-24 19:52                 ` Takashi Iwai
2015-02-24 20:10                   ` Alnie
2015-02-24 20:39                     ` Takashi Iwai
2015-02-24 21:30                       ` Alnie
2015-02-25  4:37                         ` Alnie
2015-02-25  6:28                           ` Takashi Iwai
2015-02-25  6:51                             ` Alnie
2015-02-25  7:06                               ` Takashi Iwai
2015-02-25  7:32                                 ` Alnie
2015-02-25  7:48                                   ` Takashi Iwai
2015-02-25  8:01                                     ` Alnie
     [not found]                                     ` <54ED7FED.9080600@yahoo.com>
2015-02-25  8:06                                       ` Takashi Iwai
2015-02-25  8:21                                         ` Alnie
2015-02-25  8:23                                           ` Takashi Iwai
2015-02-25  8:30                                             ` Alnie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54FA2C75.3070802@comcast.net \
    --to=memobook80@comcast.net \
    --cc=alsa-devel@alsa-project.org \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.