lkml.org 
[lkml]   [2020]   [Dec]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH 4.19 154/346] crypto: omap-aes - Fix PM disable depth imbalance in omap_aes_probe
Hi!

> From: Zhang Qilong <zhangqilong3@huawei.com>
>
> [ Upstream commit ff8107200367f4abe0e5bce66a245e8d0f2d229e ]
>
> The pm_runtime_enable will increase power disable depth.
> Thus a pairing decrement is needed on the error handling
> path to keep it balanced according to context.

Oops, this is complex.

First, same bug exist in 4.4, but is not fixed there, and there is
missing pm_runtime_put() there and elsewhere.

4.4 needs these two fixes + backport of ff81072003.

4.19 needs fixes similar to these, at three places.

mainline is okay, afaict.

Best regards,
Pavel

diff --git a/drivers/crypto/omap-aes.c b/drivers/crypto/omap-aes.c
index eba23147c0ee..48370711c794 100644
--- a/drivers/crypto/omap-aes.c
+++ b/drivers/crypto/omap-aes.c
@@ -801,6 +801,7 @@ static int omap_aes_cra_init(struct crypto_tfm *tfm)

err = pm_runtime_get_sync(dd->dev);
if (err < 0) {
+ pm_runtime_put_sync(dd->dev);
dev_err(dd->dev, "%s: failed to get_sync(%d)\n",
__func__, err);
return err;
@@ -1195,6 +1196,7 @@ static int omap_aes_probe(struct platform_device *pdev)
pm_runtime_enable(dev);
err = pm_runtime_get_sync(dev);
if (err < 0) {
+ pm_runtime_put_sync(dev);
dev_err(dev, "%s: failed to get_sync(%d)\n",
__func__, err);
goto err_res;

--
http://www.livejournal.com/~pavelmachek
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2020-12-30 14:18    [W:1.383 / U:0.180 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site