On Tue, Jun 3, 2025 at 1:37 PM Rafael J. Wysocki <raf...@kernel.org> wrote:
>
> On Tue, Jun 3, 2025 at 12:30 PM Rafael J. Wysocki <raf...@kernel.org> wrote:
> >
> > On Tue, Jun 3, 2025 at 12:29 PM Rafael J. Wysocki <raf...@kernel.org> wrote:
> > >
> > > On Tue, Jun 3, 2025 at 12:17 PM Chris Bainbridge
> > > <chris.bainbri...@gmail.com> wrote:
> > > >
> > > > On Tue, Jun 03, 2025 at 11:38:37AM +0200, Rafael J. Wysocki wrote:
> > > > >
> > > > > Chris, please check if the attached patch helps.  I'm going to post it
> > > > > as a fix anyway later today, but it would be good to verify that it is
> > > > > sufficient.
> > > >
> > > > This did not fix my test case, pstore crash log was:
> > >
> > > OK, so can you please enable PM debug messages:
> > >
> > > # echo 1 > /sys/power/pm_debug/messages
> >
> > This should be
> >
> > # echo 1 > /sys/power/pm_debug_messages
> >
> > sorry.
> >
> > > and enabled dynamic debug in drivers/base/power/main.c:
> > >
> > > # echo "file drivers/base/power/main.c +p" > /proc/dynamic_debug/control
> > >
> > > repeat the test and capture the log?
>
> Actually, no need to do this, there is an obvious bug:
> list_splice_init() should be used instead of list_splice() when the
> emptied list is going to be used again.  Ugh.
>
> Please check if the attached patch along with the previous one makes
> the issue go away entirely.

Really attached this time, sorry.
---
 drivers/base/power/main.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- a/drivers/base/power/main.c
+++ b/drivers/base/power/main.c
@@ -1458,7 +1458,7 @@
 			 * Move all devices to the target list to resume them
 			 * properly.
 			 */
-			list_splice(&dpm_late_early_list, &dpm_noirq_list);
+			list_splice_init(&dpm_late_early_list, &dpm_noirq_list);
 			break;
 		}
 	}
@@ -1660,7 +1660,7 @@
 			 * Move all devices to the target list to resume them
 			 * properly.
 			 */
-			list_splice(&dpm_suspended_list, &dpm_late_early_list);
+			list_splice_init(&dpm_suspended_list, &dpm_late_early_list);
 			break;
 		}
 	}
@@ -1953,7 +1953,7 @@
 			 * Move all devices to the target list to resume them
 			 * properly.
 			 */
-			list_splice(&dpm_prepared_list, &dpm_suspended_list);
+			list_splice_init(&dpm_prepared_list, &dpm_suspended_list);
 			break;
 		}
 	}

Reply via email to