Skip to contentSkip to conversation

omap-sham: Use pm_runtime_put instead of pm_runtime_put_sync in tasklet

PATCH In review [email protected] 3 participants 5 messages Feb 26, 2013 – Mar 10, 2013 Crypto API

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/2 omap-sham: Use pm_runtime_put instead of pm_runtime_put_sync in tasklet

From: Joel A Fernandes <[email protected]>

After DMA is complete, the omap_sham_finish_req function is called as a part of the done_task tasklet. During this its atomic and any calls to pm functions should not assume they wont sleep.

The patch replaces a call to pm_runtime_put_sync (which can sleep) with pm_runtime_put thus fixing a kernel panic observed on AM33xx SoC during SHA operation.

Tested on an AM33xx SoC device (beaglebone board). To reproduce the problem, used the tcrypt kernel module as:
modprobe tcrypt sec=2 mode=403

Cc Herbert Xu <[email protected]>
Cc David S. Miller <[email protected]>
Cc Mark A. Greer <[email protected]>
---
 drivers/crypto/omap-sham.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/crypto/omap-sham.c +1 -1
index edff981..b8bb583 100644
@@ -923,7 +923,7 @@ static void omap_sham_finish_req(struct ahash_request *req, int err)
 	dd->flags &= ~(BIT(FLAGS_BUSY) | BIT(FLAGS_FINAL) | BIT(FLAGS_CPU) |
 			BIT(FLAGS_DMA_READY) | BIT(FLAGS_OUTPUT_READY));
 
-	pm_runtime_put_sync(dd->dev);
+	pm_runtime_put(dd->dev);
 
 	if (req->base.complete)
 		req->base.complete(&req->base, err);
Signature · 1 line
1.7.4.1
#1 lore raw

PATCH v3 2/2 omap-aes: Use pm_runtime_put instead of pm_runtime_put_sync in tasklet

From: Joel A Fernandes <[email protected]>

After DMA is complete, the omap_aes_finish_req function is called as a part of the done_task tasklet. During this its atomic and any calls to pm functions should not assume they wont sleep.

The patch replaces a call to pm_runtime_put_sync (which can sleep) with pm_runtime_put thus fixing a kernel panic observed on AM33xx SoC during AES operation.

Tested on an AM33xx SoC device (beaglebone board). To reproduce the problem, I used the tcrypt kernel module as:
modprobe tcrypt sec=2 mode=500

Cc Herbert Xu <[email protected]>
Cc David S. Miller <[email protected]>
Cc Mark A. Greer <[email protected]>
---
 drivers/crypto/omap-aes.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/crypto/omap-aes.c +1 -1
index cf57866..8450bfd2 100644
@@ -636,7 +636,7 @@ static void omap_aes_finish_req(struct omap_aes_dev *dd, int err)
 
 	pr_debug("err: %d\n", err);
 
-	pm_runtime_put_sync(dd->dev);
+	pm_runtime_put(dd->dev);
 	dd->flags &= ~FLAGS_BUSY;
 
 	req->base.complete(&req->base, err);
Signature · 1 line
1.7.4.1
Acked-by on v3 2/2
#2 lore raw

Re: [PATCH v3 2/2] omap-aes: Use pm_runtime_put instead of pm_runtime_put_sync in tasklet

Quoted 27 lines · On Tue, Feb 26, 2013 at 10:04:32AM -0600, [email protected] wrote:

From: Joel A Fernandes <[email protected]>

After DMA is complete, the omap_aes_finish_req function is called as a part of the done_task tasklet. During this its atomic and any calls to pm functions should not assume they wont sleep.

The patch replaces a call to pm_runtime_put_sync (which can sleep) with pm_runtime_put thus fixing a kernel panic observed on AM33xx SoC during AES operation.

Tested on an AM33xx SoC device (beaglebone board). To reproduce the problem, I used the tcrypt kernel module as:
modprobe tcrypt sec=2 mode=500

Cc Herbert Xu <[email protected]>
Cc David S. Miller <[email protected]>
Cc Mark A. Greer <[email protected]>
---
 drivers/crypto/omap-aes.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/crypto/omap-aes.c +0 -0
