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]
Date:	Tue, 24 Dec 2013 09:35:51 +0800
From:	shuox.liu@...el.com
To:	linux-kernel@...r.kernel.org
Cc:	rafael.j.wysocki@...el.com, bhelgaas@...gle.com,
	yanmin_zhang@...ux.intel.com, yanmin.zhang@...el.com
Subject: [PATCH] pnp: Bypass the calling to pnp_stop_dev at suspend when there is a protocol suspend

From: Zhang Yanmin <yanmin.zhang@...el.com>

pnp pnp_bus_suspend/_resume have an issue.
pnp_bus_suspend calls pnp_stop_dev to disable the device. With ACPI,
pnp_stop_dev turns off the dev usually. Then,
pnp_bus_suspend=>pnp_dev->protocol->suspend accesses the device and
suspend it again.

pnp_bus_resume has the similar issue.

Another issue is firmware might just provide _DIS, but no_STS method.

The patch fixes it by adding a checking. If there is
pnp_dev->protocol->suspend, pnp_bus_suspend doesn't call pnp_stop_dev.
Do the similar thing for _resume.

Signed-off-by: Zhang Yanmin <yanmin.zhang@...el.com>
Signed-off-by: Liu ShuoX <shuox.liu@...el.com>
---
 drivers/pnp/driver.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/pnp/driver.c b/drivers/pnp/driver.c
index f748cc8..2512e47 100644
--- a/drivers/pnp/driver.c
+++ b/drivers/pnp/driver.c
@@ -176,7 +176,7 @@ static int __pnp_bus_suspend(struct device *dev, pm_message_t state)
 			return error;
 	}
 
-	if (pnp_can_disable(pnp_dev)) {
+	if (pnp_can_disable(pnp_dev) && !pnp_dev->protocol->suspend) {
 		error = pnp_stop_dev(pnp_dev);
 		if (error)
 			return error;
@@ -215,9 +215,7 @@ static int pnp_bus_resume(struct device *dev)
 		error = pnp_dev->protocol->resume(pnp_dev);
 		if (error)
 			return error;
-	}
-
-	if (pnp_can_write(pnp_dev)) {
+	} else if (pnp_can_write(pnp_dev)) {
 		error = pnp_start_dev(pnp_dev);
 		if (error)
 			return error;
-- 
1.8.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists