All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] pm: print the name of failed suspend function for platform device
@ 2013-02-05  5:13 fli24
  2013-03-11  1:41 ` Liu, Chuansheng
  0 siblings, 1 reply; 9+ messages in thread
From: fli24 @ 2013-02-05  5:13 UTC (permalink / raw)
  To: gregkh, rjw, akpm; +Cc: linux-kernel, chuansheng.liu, fei.li


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@intel.com>
Signed-off-by: Li Fei <fei.li@intel.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






^ permalink raw reply related	[flat|nested] 9+ messages in thread

* RE: [PATCH] pm: print the name of failed suspend function for platform device
  2013-02-05  5:13 [PATCH] pm: print the name of failed suspend function for platform device fli24
@ 2013-03-11  1:41 ` Liu, Chuansheng
  2013-03-15 19:20   ` gregkh
  0 siblings, 1 reply; 9+ messages in thread
From: Liu, Chuansheng @ 2013-03-11  1:41 UTC (permalink / raw)
  To: Li, Fei, gregkh, rjw, akpm; +Cc: linux-kernel, ldewangan

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 3121 bytes --]

Hi Greg,

I just noticed some other cases need the more log also.
https://lkml.org/lkml/2013/3/8/71

Could you consider the below patch, thanks?

Best Regards
Liu chuansheng

> -----Original Message-----
> From: Li, Fei
> Sent: Tuesday, February 05, 2013 1:13 PM
> To: gregkh@linuxfoundation.org; rjw@sisk.pl; akpm@linux-foundation.org
> Cc: linux-kernel@vger.kernel.org; Liu, Chuansheng; Li, Fei
> 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@intel.com>
> Signed-off-by: Li Fei <fei.li@intel.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
> 
> 
> 
> 

ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] pm: print the name of failed suspend function for platform device
  2013-03-11  1:41 ` Liu, Chuansheng
@ 2013-03-15 19:20   ` gregkh
  2013-03-16  1:22     ` Liu, Chuansheng
  0 siblings, 1 reply; 9+ messages in thread
From: gregkh @ 2013-03-15 19:20 UTC (permalink / raw)
  To: Liu, Chuansheng; +Cc: Li, Fei, rjw, akpm, linux-kernel, ldewangan

On Mon, Mar 11, 2013 at 01:41:28AM +0000, Liu, Chuansheng wrote:
> Hi Greg,
> 
> I just noticed some other cases need the more log also.
> https://lkml.org/lkml/2013/3/8/71
> 
> Could you consider the below patch, thanks?

Didn't I already consider it and respond?


^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: [PATCH] pm: print the name of failed suspend function for platform device
  2013-03-15 19:20   ` gregkh
@ 2013-03-16  1:22     ` Liu, Chuansheng
  2013-03-16  3:54       ` gregkh
  0 siblings, 1 reply; 9+ messages in thread
From: Liu, Chuansheng @ 2013-03-16  1:22 UTC (permalink / raw)
  To: gregkh; +Cc: Li, Fei, rjw, akpm, linux-kernel, ldewangan

Hello Greg,

Double checked, there is no your response before.
Can you consider it again? Thanks.

Since we have printed the failure info, why not enhance it a bit:)

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


> -----Original Message-----
> From: gregkh@linuxfoundation.org [mailto:gregkh@linuxfoundation.org]
> Sent: Saturday, March 16, 2013 3:20 AM
> To: Liu, Chuansheng
> Cc: Li, Fei; rjw@sisk.pl; akpm@linux-foundation.org;
> linux-kernel@vger.kernel.org; ldewangan@nvidia.com
> Subject: Re: [PATCH] pm: print the name of failed suspend function for platform
> device
> 
> On Mon, Mar 11, 2013 at 01:41:28AM +0000, Liu, Chuansheng wrote:
> > Hi Greg,
> >
> > I just noticed some other cases need the more log also.
> > https://lkml.org/lkml/2013/3/8/71
> >
> > Could you consider the below patch, thanks?
> 
> Didn't I already consider it and respond?


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] pm: print the name of failed suspend function for platform device
  2013-03-16  1:22     ` Liu, Chuansheng
