<feed xmlns='http://www.w3.org/2005/Atom'>
<title>lwn.git/drivers/char/hw_random/amd-rng.c, branch standardize-docs</title>
<subtitle>Linux kernel documentation tree maintained by Jonathan Corbet</subtitle>
<id>http://mirrors.hust.edu.cn/git/lwn.git/atom?h=standardize-docs</id>
<link rel='self' href='http://mirrors.hust.edu.cn/git/lwn.git/atom?h=standardize-docs'/>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/'/>
<updated>2017-03-16T09:43:10+00:00</updated>
<entry>
<title>hwrng: amd - Revert managed API changes</title>
<updated>2017-03-16T09:43:10+00:00</updated>
<author>
<name>Prarit Bhargava</name>
<email>prarit@redhat.com</email>
</author>
<published>2017-03-14T11:36:01+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=69db7009318758769d625b023402161c750f7876'/>
<id>urn:sha1:69db7009318758769d625b023402161c750f7876</id>
<content type='text'>
After commit 31b2a73c9c5f ("hwrng: amd - Migrate to managed API"), the
amd-rng driver uses devres with pci_dev-&gt;dev to keep track of resources,
but does not actually register a PCI driver.  This results in the
following issues:

1. The message

WARNING: CPU: 2 PID: 621 at drivers/base/dd.c:349 driver_probe_device+0x38c

is output when the i2c_amd756 driver loads and attempts to register a PCI
driver.  The PCI &amp; device subsystems assume that no resources have been
registered for the device, and the WARN_ON() triggers since amd-rng has
already do so.

2.  The driver leaks memory because the driver does not attach to a
device.  The driver only uses the PCI device as a reference.   devm_*()
functions will release resources on driver detach, which the amd-rng
driver will never do.  As a result,

3.  The driver cannot be reloaded because there is always a use of the
ioport and region after the first load of the driver.

