Skip to content

Commit 11611d2

Browse files
haokexinmpe
authored andcommitted
powerpc/mpc83xx: Use wait_event_freezable() for freezable kthread
A freezable kernel thread can enter frozen state during freezing by either calling try_to_freeze() or using wait_event_freezable() and its variants. So for the following snippet of code in a kernel thread loop: wait_event_interruptible(); try_to_freeze(); We can change it to a simple wait_event_freezable() and then eliminate a function call. Signed-off-by: Kevin Hao <haokexin@gmail.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://msgid.link/20231221044510.1802429-3-haokexin@gmail.com
1 parent 6addc56 commit 11611d2

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

arch/powerpc/platforms/83xx/suspend.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,8 +264,7 @@ static int agent_thread_fn(void *data)
264264
set_freezable();
265265

266266
while (1) {
267-
wait_event_interruptible(agent_wq, pci_pm_state >= 2);
268-
try_to_freeze();
267+
wait_event_freezable(agent_wq, pci_pm_state >= 2);
269268

270269
if (signal_pending(current) || pci_pm_state < 2)
271270
continue;

0 commit comments

Comments
 (0)