lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1463162628-16976-1-git-send-email-grygorii.strashko@ti.com>
Date:	Fri, 13 May 2016 21:03:48 +0300
From:	Grygorii Strashko <grygorii.strashko@...com>
To:	"Rafael J. Wysocki" <rjw@...ysocki.net>,
	<linux-pm@...r.kernel.org>, Len Brown <len.brown@...el.com>,
	Pavel Machek <pavel@....cz>
CC:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Kevin Hilman <khilman@...nel.org>,
	Ulf Hansson <ulf.hansson@...aro.org>,
	<linux-kernel@...r.kernel.org>,
	Grygorii Strashko <grygorii.strashko@...com>
Subject: [PATCH] PM / sleep: fix unbalanced pm runtime disable in __device_suspend_late()

The PM runtime will be left disabled for the device if its .suspend_late()
callback fails and async suspend is not allowed for this device. In
this case device will not be added in dpm_late_early_list and
dpm_resume_early() will ignore this device, as result PM runtime will
be disabled for it forever (side effect: after 8 subsequent failures
for the same device the PM runtime will be reenabled due to
disable_depth overflow).

Hence, re-enable PM runtime in __device_suspend_late() if
.suspend_late() callback fails and async suspend is not allowed for
this device.

Signed-off-by: Grygorii Strashko <grygorii.strashko@...com>
---
 drivers/base/power/main.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c
index 6e7c3cc..9b266e5 100644
--- a/drivers/base/power/main.c
+++ b/drivers/base/power/main.c
@@ -1207,10 +1207,13 @@ static int __device_suspend_late(struct device *dev, pm_message_t state, bool as
 	}
 
 	error = dpm_run_callback(callback, dev, state, info);
-	if (!error)
+	if (!error) {
 		dev->power.is_late_suspended = true;
-	else
+	} else {
 		async_error = error;
+		if (!is_async(dev))
+			pm_runtime_enable(dev);
+	}
 
 Complete:
 	TRACE_SUSPEND(error);
-- 
2.8.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