<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/drivers/crypto/img-hash.c, branch v4.19-rc5</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>crypto: img-hash - remove unnecessary static in img_hash_remove()</title>
<updated>2017-08-03T05:47:18+00:00</updated>
<author>
<name>Gustavo A. R. Silva</name>
<email>gustavo@embeddedor.com</email>
</author>
<published>2017-07-18T23:07:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=1ce5b2f348c0e016d6195ffb974f7fb98785c90a'/>
<id>1ce5b2f348c0e016d6195ffb974f7fb98785c90a</id>
<content type='text'>
Remove unnecessary static on local variable hdev. Such variable
is initialized before being used, on every execution path throughout
the function. The static has no benefit and, removing it reduces the
object file size.

This issue was detected using Coccinelle and the following semantic patch:
https://github.com/GustavoARSilva/coccinelle/blob/master/static/static_unused.cocci

In the following log you can see a significant difference in the object
file size. This log is the output of the size command, before and after
the code change:

before:
   text    data     bss     dec     hex filename
  14842    6464     128   21434    53ba drivers/crypto/img-hash.o

after:
   text    data     bss     dec     hex filename
  14789    6376      64   21229    52ed drivers/crypto/img-hash.o

Signed-off-by: Gustavo A. R. Silva &lt;gustavo@embeddedor.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Remove unnecessary static on local variable hdev. Such variable
is initialized before being used, on every execution path throughout
the function. The static has no benefit and, removing it reduces the
object file size.

This issue was detected using Coccinelle and the following semantic patch:
https://github.com/GustavoARSilva/coccinelle/blob/master/static/static_unused.cocci

In the following log you can see a significant difference in the object
file size. This log is the output of the size command, before and after
the code change:

before:
   text    data     bss     dec     hex filename
  14842    6464     128   21434    53ba drivers/crypto/img-hash.o

after:
   text    data     bss     dec     hex filename
  14789    6376      64   21229    52ed drivers/crypto/img-hash.o

Signed-off-by: Gustavo A. R. Silva &lt;gustavo@embeddedor.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>crypto: img-hash - Handle return value of clk_prepare_enable</title>
<updated>2017-05-23T04:52:03+00:00</updated>
<author>
<name>Arvind Yadav</name>
<email>arvind.yadav.cs@gmail.com</email>
</author>
<published>2017-05-16T08:27:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=5f052c9c631d360d6ec6202714b9d6529a21117a'/>
<id>5f052c9c631d360d6ec6202714b9d6529a21117a</id>
<content type='text'>
Here, Clock enable can failed. So adding an error check for
clk_prepare_enable.

Signed-off-by: Arvind Yadav &lt;arvind.yadav.cs@gmail.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Here, Clock enable can failed. So adding an error check for
clk_prepare_enable.

Signed-off-by: Arvind Yadav &lt;arvind.yadav.cs@gmail.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>crypto: img-hash - use dma_data_direction when calling dma_map_sg</title>
<updated>2017-01-23T14:50:23+00:00</updated>
<author>
<name>Nicolas Iooss</name>
<email>nicolas.iooss_linux@m4x.org</email>
</author>
<published>2017-01-15T12:37:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=3bfb2e6b32443841ff90460a78bdefb19f8d61e8'/>
<id>3bfb2e6b32443841ff90460a78bdefb19f8d61e8</id>
<content type='text'>
The fourth argument of dma_map_sg() and dma_unmap_sg() is an item of
dma_data_direction enum. Function img_hash_xmit_dma() wrongly used
DMA_MEM_TO_DEV, which is an item of dma_transfer_direction enum.

Replace DMA_MEM_TO_DEV (which value is 1) with DMA_TO_DEVICE (which
value is fortunately also 1) when calling dma_map_sg() and
dma_unmap_sg().

Signed-off-by: Nicolas Iooss &lt;nicolas.iooss_linux@m4x.org&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The fourth argument of dma_map_sg() and dma_unmap_sg() is an item of
dma_data_direction enum. Function img_hash_xmit_dma() wrongly used
DMA_MEM_TO_DEV, which is an item of dma_transfer_direction enum.

Replace DMA_MEM_TO_DEV (which value is 1) with DMA_TO_DEVICE (which
value is fortunately also 1) when calling dma_map_sg() and
dma_unmap_sg().

Signed-off-by: Nicolas Iooss &lt;nicolas.iooss_linux@m4x.org&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>crypto: img-hash - Fix set_reqsize call</title>
<updated>2016-08-09T10:47:23+00:00</updated>
<author>
<name>Will Thomas</name>
<email>will.thomas@imgtec.com</email>
</author>
<published>2016-08-05T13:00:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=5e38d20088d48b60775bdbdfdf47f8a2c4f6288f'/>
<id>5e38d20088d48b60775bdbdfdf47f8a2c4f6288f</id>
<content type='text'>
Properly allocate enough memory to respect the fallback.

Signed-off-by: Will Thomas &lt;will.thomas@imgtec.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Properly allocate enough memory to respect the fallback.

Signed-off-by: Will Thomas &lt;will.thomas@imgtec.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>crypto: img-hash - log a successful probe</title>
<updated>2016-08-09T10:47:22+00:00</updated>
<author>
<name>James Hartley</name>
<email>james.hartley@imgtec.com</email>
</author>
<published>2016-08-05T13:00:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=fb67740e2fb82c97cca6df24882df4e7c898aae4'/>
<id>fb67740e2fb82c97cca6df24882df4e7c898aae4</id>
<content type='text'>
Currently the probe function only emits an output on success
when debug is specifically enabled. It would be more useful
if this happens by default.

