Linux Power Management development
 help / color / mirror / Atom feed
* [PATCH v2] PM: dpm_show_time changes to suspend/resume dmesg prints
@ 2026-08-31 22:29 Todd Brandt
  2026-09-03  4:15 ` kernel test robot
  2026-09-04 13:18 ` Rafael J. Wysocki (Intel)
  0 siblings, 2 replies; 3+ messages in thread
From: Todd Brandt @ 2026-08-31 22:29 UTC (permalink / raw)
  To: linux-pm, rafael.j.wysocki, rjw; +Cc: todd.e.brandt, todd.e.brandt

Organize the optional dpm_show_time prints to focus on the 8 possible
suspend/resume callbacks devices can use and their associated phases
when they're called in suspend:

Remove "start suspend" as it is currently a combination of "suspend" and
"suspend prepare". Replace it with "prepare suspend" as a separate print.
Add "complete resume" over the dpm_complete call. For example:

[   66.680479] PM: suspend entry (s2idle)
[   66.826646] PM: prepare suspend of devices complete after 114.081 msecs
[   67.119306] PM: suspend of devices complete after 292.639 msecs
[   67.121309] PM: late suspend of devices complete after 1.983 msecs
[   67.190184] PM: noirq suspend of devices complete after 68.309 msecs
[   81.227706] PM: noirq resume of devices complete after 49.196 msecs
[   81.230847] PM: early resume of devices complete after 2.922 msecs
[   82.444735] PM: resume of devices complete after 1213.869 msecs
[   82.447943] PM: complete resume of devices complete after 2.850 msecs
[   82.457131] PM: suspend exit

v2 change: replace error variable with NULL in dpm_complete

Signed-off-by: Todd Brandt <todd.e.brandt@linux.intel.com>
---
 drivers/base/power/main.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c
index e130da428141..7496f76bf9f8 100644
--- a/drivers/base/power/main.c
+++ b/drivers/base/power/main.c
@@ -1329,6 +1329,7 @@ static void device_complete(struct device *dev, pm_message_t state)
 void dpm_complete(pm_message_t state)
 {
 	struct list_head list;
+	ktime_t starttime = ktime_get();
 
 	trace_suspend_resume(TPS("dpm_complete"), state.event, true);
 
@@ -1358,6 +1359,7 @@ void dpm_complete(pm_message_t state)
 	thermal_pm_complete();
 	/* Allow device probing and trigger re-probing of deferred devices */
 	device_unblock_probing();
+	dpm_show_time(starttime, state, NULL, "complete");
 	trace_suspend_resume(TPS("dpm_complete"), state.event, false);
 }
 
@@ -2352,6 +2354,7 @@ int dpm_suspend_start(pm_message_t state)
 	int error;
 
 	error = dpm_prepare(state);
+	dpm_show_time(starttime, state, error, "prepare");
 	if (error)
 		dpm_save_failed_step(SUSPEND_PREPARE);
 	else {
@@ -2359,7 +2362,6 @@ int dpm_suspend_start(pm_message_t state)
 		error = dpm_suspend(state);
 	}
 
-	dpm_show_time(starttime, state, error, "start");
 	return error;
 }
 EXPORT_SYMBOL_GPL(dpm_suspend_start);
-- 
2.34.1


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

* Re: [PATCH v2] PM: dpm_show_time changes to suspend/resume dmesg prints
  2026-08-31 22:29 [PATCH v2] PM: dpm_show_time changes to suspend/resume dmesg prints Todd Brandt
@ 2026-09-03  4:15 ` kernel test robot
  2026-09-04 13:18 ` Rafael J. Wysocki (Intel)
  1 sibling, 0 replies; 3+ messages in thread
From: kernel test robot @ 2026-09-03  4:15 UTC (permalink / raw)
  To: Todd Brandt, linux-pm, rafael.j.wysocki, rjw
  Cc: oe-kbuild-all, todd.e.brandt, todd.e.brandt

Hi Todd,

kernel test robot noticed the following build errors:

