linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] crypto: s5p-sss - Fix completing crypto request in IRQ handler
@ 2017-03-05 17:14 Krzysztof Kozlowski
  2017-03-08  8:47 ` Herbert Xu
  0 siblings, 1 reply; 2+ messages in thread
From: Krzysztof Kozlowski @ 2017-03-05 17:14 UTC (permalink / raw)
  To: Herbert Xu, David S . Miller, linux-crypto, linux-kernel
  Cc: Nathan Royce, Krzysztof Kozlowski

In a regular interrupt handler driver was finishing the crypt/decrypt
request by calling complete on crypto request.  This is disallowed since
converting to skcipher in commit b286d8b1a690 ("crypto: skcipher - Add
skcipher walk interface") and causes a warning:
	WARNING: CPU: 0 PID: 0 at crypto/skcipher.c:430 skcipher_walk_first+0x13c/0x14c

The interrupt is marked shared but in fact there are no other users
sharing it.  Thus the simplest solution seems to be to just use a
threaded interrupt handler, after converting it to oneshot.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>

---

Tested on Odroid U3 and XU3.
Not sure which commit introduced it so I am also not sure if this should
be cc-stable.
---
 drivers/crypto/s5p-sss.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/crypto/s5p-sss.c b/drivers/crypto/s5p-sss.c
index dce1af0ce85c..a668286d62cb 100644
--- a/drivers/crypto/s5p-sss.c
+++ b/drivers/crypto/s5p-sss.c
@@ -805,8 +805,9 @@ static int s5p_aes_probe(struct platform_device *pdev)
 		dev_warn(dev, "feed control interrupt is not available.\n");
 		goto err_irq;
 	}
-	err = devm_request_irq(dev, pdata->irq_fc, s5p_aes_interrupt,
-			       IRQF_SHARED, pdev->name, pdev);
+	err = devm_request_threaded_irq(dev, pdata->irq_fc, NULL,
+					s5p_aes_interrupt, IRQF_ONESHOT,
+					pdev->name, pdev);
 	if (err < 0) {
 		dev_warn(dev, "feed control interrupt is not available.\n");
 		goto err_irq;
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] crypto: s5p-sss - Fix completing crypto request in IRQ handler
  2017-03-05 17:14 [PATCH] crypto: s5p-sss - Fix completing crypto request in IRQ handler Krzysztof Kozlowski
@ 2017-03-08  8:47 ` Herbert Xu
  0 siblings, 0 replies; 2+ messages in thread
From: Herbert Xu @ 2017-03-08  8:47 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: David S . Miller, linux-crypto, linux-kernel, Nathan Royce

On Sun, Mar 05, 2017 at 07:14:07PM +0200, Krzysztof Kozlowski wrote:
> In a regular interrupt handler driver was finishing the crypt/decrypt
> request by calling complete on crypto request.  This is disallowed since
> converting to skcipher in commit b286d8b1a690 ("crypto: skcipher - Add
> skcipher walk interface") and causes a warning:
> 	WARNING: CPU: 0 PID: 0 at crypto/skcipher.c:430 skcipher_walk_first+0x13c/0x14c
> 
> The interrupt is marked shared but in fact there are no other users
> sharing it.  Thus the simplest solution seems to be to just use a
> threaded interrupt handler, after converting it to oneshot.
> 
> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>

Patch applied.  Thanks.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-03-08  9:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-05 17:14 [PATCH] crypto: s5p-sss - Fix completing crypto request in IRQ handler Krzysztof Kozlowski
2017-03-08  8:47 ` Herbert Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).