@ 2013-03-16  3:54       ` gregkh
  0 siblings, 0 replies; 9+ messages in thread
From: gregkh @ 2013-03-16  3:54 UTC (permalink / raw)
  To: Liu, Chuansheng; +Cc: Li, Fei, rjw, akpm, linux-kernel, ldewangan


A: No.
Q: Should I include quotations after my reply?

http://daringfireball.net/2007/07/on_top

On Sat, Mar 16, 2013 at 01:22:31AM +0000, Liu, Chuansheng wrote:
> Hello Greg,
> 
> Double checked, there is no your response before.
> Can you consider it again? Thanks.

Consider what?  I get about 250 patches a _week_, I honestly do not
remember your specific patch, nor do I have it anywhere in front of me.

> Since we have printed the failure info, why not enhance it a bit:)
> 
> 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

Ok, fine, get the PM maintainer to accept the patch then, resend it, cc:
the proper people and it will be considered.  If I hate it, I'll tell
you.

greg k-h

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] pm: print the name of failed suspend function for platform device
  2013-03-19  2:05   ` Li, Fei
@ 2013-03-19  2:37     ` Greg KH
  0 siblings, 0 replies; 9+ messages in thread
From: Greg KH @ 2013-03-19  2:37 UTC (permalink / raw)
  To: Li, Fei; +Cc: rjw, akpm, ldewangan, linux-kernel, Liu, Chuansheng

On Tue, Mar 19, 2013 at 02:05:02AM +0000, Li, Fei wrote:
> > > 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
> > 
> > How does that help someone out?  One extra line?  What is that going to
> > allow a user to now do?
> >
> Thanks for your comments.
> 
> The intention is to print relatively complete call path for convenience of
> debugging in case of error. With this, we can know the exact name of
> the concrete failed function.

And what was the failed function here, and what would that enable you to
do?

> Besides, currently such information is printed with level KERN_ERR,
> and can be tuned through console_loglevel to avoid the possible impact
> to end user.

Huh?  End users see KERN_ERR.

> Do you think it make sense?

no.  But this is Rafael's file, so I'll defer to him.

greg k-h


^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: [PATCH] pm: print the name of failed suspend function for platform device
  2013-03-18 16:05 ` Greg KH
@ 2013-03-19  2:05   ` Li, Fei
  2013-03-19  2:37     ` Greg KH
  0 siblings, 1 reply; 9+ messages in thread
From: Li, Fei @ 2013-03-19  2:05 UTC (permalink / raw)
  To: Greg KH; +Cc: rjw, akpm, ldewangan, linux-kernel, Liu, Chuansheng

> > 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
> 
> How does that help someone out?  One extra line?  What is that going to
> allow a user to now do?
>
Thanks for your comments.

The intention is to print relatively complete call path for convenience of
debugging in case of error. With this, we can know the exact name of
the concrete failed function.
Besides, currently such information is printed with level KERN_ERR,
and can be tuned through console_loglevel to avoid the possible impact
to end user.

Do you think it make sense?

Thanks and Regards,
Li Fei

> greg k-h

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] pm: print the name of failed suspend function for platform device
  2013-03-18  5:58 Li Fei
@ 2013-03-18 16:05 ` Greg KH
  2013-03-19  2:05   ` Li, Fei
  0 siblings, 1 reply; 9+ messages in thread
From: Greg KH @ 2013-03-18 16:05 UTC (permalink / raw)
  To: Li Fei; +Cc: rjw, akpm, ldewangan, linux-kernel, chuansheng.liu

On Mon, Mar 18, 2013 at 01:58:23PM +0800, Li Fei wrote:
> 
> 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

How does that help someone out?  One extra line?  What is that going to
allow a user to now do?

greg k-h

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH] pm: print the name of failed suspend function for platform device
@ 2013-03-18  5:58 Li Fei
  2013-03-18 16:05 ` Greg KH
  0 siblings, 1 reply; 9+ messages in thread
From: Li Fei @ 2013-03-18  5:58 UTC (permalink / raw)
  To: gregkh, rjw, akpm, ldewangan; +Cc: linux-kernel, chuansheng.liu, fei.li


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@intel.com>
Signed-off-by: Li Fei <fei.li@intel.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





^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2013-03-19  2:36 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-05  5:13 [PATCH] pm: print the name of failed suspend function for platform device fli24
2013-03-11  1:41 ` Liu, Chuansheng
2013-03-15 19:20   ` gregkh
2013-03-16  1:22     ` Liu, Chuansheng
2013-03-16  3:54       ` gregkh
2013-03-18  5:58 Li Fei
2013-03-18 16:05 ` Greg KH
2013-03-19  2:05   ` Li, Fei
2013-03-19  2:37     ` Greg KH

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.