lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 03 Jul 2009 12:15:45 +0200
From:	Lars-Peter Clausen <lars@...afoo.de>
To:	Mark Brown <broonie@...nsource.wolfsonmicro.com>
CC:	alsa-devel@...a-project.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] ASoC: Fix wm8753 register cache size and initialization

Mark Brown wrote:
> On Fri, Jul 03, 2009 at 12:46:08AM +0200, Lars-Peter Clausen wrote:
>
>   
>> The register cache size is of by one. There are 63 registers in use but the
>> register cache size has only space for 62.
>>     
>
> Only 62 of the registers are cached - please see the register cache
> access code.
>   
Yes. Thats the problem. The register cache holds place for 62 elements 
where as there are 63 register which should be cached.
In the register cache access code you subtract one from the registers 
index to get it's index in the register cache array, so the last 
register has the index 62. Which means it is the 63th element of the 
array and thus the array has to consist of 63 elements.

Currently reads to WM8753_ADCTL2 will always return -1 as it is out of 
the register cache bounds which causes the OUT4 control to be unusable 
and as a side effect audio volume will be quite low.
>   
>> Furthermore the codec's reg_cache_size is of by another one. Since the wm8753
>> register cache uses one-based indexing we have to add one to its size.
>>     
>
> I'm not 100% sure what you mean here but I suspect you're misreading the
> register cache access code?
>   
The register cache access code uses one-based indexing so the first 
element in the register cache array will be the register with the number 
1 and the last register has the number ARRAY_SIZE(wm8753_reg).
Now if you set reg_cache_size to ARRAY_SIZE(wm8753_reg) the last 
register will never show up in devices codec_reg sysfs file as its index 
is not lower the reg_cache_size.

- Lars
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