Signed-off-by: James Hartley &lt;james.hartley@imgtec.com&gt;
Reviewed-by: Will Thomas &lt;will.thomas@imgtec.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Currently the probe function only emits an output on success
when debug is specifically enabled. It would be more useful
if this happens by default.

Signed-off-by: James Hartley &lt;james.hartley@imgtec.com&gt;
Reviewed-by: Will Thomas &lt;will.thomas@imgtec.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>crypto: img-hash - Add support for export and import</title>
<updated>2016-08-09T10:47:22+00:00</updated>
<author>
<name>James Hartley</name>
<email>james.hartley@imgtec.com</email>
</author>
<published>2016-08-05T13:00:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=436e3bb52b5b8f0823746cb06e6385d0db7f0811'/>
<id>436e3bb52b5b8f0823746cb06e6385d0db7f0811</id>
<content type='text'>
Currently the img-hash accelerator does not probe
successfully due to a change in the checks made during
registration with the crypto framework. This is due to
import and export functions not being defined. Correct
this.

Signed-off-by: James Hartley &lt;james.hartley@imgtec.com&gt;
Signed-off-by: Will Thomas &lt;will.thomas@imgtec.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Currently the img-hash accelerator does not probe
successfully due to a change in the checks made during
registration with the crypto framework. This is due to
import and export functions not being defined. Correct
this.

Signed-off-by: James Hartley &lt;james.hartley@imgtec.com&gt;
Signed-off-by: Will Thomas &lt;will.thomas@imgtec.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>crypto: img-hash - Add suspend resume hooks for img hash</title>
<updated>2016-08-09T10:47:21+00:00</updated>
<author>
<name>Govindraj Raja</name>
<email>Govindraj.Raja@imgtec.com</email>
</author>
<published>2016-08-05T13:00:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=d084e13a1395cf65d105fb79911329750500f8c5'/>
<id>d084e13a1395cf65d105fb79911329750500f8c5</id>
<content type='text'>
Current img hash claims sys and periph gate clocks
and this can be gated in system suspend scenarios.

Add support for Device pm ops for img hash to gate
the clocks claimed by img hash.

Signed-off-by: Govindraj Raja &lt;Govindraj.Raja@imgtec.com&gt;
Reviewed-by: Will Thomas &lt;will.thomas@imgtec.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Current img hash claims sys and periph gate clocks
and this can be gated in system suspend scenarios.

Add support for Device pm ops for img hash to gate
the clocks claimed by img hash.

Signed-off-by: Govindraj Raja &lt;Govindraj.Raja@imgtec.com&gt;
Reviewed-by: Will Thomas &lt;will.thomas@imgtec.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>crypto: img-hash - Reconfigure DMA Burst length</title>
<updated>2016-08-09T10:47:20+00:00</updated>
<author>
<name>Will Thomas</name>
<email>will.thomas@imgtec.com</email>
</author>
<published>2016-08-05T13:00:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=302a1bee8fd71b01bcf4ca8395c115a60cef52bf'/>
<id>302a1bee8fd71b01bcf4ca8395c115a60cef52bf</id>
<content type='text'>
Burst length of 16 drives the hash accelerator out of spec
and causes stability issues in some cases. Reduce this to
stop data being lost.

Signed-off-by: Will Thomas &lt;will.thomas@imgtec.com&gt;
Reviewed-by: James Hartley &lt;james.hartley@imgtec.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Burst length of 16 drives the hash accelerator out of spec
and causes stability issues in some cases. Reduce this to
stop data being lost.

Signed-off-by: Will Thomas &lt;will.thomas@imgtec.com&gt;
Reviewed-by: James Hartley &lt;james.hartley@imgtec.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>crypto: img-hash - Fix hash request context</title>
<updated>2016-08-09T10:47:20+00:00</updated>
<author>
<name>Will Thomas</name>
<email>will.thomas@imgtec.com</email>
</author>
<published>2016-08-05T13:00:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=dd4f677b0c89280e66ab9bebf97c8c90fbc1c330'/>
<id>dd4f677b0c89280e66ab9bebf97c8c90fbc1c330</id>
<content type='text'>
Move 0 length buffer to end of structure to stop overwriting
fallback request data. This doesn't cause a bug itself as the
buffer is never used alongside the fallback but should be
changed.

Signed-off-by: Will Thomas &lt;will.thomas@imgtec.com&gt;
Reviewed-by: James Hartley &lt;james.hartley@imgtec.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Move 0 length buffer to end of structure to stop overwriting
fallback request data. This doesn't cause a bug itself as the
buffer is never used alongside the fallback but should be
changed.

Signed-off-by: Will Thomas &lt;will.thomas@imgtec.com&gt;
Reviewed-by: James Hartley &lt;james.hartley@imgtec.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>crypto: img-hash - Fix null pointer exception</title>
<updated>2016-08-09T10:47:19+00:00</updated>
<author>
<name>Will Thomas</name>
<email>will.thomas@imgtec.com</email>
</author>
<published>2016-08-05T13:00:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=10badea259fab2ec91a5e6bf1e568a01e4cb5263'/>
<id>10badea259fab2ec91a5e6bf1e568a01e4cb5263</id>
<content type='text'>
Sporadic null pointer exceptions came from here. Fix them.

Signed-off-by: Will Thomas &lt;will.thomas@imgtec.com&gt;
Reviewed-by: James Hartley &lt;james.hartley@imgtec.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Sporadic null pointer exceptions came from here. Fix them.

Signed-off-by: Will Thomas &lt;will.thomas@imgtec.com&gt;
Reviewed-by: James Hartley &lt;james.hartley@imgtec.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</pre>
</div>
</content>
</entry>
</feed>
