Patch "hwrng: omap - Fix assumption that runtime_get_sync will always succeed" has been added to the 4.7-stable tree
Subsystems (3)
This is a note to let you know that I've just added the patch titled
hwrng: omap - Fix assumption that runtime_get_sync will always succeed
to the 4.7-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
hwrng-omap-fix-assumption-that-runtime_get_sync-will-always-succeed.patch
and it can be found in the queue-4.7 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From
61dc0a446e5d08f2de8a24b45f69a1e302bb1b1bMon Sep 17 00:00:00 2001
From: Nishanth Menon <[email protected]>
Date: Fri, 24 Jun 2016 11:50:39 -0500
Subject: hwrng: omap - Fix assumption that runtime_get_sync will always succeed
From: Nishanth Menon <[email protected]>
commit 61dc0a446e5d08f2de8a24b45f69a1e302bb1b1b upstream.
pm_runtime_get_sync does return a error value that must be checked for error conditions, else, due to various reasons, the device maynot be enabled and the system will crash due to lack of clock to the hardware module.
Before:
12.562784] [00000000] *pgd=fe193835
12.562792] Internal error: : 1406 [#1] SMP ARM
[...]
12.562864] CPU: 1 PID: 241 Comm: modprobe Not tainted 4.7.0-rc4-next-20160624 #2 12.562867] Hardware name: Generic DRA74X (Flattened Device Tree) 12.562872] task: ed51f140 ti: ed44c000 task.ti: ed44c000
12.562886] PC is at omap4_rng_init+0x20/0x84 [omap_rng]
12.562899] LR is at set_current_rng+0xc0/0x154 [rng_core]
[...]
After the proper checks:
[ 94.366705] omap_rng 48090000.rng: _od_fail_runtime_resume: FIXME: missing hwmod/omap_dev info [ 94.375767] omap_rng 48090000.rng: Failed to runtime_get device -19 [ 94.382351] omap_rng 48090000.rng: initialization failed.
--- drivers/char/hw_random/omap-rng.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-)
drivers/char/hw_random/omap-rng.c +14 -2
@@ -384,7 +384,12 @@ static int omap_rng_probe(struct platfor }pm_runtime_enable (&pdev->dev); -pm_runtime_get_sync (&pdev->dev); + ret =pm_runtime_get_sync (&pdev->dev); +if (ret) { +dev_err (&pdev->dev,"Failed to runtime_get device: %d\n" , ret); +pm_runtime_put_noidle (&pdev->dev); + goto err_ioremap; + } ret = (dev->of_node) ?of_get_omap_rng_device_details (priv, pdev) :get_omap_rng_device_details (priv);
@@ -435,8 +440,15 @@ static int __maybe_unused omap_rng_suspestatic int __maybe_unused omap_rng_resume (struct device *dev) {struct omap_rng_dev *priv =dev_get_drvdata (dev); +int ret; + + ret =pm_runtime_get_sync (dev); +if (ret) { +dev_err (dev,"Failed to runtime_get device: %d\n" , ret); +pm_runtime_put_noidle (dev); +return ret; + } -pm_runtime_get_sync (dev); priv->pdata->init (priv);return 0 ;
Patches currently in stable-queue which might be from [email protected] are
queue-4.7/hwrng-omap-fix-assumption-that-runtime_get_sync-will-always-succeed.patch