<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/crypto/crypto_engine.c, branch v6.12.80</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.12.80</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.12.80'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2023-10-01T08:28:15+00:00</updated>
<entry>
<title>crypto: engine - Make crypto_engine_exit() return void</title>
<updated>2023-10-01T08:28:15+00:00</updated>
<author>
<name>Uwe Kleine-König</name>
<email>u.kleine-koenig@pengutronix.de</email>
</author>
<published>2023-09-23T10:08:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=5ec12f1c7bac891c3268dd6e441a3755ca2b46e0'/>
<id>urn:sha1:5ec12f1c7bac891c3268dd6e441a3755ca2b46e0</id>
<content type='text'>
All callers ignore the return value, so simplify by not providing one.

Note that crypto_engine_exit() is typically called in a device driver's
remove path (or the error path in probe), where errors cannot be handled
anyhow.

Signed-off-by: Uwe Kleine-König &lt;u.kleine-koenig@pengutronix.de&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: engine - Remove crypto_engine_ctx</title>
<updated>2023-08-18T09:01:11+00:00</updated>
<author>
<name>Herbert Xu</name>
<email>herbert@gondor.apana.org.au</email>
</author>
<published>2023-08-13T06:55:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=5ce0bc68e0eeab14fe4dd3be9975c5ced7b20617'/>
<id>urn:sha1:5ce0bc68e0eeab14fe4dd3be9975c5ced7b20617</id>
<content type='text'>
Remove the obsolete crypto_engine_ctx structure.

Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: engine - Move crypto_engine_ops from request into crypto_alg</title>
<updated>2023-08-18T09:01:10+00:00</updated>
<author>
<name>Herbert Xu</name>
<email>herbert@gondor.apana.org.au</email>
</author>
<published>2023-08-13T06:54:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e5e7eb023f24653b07329162b6359283b3a03a20'/>
<id>urn:sha1:e5e7eb023f24653b07329162b6359283b3a03a20</id>
<content type='text'>
Rather than having the callback in the request, move it into the
crypto_alg object.  This avoids having crypto_engine look into the
request context is private to the driver.

Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: engine - Create internal/engine.h</title>
<updated>2023-08-18T09:01:10+00:00</updated>
<author>
<name>Herbert Xu</name>
<email>herbert@gondor.apana.org.au</email>
</author>
<published>2023-08-13T06:54:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=45c461c503a7a12f4c5efaff289be17a442aeefe'/>
<id>urn:sha1:45c461c503a7a12f4c5efaff289be17a442aeefe</id>
<content type='text'>
Create crypto/internal/engine.h to house details that should not
be used by drivers.  It is empty for the time being.

Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: engine - Move crypto inclusions out of header file</title>
<updated>2023-08-18T09:01:10+00:00</updated>
<author>
<name>Herbert Xu</name>
<email>herbert@gondor.apana.org.au</email>
</author>
<published>2023-08-13T06:54:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=68021dee251e72d87ebbf052acf69b3217c11383'/>
<id>urn:sha1:68021dee251e72d87ebbf052acf69b3217c11383</id>
<content type='text'>
The engine file does not need the actual crypto type definitions
so move those header inclusions to where they are actually used.

Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: engine - Remove prepare/unprepare request</title>
<updated>2023-08-18T09:01:10+00:00</updated>
<author>
<name>Herbert Xu</name>
<email>herbert@gondor.apana.org.au</email>
</author>
<published>2023-08-13T06:54:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=bcd6e41d983621954dfc3f1f64249a55838b3e6a'/>
<id>urn:sha1:bcd6e41d983621954dfc3f1f64249a55838b3e6a</id>
<content type='text'>
The callbacks for prepare and unprepare request in crypto_engine
is superfluous.  They can be done directly from do_one_request.

