[PATCH 1/3] powerpc: mpc83xx: Add the missing set_freezable() for agent_thread_fn()

Kevin Hao haokexin at gmail.com
Thu Dec 21 15:45:08 AEDT 2023


The kernel thread function agent_thread_fn() invokes the try_to_freeze()
in its loop. But all the kernel threads are non-freezable by default.
So if we want to make a kernel thread to be freezable, we have to invoke
set_freezable() explicitly.

Signed-off-by: Kevin Hao <haokexin at gmail.com>
---
 arch/powerpc/platforms/83xx/suspend.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/powerpc/platforms/83xx/suspend.c b/arch/powerpc/platforms/83xx/suspend.c
index 9833c36bda83..eed325ed08cc 100644
--- a/arch/powerpc/platforms/83xx/suspend.c
+++ b/arch/powerpc/platforms/83xx/suspend.c
@@ -261,6 +261,8 @@ static int mpc83xx_suspend_begin(suspend_state_t state)
 
 static int agent_thread_fn(void *data)
 {
+	set_freezable();
+
 	while (1) {
 		wait_event_interruptible(agent_wq, pci_pm_state >= 2);
 		try_to_freeze();
-- 
2.39.2



More information about the Linuxppc-dev mailing list