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: <1360041183.15311.2.camel@fli24-HP-Compaq-8100-Elite-CMT-PC>
Date:	Tue, 05 Feb 2013 13:13:03 +0800
From:	fli24 <fei.li@...el.com>
To:	gregkh@...uxfoundation.org, rjw@...k.pl, akpm@...ux-foundation.org
Cc:	linux-kernel@...r.kernel.org, chuansheng.liu@...el.com,
	fei.li@...el.com
Subject: [PATCH] pm: print the name of failed suspend function for platform
 device


Print more info when platform device suspend function failed.
Without this patch, we can not get the real platform device suspend
API info.

Example without this patch:
pm_op(): platform_pm_suspend+0x0/0x50 returns -11
PM: Device power.0 failed to suspend: error -11

And with this patch:
platform_pm_suspend(): power_suspend+0x0/0x30 returns -11
pm_op(): platform_pm_suspend+0x0/0x80 returns -11
PM: Device power.0 failed to suspend: error -11

Signed-off-by: liu chuansheng <chuansheng.liu@...el.com>
Signed-off-by: Li Fei <fei.li@...el.com>
---
 drivers/base/platform.c |   19 +++++++++++++++----
 1 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/drivers/base/platform.c b/drivers/base/platform.c
index c0b8df3..96a452a 100644
--- a/drivers/base/platform.c
+++ b/drivers/base/platform.c
@@ -747,8 +747,10 @@ static int platform_legacy_suspend(struct device *dev, pm_message_t mesg)
 	struct platform_device *pdev = to_platform_device(dev);
 	int ret = 0;
 
-	if (dev->driver && pdrv->suspend)
+	if (dev->driver && pdrv->suspend) {
 		ret = pdrv->suspend(pdev, mesg);
+		suspend_report_result(pdrv->suspend, ret);
+	}
 
 	return ret;
 }
@@ -778,10 +780,13 @@ int platform_pm_suspend(struct device *dev)
 		return 0;
 
 	if (drv->pm) {
-		if (drv->pm->suspend)
+		if (drv->pm->suspend) {
 			ret = drv->pm->suspend(dev);
+			suspend_report_result(drv->pm->suspend, ret);
+		}
 	} else {
 		ret = platform_legacy_suspend(dev, PMSG_SUSPEND);
+		suspend_report_result(platform_legacy_suspend, ret);
 	}
 
 	return ret;
@@ -818,10 +823,13 @@ int platform_pm_freeze(struct device *dev)
 		return 0;
 
 	if (drv->pm) {
-		if (drv->pm->freeze)
+		if (drv->pm->freeze) {
 			ret = drv->pm->freeze(dev);
+			suspend_report_result(drv->pm->freeze, ret);
+		}
 	} else {
 		ret = platform_legacy_suspend(dev, PMSG_FREEZE);
+		suspend_report_result(platform_legacy_suspend, ret);
 	}
 
 	return ret;
@@ -854,10 +862,13 @@ int platform_pm_poweroff(struct device *dev)
 		return 0;
 
 	if (drv->pm) {
-		if (drv->pm->poweroff)
+		if (drv->pm->poweroff) {
 			ret = drv->pm->poweroff(dev);
+			suspend_report_result(drv->pm->poweroff, ret);
+		}
 	} else {
 		ret = platform_legacy_suspend(dev, PMSG_HIBERNATE);
+		suspend_report_result(platform_legacy_suspend, ret);
 	}
 
 	return ret;
-- 
1.7.4.1





--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