<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/base/regmap/regmap.c, branch v3.4.69</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v3.4.69</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v3.4.69'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2013-09-08T04:58:14+00:00</updated>
<entry>
<title>regmap: silence GCC warning</title>
<updated>2013-09-08T04:58:14+00:00</updated>
<author>
<name>Paul Bolle</name>
<email>pebolle@tiscali.nl</email>
</author>
<published>2012-10-08T20:06:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ff289c1fa9e4ca50d0ec0197678fa565f7b65d1b'/>
<id>urn:sha1:ff289c1fa9e4ca50d0ec0197678fa565f7b65d1b</id>
<content type='text'>
commit a8f28cfad8cd44d7c34b166d0e5ace1125dbee1f upstream.

Building regmap.o triggers this GCC warning:
    drivers/base/regmap/regmap.c: In function ‘regmap_raw_read’:
    drivers/base/regmap/regmap.c:1172:6: warning: ‘ret’ may be used uninitialized in this function [-Wmaybe-uninitialized]

Long story short: Jakub Jelinek pointed out that there is a type
mismatch between 'num' in regmap_volatile_range() and 'val_count' in
regmap_raw_read(). And indeed, converting 'num' to the type of
'val_count' (ie, size_t) makes this warning go away.

Signed-off-by: Paul Bolle &lt;pebolle@tiscali.nl&gt;
Signed-off-by: Mark Brown &lt;broonie@opensource.wolfsonmicro.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>regmap: fix possible memory corruption in regmap_bulk_read()</title>
<updated>2012-05-09T14:44:11+00:00</updated>
<author>
<name>Laxman Dewangan</name>
<email>ldewangan@nvidia.com</email>
</author>
<published>2012-05-09T12:13:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=6560ffd1ccd688152393dc7c35dbdcc33140633b'/>
<id>urn:sha1:6560ffd1ccd688152393dc7c35dbdcc33140633b</id>
<content type='text'>
The function regmap_bulk_read() calls the regmap_read() for
each register if set of register has volatile and cache is
enabled. In this case, last few register read makes the memory
corruption if the register size is not the size of unsigned int.
The regam_read() takes argument as unsigned int for returning
value and it update the value as
	*val = map-&gt;format.parse_val(map-&gt;work_buf);
This causes complete 4 bytes (size of unsigned int) to get written.
Now if client pass the memory pointer for value which is equal to the
required size of register count in regmap_bulk_read() then last few
register read actually update the memory beyond passed pointer size.

Avoid this by using local variable for read and then do memcpy()
for actual byte copy to passed pointer based on register size.

I allocated one pointer ptr and take first 16 bytes dump of that
pointer then call regmap_bulk_read() with pointer which is just
on top of this allocated pointer and register count of 128. Here
register size is 1 byte.
The memory trace of last 5 register read are as follows:

[    5.438589] regmap_bulk_read after regamp_read() for register 122
[    5.447421] 0xef993c20 0xef993c00 0x00000000 0x00000001
[    5.467535] regmap_bulk_read after regamp_read() for register 123
[    5.476374] 0xef993c20 0xef993c00 0x00000000 0x00000001
[    5.496425] regmap_bulk_read after regamp_read() for register 124
[    5.505260] 0xef993c20 0xef993c00 0x00000000 0x00000001
[    5.525372] regmap_bulk_read after regamp_read() for register 125
[    5.534205] 0xef993c00 0xef993c00 0x00000000 0x00000001
[    5.554258] regmap_bulk_read after regamp_read() for register 126
[    5.563100] 0xef990000 0xef993c00 0x00000000 0x00000001
[    5.554258] regmap_bulk_read after regamp_read() for register 127
[    5.587108] 0xef000000 0xef993c00 0x00000000 0x00000001

Here it is observed that the memory content at first word started changing
on last 3 regmap_read() and so corruption happened.

Signed-off-by: Laxman Dewangan &lt;ldewangan@nvidia.com&gt;
Signed-off-by: Mark Brown &lt;broonie@opensource.wolfsonmicro.com&gt;
</content>
</entry>
<entry>
<title>Merge remote-tracking branch 'regmap/topic/bulk' into regmap-next</title>
<updated>2012-03-14T13:15:48+00:00</updated>
<author>
<name>Mark Brown</name>
<email>broonie@opensource.wolfsonmicro.com</email>
</author>
<published>2012-03-14T13:15:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=addfd8a09e1f434a73b3d87d36ef050c73511d2b'/>
<id>urn:sha1:addfd8a09e1f434a73b3d87d36ef050c73511d2b</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Merge remote-tracking branch 'regmap/topic/introspection' into regmap-next</title>
<updated>2012-03-14T13:15:03+00:00</updated>
<author>
<name>Mark Brown</name>
<email>broonie@opensource.wolfsonmicro.com</email>
</author>
<published>2012-03-14T13:15:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=eae4b51b21f7452b0b53a9848f48c02cb0fac336'/>
<id>urn:sha1:eae4b51b21f7452b0b53a9848f48c02cb0fac336</id>
<content type='text'>
Simple add/add conflict:
	drivers/base/regmap/regmap.c
</content>
</entry>
<entry>
<title>Merge remote-tracking branch 'regmap/topic/drivers' into regmap-next</title>
<updated>2012-03-14T13:13:25+00:00</updated>
<author>
<name>Mark Brown</name>
<email>broonie@opensource.wolfsonmicro.com</email>
</author>
<published>2012-03-14T13:13:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=7d9aca39dcacd2b3f42e2e287162329f410f93e1'/>
<id>urn:sha1:7d9aca39dcacd2b3f42e2e287162329f410f93e1</id>
<content type='text'>
Resolved simple add/add conflicts:
	drivers/base/regmap/internal.h
	drivers/base/regmap/regmap.c
</content>
</entry>
<entry>
<title>Merge remote-tracking branches 'regmap/topic/core' and 'regmap/topic/devm' into regmap-next</title>
<updated>2012-03-14T13:12:33+00:00</updated>
<author>
<name>Mark Brown</name>
<email>broonie@opensource.wolfsonmicro.com</email>
</author>
<published>2012-03-14T13:12:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e1c1c69c8fc7656c33460c8e085ac0d0be22ac3b'/>
<id>urn:sha1:e1c1c69c8fc7656c33460c8e085ac0d0be22ac3b</id>
<content type='text'>
</content>
</entry>
<entry>
<title>regmap: Fix future missing prototype of devres_alloc() and friends</title>
<updated>2012-03-11T12:52:44+00:00</updated>
<author>
<name>Stephen Warren</name>
<email>swarren@wwwdotorg.org</email>
</author>
<published>2012-03-09T20:17:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f5d6eba74b8aac7d4bf646c5445807aa6a247e6c'/>
<id>urn:sha1:f5d6eba74b8aac7d4bf646c5445807aa6a247e6c</id>
<content type='text'>
[Fix for breakage which will be introduced during the merge window via
header reworks in another tree, the regmap tree does include device.h
but Paul's tree breaks that.  Reworded subject to reflect -- broonie]

regmap.s uses devres_alloc() and others that are prototyped in device.h.
Include that to solve the following:

drivers/base/regmap/regmap.c: In function 'devm_regmap_init':
drivers/base/regmap/regmap.c:331:2: error: implicit declaration of function 'devres_alloc' [-Werror=implicit-function-declaration]
drivers/base/regmap/regmap.c:338:3: error: implicit declaration of function 'devres_add' [-Werror=implicit-function-declaration]
drivers/base/regmap/regmap.c:340:3: error: implicit declaration of function 'devres_free' [-Werror=implicit-function-declaration]
drivers/base/regmap/regmap.c: In function '_regmap_raw_write':
drivers/base/regmap/regmap.c:421:5: error: implicit declaration of function 'dev_err' [-Werror=implicit-function-declaration]

Signed-off-by: Stephen Warren &lt;swarren@wwwdotorg.org&gt;
Signed-off-by: Mark Brown &lt;broonie@opensource.wolfsonmicro.com&gt;
</content>
</entry>
<entry>
<title>regmap: delete unused module.h from drivers/base/regmap files</title>
<updated>2012-03-01T11:10:35+00:00</updated>
<author>
<name>Paul Gortmaker</name>
<email>paul.gortmaker@windriver.com</email>
</author>
<published>2012-02-29T00:28:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=19694b5ea1d3a723dafe9544b5ee9a935414dc28'/>
<id>urn:sha1:19694b5ea1d3a723dafe9544b5ee9a935414dc28</id>
<content type='text'>
Remove unused module.h and/or replace with export.h
as required.

Signed-off-by: Paul Gortmaker &lt;paul.gortmaker@windriver.com&gt;
Signed-off-by: Mark Brown &lt;broonie@opensource.wolfsonmicro.com&gt;
</content>
</entry>
<entry>
<title>regmap: Support raw reads from cached registers</title>
<updated>2012-02-21T19:29:18+00:00</updated>
<author>
<name>Mark Brown</name>
<email>broonie@opensource.wolfsonmicro.com</email>
</author>
<published>2012-02-21T19:12:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b8fb5ab156055b745254609f4635fcfd6b7dabc8'/>
<id>urn:sha1:b8fb5ab156055b745254609f4635fcfd6b7dabc8</id>
<content type='text'>
Fall back to a register by register read to do so; most likely we'll be
cache only so the overhead will be low.

Signed-off-by: Mark Brown &lt;broonie@opensource.wolfsonmicro.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'topic/patch' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap into regmap-drivers</title>
<updated>2012-02-20T21:21:33+00:00</updated>
<author>
<name>Mark Brown</name>
<email>broonie@opensource.wolfsonmicro.com</email>
</author>
<published>2012-02-20T21:21:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=aca1e172a1096ed3785e0da01d82943b7562527c'/>
<id>urn:sha1:aca1e172a1096ed3785e0da01d82943b7562527c</id>
<content type='text'>
</content>
</entry>
</feed>