Revert the changes made by 31b2a73c9c5f ("hwrng: amd - Migrate to managed
API").

Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Prarit Bhargava &lt;prarit@redhat.com&gt;
Fixes: 31b2a73c9c5f ("hwrng: amd - Migrate to managed API").
Cc: Matt Mackall &lt;mpm@selenic.com&gt;
Cc: Corentin LABBE &lt;clabbe.montjoie@gmail.com&gt;
Cc: PrasannaKumar Muralidharan &lt;prasannatsmkumar@gmail.com&gt;
Cc: Wei Yongjun &lt;weiyongjun1@huawei.com&gt;
Cc: linux-crypto@vger.kernel.org
Cc: linux-geode@lists.infradead.org
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>hwrng: amd - Fix return value check in mod_init()</title>
<updated>2016-09-22T10:27:48+00:00</updated>
<author>
<name>Wei Yongjun</name>
<email>weiyongjun1@huawei.com</email>
</author>
<published>2016-09-16T01:49:41+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=f7eca278a8f81e701848392b522f80078bf2589f'/>
<id>urn:sha1:f7eca278a8f81e701848392b522f80078bf2589f</id>
<content type='text'>
In case of error, the function devm_kzalloc() or devm_ioport_map()
return NULL pointer not ERR_PTR(). The IS_ERR() test in the return
value check should be replaced with NULL test.

Fixes: 31b2a73c9c5f ("hwrng: amd - Migrate to managed API")
Signed-off-by: Wei Yongjun &lt;weiyongjun1@huawei.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>hwrng: amd - Migrate to managed API</title>
<updated>2016-09-13T12:27:23+00:00</updated>
<author>
<name>PrasannaKumar Muralidharan</name>
<email>prasannatsmkumar@gmail.com</email>
</author>
<published>2016-09-09T07:58:23+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=31b2a73c9c5f1f02c896c4e434957b831dd50a7f'/>
<id>urn:sha1:31b2a73c9c5f1f02c896c4e434957b831dd50a7f</id>
<content type='text'>
Managed API eliminates error handling code, thus reduces several lines
of code.

Signed-off-by: PrasannaKumar Muralidharan &lt;prasannatsmkumar@gmail.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>hwrng: amd - Convert to new hwrng read() API</title>
<updated>2016-08-31T15:00:47+00:00</updated>
<author>
<name>Corentin LABBE</name>
<email>clabbe.montjoie@gmail.com</email>
</author>
<published>2016-08-26T11:11:36+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=85962d2248fae84ffaa04f09826596d20af56819'/>
<id>urn:sha1:85962d2248fae84ffaa04f09826596d20af56819</id>
<content type='text'>
This patch convert the hwrng interface used by amd768-rng to its new API
by replacing data_read()/data_present() by read().

Signed-off-by: LABBE Corentin &lt;clabbe.montjoie@gmail.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>hwrng: amd - Access hardware via ioread32/iowrite32</title>
<updated>2016-08-31T15:00:46+00:00</updated>
<author>
<name>Corentin LABBE</name>
<email>clabbe.montjoie@gmail.com</email>
</author>
<published>2016-08-26T11:11:35+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=3c343a37644c5fe07960c3226a463d98627607f0'/>
<id>urn:sha1:3c343a37644c5fe07960c3226a463d98627607f0</id>
<content type='text'>
Instead of accessing hw directly via pmbase, it's better to
access after ioport_map() via ioread32/iowrite32.

Signed-off-by: LABBE Corentin &lt;clabbe.montjoie@gmail.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>hwrng: amd - Replace global variable with private struct</title>
<updated>2016-08-31T15:00:45+00:00</updated>
<author>
<name>Corentin LABBE</name>
<email>clabbe.montjoie@gmail.com</email>
</author>
<published>2016-08-26T11:11:34+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=7bad2cc062b343575f19d5de6be3f297a1429f37'/>
<id>urn:sha1:7bad2cc062b343575f19d5de6be3f297a1429f37</id>
<content type='text'>
Instead of having two global variable, it's better to use a
private struct. This will permit to remove amd_pdev variable

Signed-off-by: LABBE Corentin &lt;clabbe.montjoie@gmail.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>hwrng: amd - release_region must be called after hwrng_unregister</title>
<updated>2016-08-31T15:00:45+00:00</updated>
<author>
<name>Corentin LABBE</name>
<email>clabbe.montjoie@gmail.com</email>
</author>
<published>2016-08-26T11:11:33+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=fdec60d683568c8e79457c106fa6642ca7ae95f3'/>
<id>urn:sha1:fdec60d683568c8e79457c106fa6642ca7ae95f3</id>
<content type='text'>
The driver release the memory region before being sure that nobody use
it.

This patch made hwrng_unregister ran before any release was done.

Signed-off-by: LABBE Corentin &lt;clabbe.montjoie@gmail.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>hwrng: amd - Remove asm/io.h</title>
<updated>2016-08-31T15:00:44+00:00</updated>
<author>
<name>Corentin LABBE</name>
<email>clabbe.montjoie@gmail.com</email>
</author>
<published>2016-08-26T11:11:32+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=055ae890388ad2b02a53d5c3e1f60f976989e34e'/>
<id>urn:sha1:055ae890388ad2b02a53d5c3e1f60f976989e34e</id>
<content type='text'>
checkpatch complains about &lt;asm/io.h&gt; used instead of linux/io.h.
In fact it is not needed.
This patch remove it, and in the process, alphabetize the other headers.

Signed-off-by: LABBE Corentin &lt;clabbe.montjoie@gmail.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>hwrng: amd - Be consitent with the driver name</title>
<updated>2016-08-31T15:00:43+00:00</updated>
<author>
<name>Corentin LABBE</name>
<email>clabbe.montjoie@gmail.com</email>
</author>
<published>2016-08-26T11:11:31+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=f8169bfb4955ebb669b49d5d2564b250cdd7aa7b'/>
<id>urn:sha1:f8169bfb4955ebb669b49d5d2564b250cdd7aa7b</id>
<content type='text'>
The driver name is displayed each time differently.
This patch make use of the same name everywhere.

Signed-off-by: LABBE Corentin &lt;clabbe.montjoie@gmail.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>hwrng: amd - use the BIT macro</title>
<updated>2016-08-31T15:00:43+00:00</updated>
<author>
<name>Corentin LABBE</name>
<email>clabbe.montjoie@gmail.com</email>
</author>
<published>2016-08-26T11:11:30+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=1c335d4487c8988364b68c862324fbb3567d00ee'/>
<id>urn:sha1:1c335d4487c8988364b68c862324fbb3567d00ee</id>
<content type='text'>
This patch add usage of the BIT() macro

Signed-off-by: LABBE Corentin &lt;clabbe.montjoie@gmail.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
</feed>