Move the code into do_one_request and remove the unused callbacks.

Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: engine - fix crypto_queue backlog handling</title>
<updated>2023-04-28T09:50:43+00:00</updated>
<author>
<name>Olivier Bacon</name>
<email>olivierb89@gmail.com</email>
</author>
<published>2023-04-20T15:00:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=4140aafcff167b5b9e8dae6a1709a6de7cac6f74'/>
<id>urn:sha1:4140aafcff167b5b9e8dae6a1709a6de7cac6f74</id>
<content type='text'>
CRYPTO_TFM_REQ_MAY_BACKLOG tells the crypto driver that it should
internally backlog requests until the crypto hw's queue becomes
full. At that point, crypto_engine backlogs the request and returns
-EBUSY. Calling driver such as dm-crypt then waits until the
complete() function is called with a status of -EINPROGRESS before
sending a new request.

The problem lies in the call to complete() with a value of -EINPROGRESS
that is made when a backlog item is present on the queue. The call is
done before the successful execution of the crypto request. In the case
that do_one_request() returns &lt; 0 and the retry support is available,
the request is put back in the queue. This leads upper drivers to send
a new request even if the queue is still full.

The problem can be reproduced by doing a large dd into a crypto
dm-crypt device. This is pretty easy to see when using
Freescale CAAM crypto driver and SWIOTLB dma. Since the actual amount
of requests that can be hold in the queue is unlimited we get IOs error
and dma allocation.

The fix is to call complete with a value of -EINPROGRESS only if
the request is not enqueued back in crypto_queue. This is done
by calling complete() later in the code. In order to delay the decision,
crypto_queue is modified to correctly set the backlog pointer
when a request is enqueued back.

Fixes: 6a89f492f8e5 ("crypto: engine - support for parallel requests based on retry mechanism")
Co-developed-by: Sylvain Ouellet &lt;souellet@genetec.com&gt;
Signed-off-by: Sylvain Ouellet &lt;souellet@genetec.com&gt;
Signed-off-by: Olivier Bacon &lt;obacon@genetec.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: engine - Use crypto_request_complete</title>
<updated>2023-02-13T10:34:49+00:00</updated>
<author>
<name>Herbert Xu</name>
<email>herbert@gondor.apana.org.au</email>
</author>
<published>2023-01-31T08:02:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=6909823d47c17cba84e9244d04050b5db8d53789'/>
<id>urn:sha1:6909823d47c17cba84e9244d04050b5db8d53789</id>
<content type='text'>
Use the crypto_request_complete helper instead of calling the
completion function directly.

Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: engine - Fix excess parameter doc warning</title>
<updated>2023-01-27T10:58:09+00:00</updated>
<author>
<name>Herbert Xu</name>
<email>herbert@gondor.apana.org.au</email>
</author>
<published>2023-01-22T08:56:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=42a9a08b9aa69134981d1564f95eb06c0469eff3'/>
<id>urn:sha1:42a9a08b9aa69134981d1564f95eb06c0469eff3</id>
<content type='text'>
The engine parameter should not be marked for kernel doc as it
triggers a warning.

Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: engine - Add parameter description in crypto_transfer_request() kernel-doc comment</title>
<updated>2022-04-08T08:13:30+00:00</updated>
<author>
<name>Yang Li</name>
<email>yang.lee@linux.alibaba.com</email>
</author>
<published>2022-03-16T01:03:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d5db91d26af5207b18cf2a80d7a7094bd4f57896'/>
<id>urn:sha1:d5db91d26af5207b18cf2a80d7a7094bd4f57896</id>
<content type='text'>
Add the description of @need_pump in crypto_transfer_request() kernel-doc
comment to remove warning found by running scripts/kernel-doc, which is
caused by using 'make W=1'.

crypto/crypto_engine.c:260: warning: Function parameter or member
'need_pump' not described in 'crypto_transfer_request'

Reported-by: Abaci Robot &lt;abaci@linux.alibaba.com&gt;
Signed-off-by: Yang Li &lt;yang.lee@linux.alibaba.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
</feed>