[auto build test ERROR on rafael-pm/linux-next]
[also build test ERROR on rafael-pm/bleeding-edge amd-pstate/linux-next amd-pstate/bleeding-edge linus/master v7.3-rc1 next-20260902]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Todd-Brandt/PM-dpm_show_time-changes-to-suspend-resume-dmesg-prints/20260831-152926
base:   https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git linux-next
patch link:    https://lore.kernel.org/r/20260831222926.34698-1-todd.e.brandt%40linux.intel.com
patch subject: [PATCH v2] PM: dpm_show_time changes to suspend/resume dmesg prints
config: mips-allyesconfig (https://download.01.org/0day-ci/archive/20260903/202609031247.SRpWbgoA-lkp@intel.com/config)
compiler: mips-linux-gcc (GCC) 16.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260903/202609031247.SRpWbgoA-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202609031247.SRpWbgoA-lkp@intel.com/

All errors (new ones prefixed by >>):

   In file included from include/uapi/linux/posix_types.h:5,
                    from include/uapi/linux/types.h:14,
                    from include/linux/types.h:5,
                    from include/linux/kasan-checks.h:5,
                    from include/asm-generic/rwonce.h:26,
                    from ./arch/mips/include/generated/asm/rwonce.h:1,
                    from include/linux/compiler.h:369,
                    from include/linux/dev_printk.h:14,
                    from include/linux/device.h:15,
                    from drivers/base/power/main.c:21:
   drivers/base/power/main.c: In function 'dpm_complete':
>> include/linux/stddef.h:8:14: error: passing argument 3 of 'dpm_show_time' makes integer from pointer without a cast [-Wint-conversion]
       8 | #define NULL ((void *)0)
         |              ^~~~~~~~~~~
         |              |
         |              void *
   drivers/base/power/main.c:1362:41: note: in expansion of macro 'NULL'
    1362 |         dpm_show_time(starttime, state, NULL, "complete");
         |                                         ^~~~
   drivers/base/power/main.c:480:70: note: expected 'int' but argument is of type 'void *'
     480 | static void dpm_show_time(ktime_t starttime, pm_message_t state, int error,
         |                                                                  ~~~~^~~~~


vim +/dpm_show_time +8 include/linux/stddef.h

^1da177e4c3f415 Linus Torvalds   2005-04-16  6  
^1da177e4c3f415 Linus Torvalds   2005-04-16  7  #undef NULL
^1da177e4c3f415 Linus Torvalds   2005-04-16 @8  #define NULL ((void *)0)
6e2182874324727 Richard Knutsson 2006-09-30  9  

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

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

* Re: [PATCH v2] PM: dpm_show_time changes to suspend/resume dmesg prints
  2026-08-31 22:29 [PATCH v2] PM: dpm_show_time changes to suspend/resume dmesg prints Todd Brandt
  2026-09-03  4:15 ` kernel test robot
@ 2026-09-04 13:18 ` Rafael J. Wysocki (Intel)
  1 sibling, 0 replies; 3+ messages in thread
From: Rafael J. Wysocki (Intel) @ 2026-09-04 13:18 UTC (permalink / raw)
  To: Todd Brandt; +Cc: linux-pm, rafael.j.wysocki, rjw, todd.e.brandt

On Tue, Sep 1, 2026 at 12:29 AM Todd Brandt
<todd.e.brandt@linux.intel.com> wrote:
>
> Organize the optional dpm_show_time prints to focus on the 8 possible
> suspend/resume callbacks devices can use and their associated phases
> when they're called in suspend:
>
> Remove "start suspend" as it is currently a combination of "suspend" and
> "suspend prepare". Replace it with "prepare suspend" as a separate print.
> Add "complete resume" over the dpm_complete call. For example:
>
> [   66.680479] PM: suspend entry (s2idle)
> [   66.826646] PM: prepare suspend of devices complete after 114.081 msecs
> [   67.119306] PM: suspend of devices complete after 292.639 msecs
> [   67.121309] PM: late suspend of devices complete after 1.983 msecs
> [   67.190184] PM: noirq suspend of devices complete after 68.309 msecs
> [   81.227706] PM: noirq resume of devices complete after 49.196 msecs
> [   81.230847] PM: early resume of devices complete after 2.922 msecs
> [   82.444735] PM: resume of devices complete after 1213.869 msecs
> [   82.447943] PM: complete resume of devices complete after 2.850 msecs
> [   82.457131] PM: suspend exit
>
> v2 change: replace error variable with NULL in dpm_complete
>
> Signed-off-by: Todd Brandt <todd.e.brandt@linux.intel.com>
> ---
>  drivers/base/power/main.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c
> index e130da428141..7496f76bf9f8 100644
> --- a/drivers/base/power/main.c
> +++ b/drivers/base/power/main.c
> @@ -1329,6 +1329,7 @@ static void device_complete(struct device *dev, pm_message_t state)
>  void dpm_complete(pm_message_t state)
>  {
>         struct list_head list;
> +       ktime_t starttime = ktime_get();
>
>         trace_suspend_resume(TPS("dpm_complete"), state.event, true);
>
> @@ -1358,6 +1359,7 @@ void dpm_complete(pm_message_t state)
>         thermal_pm_complete();
>         /* Allow device probing and trigger re-probing of deferred devices */
>         device_unblock_probing();
> +       dpm_show_time(starttime, state, NULL, "complete");

Integer 0 should be passed to the above, not NULL.

>         trace_suspend_resume(TPS("dpm_complete"), state.event, false);
>  }
>
> @@ -2352,6 +2354,7 @@ int dpm_suspend_start(pm_message_t state)
>         int error;
>
>         error = dpm_prepare(state);
> +       dpm_show_time(starttime, state, error, "prepare");
>         if (error)
>                 dpm_save_failed_step(SUSPEND_PREPARE);
>         else {
> @@ -2359,7 +2362,6 @@ int dpm_suspend_start(pm_message_t state)
>                 error = dpm_suspend(state);
>         }
>
> -       dpm_show_time(starttime, state, error, "start");
>         return error;
>  }
>  EXPORT_SYMBOL_GPL(dpm_suspend_start);
> --
> 2.34.1
>
>

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

end of thread, other threads:[~2026-09-04 13:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-31 22:29 [PATCH v2] PM: dpm_show_time changes to suspend/resume dmesg prints Todd Brandt
2026-09-03  4:15 ` kernel test robot
2026-09-04 13:18 ` Rafael J. Wysocki (Intel)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox