From patchwork Thu Dec 21 04:45:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Hao X-Patchwork-Id: 1878876 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=chqOL0hp; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org (client-ip=2404:9400:2:0:216:3eff:fee1:b9f1; helo=lists.ozlabs.org; envelope-from=linuxppc-dev-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org; receiver=patchwork.ozlabs.org) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2404:9400:2:0:216:3eff:fee1:b9f1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4SwdDq3Mn9z1yr5 for ; Thu, 21 Dec 2023 15:46:35 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=chqOL0hp; dkim-atps=neutral Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4SwdDq1shgz3cZx for ; Thu, 21 Dec 2023 15:46:35 +1100 (AEDT) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=chqOL0hp; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:4864:20::f29; helo=mail-qv1-xf29.google.com; envelope-from=haokexin@gmail.com; receiver=lists.ozlabs.org) Received: from mail-qv1-xf29.google.com (mail-qv1-xf29.google.com [IPv6:2607:f8b0:4864:20::f29]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4SwdCf1DB8z2ytm for ; Thu, 21 Dec 2023 15:45:33 +1100 (AEDT) Received: by mail-qv1-xf29.google.com with SMTP id 6a1803df08f44-67aa9a99915so2632786d6.3 for ; Wed, 20 Dec 2023 20:45:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703133931; x=1703738731; darn=lists.ozlabs.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=vfbvY8xgC0H67/Jam3SB2bIz3SE7rqOaVsdN0L229MM=; b=chqOL0hpzCGzVvxAo/b0gjWFVCMRD6h6tlMbS7IBVnZHP4IaFcn2qeD4q3bS8vsxpS cnIs7QiL/6334CYrqY5MLp1jIqszBLvJSzxM3CtyyH/nzwGWEhB3HZbnCAqZASBSRGjj UkS4sxMFmwxDXhTE5M6Sv/TIzkLd1vnMpUhf40jIrjnOtIruCgYf1lL4bvIR2DYv85Y6 fZtnCcaLxknceYb1c43DjnWjRpxwSNtW7bClSq58W16u7y+LB+9L91623Z93BMHM0hMx k8XY+b2Z2wsg0AOV13KzDEaiMBUth4FBujRcsA7S5CzTK82o964J7NbSmmjlt0Cr59ZO GCeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703133931; x=1703738731; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vfbvY8xgC0H67/Jam3SB2bIz3SE7rqOaVsdN0L229MM=; b=IuPLbd2hbdVwRRjpykYCzbS2LUiFXhud7hZO50/YEDpogVvlW3OuSypTS9dwwHh9NT DUDKAAk3LEskxmMfQUoVZ+eFFTpco63skY9noCK4fC6xE0lmdQOexfesp+iDhqv5toeM eyMBx/PpfiK2v+EevgyxsBY2q0SOj7yBwm23IlFZyuJ3wHUAVlEgEaZajzgTnRevDFtX kjxqULcgyurJ72yrTEt1OxmbKvo1BS7AprTP2CHomYqZoylMKT2gCo5Co6TlUcL1PAtH obWg9KnUDxZtYmIhDCcwJWH1mMhWgqj1hkChddIbxrIeLS5Mq1ver6SQonrlec/2REor gFkQ== X-Gm-Message-State: AOJu0Yz0C42usP/3MfgLMOiWNlcgfr+/10wKwI4jAYbOf2NXff5aShSI 73zT47qs8eWoGjyK9aBzRgg= X-Google-Smtp-Source: AGHT+IEX4+IglUWk99ezR919ZjGHQwbqRmbNFAB8BywpXrbQUfp1qEOhvmFQvX+2lmz0asGmj1y07Q== X-Received: by 2002:a05:6214:483:b0:67f:5701:c03e with SMTP id pt3-20020a056214048300b0067f5701c03emr7552913qvb.84.1703133930932; Wed, 20 Dec 2023 20:45:30 -0800 (PST) Received: from pek-lpggp6.wrs.com (unknown-105-121.windriver.com. [147.11.105.121]) by smtp.gmail.com with ESMTPSA id ct15-20020a056214178f00b0067f3f3d8e8asm374459qvb.111.2023.12.20.20.45.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 20:45:30 -0800 (PST) From: Kevin Hao To: Michael Ellerman Subject: [PATCH 1/3] powerpc: mpc83xx: Add the missing set_freezable() for agent_thread_fn() Date: Thu, 21 Dec 2023 12:45:08 +0800 Message-Id: <20231221044510.1802429-2-haokexin@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231221044510.1802429-1-haokexin@gmail.com> References: <20231221044510.1802429-1-haokexin@gmail.com> MIME-Version: 1.0 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Rafael J. Wysocki" , Nicholas Piggin , "Aneesh Kumar K.V" , Pavel Machek , "Naveen N. Rao" , linuxppc-dev@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" 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 --- 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(); From patchwork Thu Dec 21 04:45:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Hao X-Patchwork-Id: 1878877 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=S225jgcu; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org (client-ip=2404:9400:2:0:216:3eff:fee1:b9f1; helo=lists.ozlabs.org; envelope-from=linuxppc-dev-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org; receiver=patchwork.ozlabs.org) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2404:9400:2:0:216:3eff:fee1:b9f1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4SwdFj3rPPz1yr5 for ; Thu, 21 Dec 2023 15:47:21 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=S225jgcu; dkim-atps=neutral Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4SwdFh72hWz3dFr for ; Thu, 21 Dec 2023 15:47:20 +1100 (AEDT) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=S225jgcu; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:4864:20::f32; helo=mail-qv1-xf32.google.com; envelope-from=haokexin@gmail.com; receiver=lists.ozlabs.org) Received: from mail-qv1-xf32.google.com (mail-qv1-xf32.google.com [IPv6:2607:f8b0:4864:20::f32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4SwdCm5vtlz3cP3 for ; Thu, 21 Dec 2023 15:45:40 +1100 (AEDT) Received: by mail-qv1-xf32.google.com with SMTP id 6a1803df08f44-67f5132e8fcso2651866d6.2 for ; Wed, 20 Dec 2023 20:45:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703133937; x=1703738737; darn=lists.ozlabs.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=508hzsA1BZw2wQ/qtSJVPGxmi524ZrH5CnpDQLWzUtM=; b=S225jgcucCm0AnGdUsUNN77gD62AQhK7k2fUYe8Ynb8+X7+ns++Ab+WMaR25aXF/sS CLzMeiDT06wlQI5m5kAChLWzeHFBX1mALw90yJrmyPI1xj+z7uIkVizULWDqd9F0nc47 2mXLOmRuDZYIFEFLF2lBgQzF+hvhQdTpMSlpFTrjCgXM7C/g1AwRGlOLnVgrlt/Om3g9 3ChxOKKoeovxZEc7IqR7Hf2Pti6W2d08u1crvoGNeDO+FKaWoagiIgvpHsWSmNzp2Lbh FfOhlIlYk/PKPSStMuARCBafcQMzKWuLHgQIOcwZ9zeQuMyL7RwygZS8eAXzO6zfsoCs eOxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703133937; x=1703738737; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=508hzsA1BZw2wQ/qtSJVPGxmi524ZrH5CnpDQLWzUtM=; b=rCDFJ9I9jd059MUhRCyghUVuKWJuGYhGZNq4m6f090dtPqGAyp3Ume8sjMU1Jk/22m LKGTXXf1OOJH0b5cU+qoK2fpdBONeTRwMODjXprSDadum9ZS5iALBV/cd0C3eQaRRcUe +NFxChQUw0JWEJud+jKRN7CZ5bsfm6aH2zwOwWbqojcnIbaJPHkbNXP0O1howPx4ufdQ 6WzxRrlqsjgUHOAODQEblCq2CSmpF4NdOXxl++o07x9tHdaEiA862F8JbPqOZrKJiLGh MOvwKeAlQUnuh4fJXHO7umMWeAwd+ADed/PQGT6Cw+frvH4yvHSjcbDH2BsVxaK4t/VO oq0w== X-Gm-Message-State: AOJu0Yz07Uz1fmHJv/bwyA8CNRnFNOjgFIg2Bh6tvZCzMgu9r8bE7Bdd ezcwDe0PgH48ytc+gPvdefA= X-Google-Smtp-Source: AGHT+IHynyQm1EkvDOzEXHBgQqb7+M+tw/igfjpw6D5leCrSmS4SxqtZ6h/hnYIuaA/t0ZriLE7jHw== X-Received: by 2002:a05:6214:2603:b0:67f:67e4:f289 with SMTP id gu3-20020a056214260300b0067f67e4f289mr5263444qvb.4.1703133937462; Wed, 20 Dec 2023 20:45:37 -0800 (PST) Received: from pek-lpggp6.wrs.com (unknown-105-121.windriver.com. [147.11.105.121]) by smtp.gmail.com with ESMTPSA id ct15-20020a056214178f00b0067f3f3d8e8asm374459qvb.111.2023.12.20.20.45.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 20:45:36 -0800 (PST) From: Kevin Hao To: Michael Ellerman Subject: [PATCH 2/3] powerpc: mpc83xx: Use wait_event_freezable() for freezable kthread Date: Thu, 21 Dec 2023 12:45:09 +0800 Message-Id: <20231221044510.1802429-3-haokexin@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231221044510.1802429-1-haokexin@gmail.com> References: <20231221044510.1802429-1-haokexin@gmail.com> MIME-Version: 1.0 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Rafael J. Wysocki" , Nicholas Piggin , "Aneesh Kumar K.V" , Pavel Machek , "Naveen N. Rao" , linuxppc-dev@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" 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 --- arch/powerpc/platforms/83xx/suspend.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/powerpc/platforms/83xx/suspend.c b/arch/powerpc/platforms/83xx/suspend.c index eed325ed08cc..c9664e46b03d 100644 --- a/arch/powerpc/platforms/83xx/suspend.c +++ b/arch/powerpc/platforms/83xx/suspend.c @@ -264,8 +264,7 @@ static int agent_thread_fn(void *data) set_freezable(); while (1) { - wait_event_interruptible(agent_wq, pci_pm_state >= 2); - try_to_freeze(); + wait_event_freezable(agent_wq, pci_pm_state >= 2); if (signal_pending(current) || pci_pm_state < 2) continue; From patchwork Thu Dec 21 04:45:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Hao X-Patchwork-Id: 1878878 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=KU/z8HPw; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org (client-ip=2404:9400:2:0:216:3eff:fee1:b9f1; helo=lists.ozlabs.org; envelope-from=linuxppc-dev-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org; receiver=patchwork.ozlabs.org) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2404:9400:2:0:216:3eff:fee1:b9f1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4SwdGb0Zd9z1yr5 for ; Thu, 21 Dec 2023 15:48:07 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=KU/z8HPw; dkim-atps=neutral Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4SwdGZ60V3z3cVr for ; Thu, 21 Dec 2023 15:48:06 +1100 (AEDT) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=KU/z8HPw; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:4864:20::f36; helo=mail-qv1-xf36.google.com; envelope-from=haokexin@gmail.com; receiver=lists.ozlabs.org) Received: from mail-qv1-xf36.google.com (mail-qv1-xf36.google.com [IPv6:2607:f8b0:4864:20::f36]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4SwdCw3W3Rz3cRt for ; Thu, 21 Dec 2023 15:45:48 +1100 (AEDT) Received: by mail-qv1-xf36.google.com with SMTP id 6a1803df08f44-67f5c0be04cso2389416d6.0 for ; Wed, 20 Dec 2023 20:45:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703133945; x=1703738745; darn=lists.ozlabs.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=wDbvXqjKpu9jOEJyZCSpkgRzMyYzFDZk80pdFn2FvQ0=; b=KU/z8HPweP0UD6sWs+vErMbu1v2ECw2iShZ5lS+AqC1lb+TgkFhyc+P7GdcKF4OaPf ebwXukbBAw3V66zUNc1lxMZJ3Vm6Rg9qCym9eR8uT7cbBmobMINAecS8zrsFamd0eUC0 QBljiQA8zS9mGImsqliZVc+4m4h4wJeAS1sFcpSt29n+LEhD1Bgbn6cevLIEKk6VgpE8 zhT4/1NNsCg2pR2YdcS6ASjfY6G/IkYDh8xGWcU7DViLJWMDg2CJXWKFIKp0XyhsVq5k KZjma4VB3D7XqaGzoKF+wOq63L97SDnGBIOK4Jo5Tnn5LhvkY6gE/BJ/JCHvv568lVLm Z8kw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703133945; x=1703738745; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wDbvXqjKpu9jOEJyZCSpkgRzMyYzFDZk80pdFn2FvQ0=; b=E7RdxvnRkW9o9iVpbgu8jhZ9qyIapFhRDEwomDO8fC4guJkqYXHKwCgoob+NTSl72E g+obb5sm/Q6ErssN+w2LH/9r91lIKc5rOCao/g/dxyMc+wG74xGrdnAN5lJp+pY4Kr6k otxZz21AzdCGMSGJl/MVDsmYLBOpe3hB8pmuive79ipaqAnfcrJ0/A5ZtI+azCxbfnWH /flkI235EIP4dOSEijBkbMOm9bvzlay/nJDhvsUPW73NPlLLb8y/Xgl32wYgs8HNaV+Q 4pn37dDUSZisqvQ387eoxmtlIEfv+fTz7XT3BacbNb99ywQ2/ziY7k+G0waWbmnzzRub R0bg== X-Gm-Message-State: AOJu0Yxv730r0lI9qTgXbf3SStr2pz5r2CYVZan5F6Vg/wyTSuNSCGgm 7X+6LASb0VeCu50XUz7v+v8= X-Google-Smtp-Source: AGHT+IFINFJHWis+uHctWMcmPOO+C0/kRDSgnSS6JisZOvvJwl2MAYZozqB4C5bCboK+A4/MG7GMCA== X-Received: by 2002:a05:6214:48c:b0:67f:4bd6:ccdd with SMTP id pt12-20020a056214048c00b0067f4bd6ccddmr7418503qvb.64.1703133945355; Wed, 20 Dec 2023 20:45:45 -0800 (PST) Received: from pek-lpggp6.wrs.com (unknown-105-121.windriver.com. [147.11.105.121]) by smtp.gmail.com with ESMTPSA id ct15-20020a056214178f00b0067f3f3d8e8asm374459qvb.111.2023.12.20.20.45.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 20:45:44 -0800 (PST) From: Kevin Hao To: Michael Ellerman Subject: [PATCH 3/3] powerpc: ps3: Add missing set_freezable() for ps3_probe_thread() Date: Thu, 21 Dec 2023 12:45:10 +0800 Message-Id: <20231221044510.1802429-4-haokexin@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231221044510.1802429-1-haokexin@gmail.com> References: <20231221044510.1802429-1-haokexin@gmail.com> MIME-Version: 1.0 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Rafael J. Wysocki" , Geoff Levand , Nicholas Piggin , "Aneesh Kumar K.V" , Pavel Machek , "Naveen N. Rao" , linuxppc-dev@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" The kernel thread function ps3_probe_thread() 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 Signed-off-by: Geoff Levand --- arch/powerpc/platforms/ps3/device-init.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/platforms/ps3/device-init.c b/arch/powerpc/platforms/ps3/device-init.c index e87360a0fb40..878bc160246e 100644 --- a/arch/powerpc/platforms/ps3/device-init.c +++ b/arch/powerpc/platforms/ps3/device-init.c @@ -827,6 +827,7 @@ static int ps3_probe_thread(void *data) if (res) goto fail_free_irq; + set_freezable(); /* Loop here processing the requested notification events. */ do { try_to_freeze();