index cf57866..8450bfd2 100644

drivers/crypto/omap-aes.c static void omap_aes_finish_req(struct omap_aes_dev *dd, int err) · line 642

Quoted 8 lines
drivers/crypto/omap-aes.c +1 -1
@@ -636,7 +636,7 @@ static void omap_aes_finish_req(struct omap_aes_dev *dd, int err)
 
 	pr_debug("err: %d\n", err);
 
-	pm_runtime_put_sync(dd->dev);
+	pm_runtime_put(dd->dev);
 	dd->flags &= ~FLAGS_BUSY;
 
 	req->base.complete(&req->base, err);
maintainer
#3 lore raw

Re: [PATCH v3 2/2] omap-aes: Use pm_runtime_put instead of pm_runtime_put_sync in tasklet

Quoted 31 lines · Mark A. Greer
Quoted 30 lines · On Tue, Feb 26, 2013 at 10:04:32AM -0600, [email protected] wrote:

From: Joel A Fernandes <[email protected]>

After DMA is complete, the omap_aes_finish_req function is called as a part of the done_task tasklet. During this its atomic and any calls to pm functions should not assume they wont sleep.

The patch replaces a call to pm_runtime_put_sync (which can sleep) with pm_runtime_put thus fixing a kernel panic observed on AM33xx SoC during AES operation.

Tested on an AM33xx SoC device (beaglebone board). To reproduce the problem, I used the tcrypt kernel module as:
modprobe tcrypt sec=2 mode=500

Cc Herbert Xu <[email protected]>
Cc David S. Miller <[email protected]>
Cc Mark A. Greer <[email protected]>
---
 drivers/crypto/omap-aes.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/crypto/omap-aes.c +0 -0
index cf57866..8450bfd2 100644
@@ -636,7 +636,7 @@ static void omap_aes_finish_req(struct omap_aes_dev *dd, int err)
 
 	pr_debug("err: %d\n", err);
 
Quoted 7 lines

drivers/crypto/omap-aes.c static void omap_aes_finish_req(struct omap_aes_dev *dd, int err) · line 642

Quoted 5 lines
drivers/crypto/omap-aes.c +1 -1
-	pm_runtime_put_sync(dd->dev);
+	pm_runtime_put(dd->dev);
 	dd->flags &= ~FLAGS_BUSY;
 
 	req->base.complete(&req->base, err);

Both patches applied. Thanks!

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
Acked-by on v3 1/2
#4 lore raw
In reply to [email protected]
Quoted 27 lines · On Tue, Feb 26, 2013 at 10:04:31AM -0600, [email protected] wrote:

From: Joel A Fernandes <[email protected]>

After DMA is complete, the omap_sham_finish_req function is called as a part of the done_task tasklet. During this its atomic and any calls to pm functions should not assume they wont sleep.

The patch replaces a call to pm_runtime_put_sync (which can sleep) with pm_runtime_put thus fixing a kernel panic observed on AM33xx SoC during SHA operation.

Tested on an AM33xx SoC device (beaglebone board). To reproduce the problem, used the tcrypt kernel module as:
modprobe tcrypt sec=2 mode=403

Cc Herbert Xu <[email protected]>
Cc David S. Miller <[email protected]>
Cc Mark A. Greer <[email protected]>
---
 drivers/crypto/omap-sham.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/crypto/omap-sham.c +0 -0
index edff981..b8bb583 100644

drivers/crypto/omap-sham.c static void omap_sham_finish_req(struct ahash_request *req, int err) · line 929

Quoted 8 lines
drivers/crypto/omap-sham.c +1 -1
@@ -923,7 +923,7 @@ static void omap_sham_finish_req(struct ahash_request *req, int err)
 	dd->flags &= ~(BIT(FLAGS_BUSY) | BIT(FLAGS_FINAL) | BIT(FLAGS_CPU) |
 			BIT(FLAGS_DMA_READY) | BIT(FLAGS_OUTPUT_READY));
 
-	pm_runtime_put_sync(dd->dev);
+	pm_runtime_put(dd->dev);
 
 	if (req->base.complete)
 		req->base.complete(&req->base, err);