From patchwork Thu Jun 10 08:23:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 457842 Delivered-To: patch@linaro.org Received: by 2002:a02:735a:0:0:0:0:0 with SMTP id a26csp177821jae; Thu, 10 Jun 2021 01:25:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyxTXmkhL9Tb7qwUF51FNYC0IvzJd+3Db2stmuqbvmqbFOjprXTKqso4PTQ/oPARhbdS59f X-Received: by 2002:aa7:c7cd:: with SMTP id o13mr3548847eds.269.1623313532091; Thu, 10 Jun 2021 01:25:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623313532; cv=none; d=google.com; s=arc-20160816; b=A/ANOw1NGohJiNg58EA29EhDrjQWTSy9OKrQTKNlX4+g8HSZpVIDeYJ6sxqQtMh1lK phhXSrU9VPvy5ISyy1IXy/ruJrZo7XjzooMgIaZ3Lkg3GosHL3drryT8tgoSk8DBPwvf QIWevVmsDLKp4IoGuudwFAXwbPYybIxHKlMpzwcaXH630pPe3YV2ofUPrq6CEXJu9rMP myH8qq908TLbiiMqmWTdozKhN4AhH3vxmsBOqBkiGLt9EmuLrrhDKf4pm/xSHXVY6Lvc prKK/9vTICX/5KWu2jwgUlA7SX+sTZNBYNNVvmfU9QtY8DOlpGTYMVwEoQUr5NqRYQ6Y s40Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=dx3LD+QONQZ90XyumvQYMedCFWUAyiq58QYIKI9G5zg=; b=wxArC4tJXZj4un/4lM5YZCKI1EIsLWnW0/yYl1nrjXqyEcj7YJMycQKw8BVLERGz/D ZxHIVELJWQkW2yqVa3qng89AQmI/dUbvyvt0hEMvPeLDvLnvy/4uNKCelm9d55cvOGK1 8OKmESiZJyX+vvzjNufSAGthsO4W4PbRVPU3ahHbfwj2qtZ2/dRpquuhzULn24cWRm5j aEbL1RKUGD/hn69waZY94FPA3MxFzWAeRIxImZTSHl+vtUWCdLAYZQrZPdKHb0bFbyxy hEc/W7aGMea3oaH1ag12HKzwa2GWHEs11bJxG2DitRPLiYqgJ2+x02SyREKFV0+AT2J7 9gCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=P2q0IrTn; spf=pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id be8si1721641edb.223.2021.06.10.01.25.31; Thu, 10 Jun 2021 01:25:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=P2q0IrTn; spf=pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230344AbhFJI1V (ORCPT + 8 others); Thu, 10 Jun 2021 04:27:21 -0400 Received: from mail-pg1-f181.google.com ([209.85.215.181]:40647 "EHLO mail-pg1-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230305AbhFJI1S (ORCPT ); Thu, 10 Jun 2021 04:27:18 -0400 Received: by mail-pg1-f181.google.com with SMTP id j12so21987523pgh.7 for ; Thu, 10 Jun 2021 01:25:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=dx3LD+QONQZ90XyumvQYMedCFWUAyiq58QYIKI9G5zg=; b=P2q0IrTnZYJcNJxgCNUHZgCPckId6L8Xpz9JvHK94UQxbHTBsvAoHdRevTah0jtZ3C DCZ6YmT9q2kBAB7ezTldLlg1d+TpPCX4gGqUxhneVHoJ49Uc/el/KNIL60EsASs+ZlNC JEDN6py3rNeV5OcXFDOtSDN0tP/JK+MbjrpCq1S4hdgRmboCcjRNphTQdxRzsuiHmmb5 yfyQl++2mNNsb7k2L/BGPE9wUTxeN1Nskrt0HKrJjII+LfLXiGwuZz6Vu3TTHIMFcgAB Wmy5LLcTK/ZMpMXPY4uhxUvBaF/ddyPrNPoR0AcOk9q9cdPYIl8Yze1Zad+LaPa2WcsZ 4aiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=dx3LD+QONQZ90XyumvQYMedCFWUAyiq58QYIKI9G5zg=; b=oJShm/I/CXw9KBQHlmUlc57o9cEJHNEIThl3esVZHmds6gePBfpBGGdfzPT08mSjCi Lywn9MI4sP6EUujrxmIjFum3BFAgE4eArqut/LcVye08+uBf6Ks6s/n4mDhpbyJyaXBL qI9/U5Rf+0NGZNeFMqhQEgF6s7ywNzhXGpffLdm9YiPrRzwLu+AlfFL+d8Zhgt9Ls5nK TdmPTjZVMOEpcArHtA6F92dK0nvvSJCVLGNQH4pipp10LkZneqFGNZfE+d9uMv0baiyi hWuSYoKrenFDqBiYIYo5d3S0kB6TOrUkCFXLE9bBzA8+b5YcfvMWzkZ2Br9SCqQukaaj dNCw== X-Gm-Message-State: AOAM532JxE5VtAMLJTNi10yKotCfoBXqX6fPtIlXuGpsqtYRU9Ah/A/+ 10DvocPe61PR0oPg3JzzW5E7Mg== X-Received: by 2002:aa7:8888:0:b029:2ec:763f:4bcc with SMTP id z8-20020aa788880000b02902ec763f4bccmr1846743pfe.35.1623313448946; Thu, 10 Jun 2021 01:24:08 -0700 (PDT) Received: from localhost ([136.185.169.128]) by smtp.gmail.com with ESMTPSA id h7sm1739207pfe.62.2021.06.10.01.24.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Jun 2021 01:24:08 -0700 (PDT) From: Viresh Kumar To: Rafael Wysocki , Qian Cai , Benjamin Herrenschmidt , Jonathan Corbet , Len Brown , Michael Ellerman , Paul Mackerras , Srinivas Pandruvada , Viresh Kumar Cc: linux-pm@vger.kernel.org, Vincent Guittot , Ionela Voinescu , Dirk Brandewie , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Subject: [PATCH 0/5] cpufreq: cppc: Fix suspend/resume specific races with FIE code Date: Thu, 10 Jun 2021 13:53:56 +0530 Message-Id: X-Mailer: git-send-email 2.31.1.272.g89b43f80a514 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Hi Qian, It would be helpful if you can test this patchset and confirm if the races you mentioned went away or not and that the FIE code works as we wanted it to. I don't have a real setup and so it won't be easy for me to test this out. I have already sent a temporary fix for 5.13 and this patchset is targeted for 5.14 and is based over that. -------------------------8<------------------------- The CPPC driver currently stops the frequency invariance related kthread_work and irq_work from cppc_freq_invariance_exit() which is only called during driver's removal. This is not sufficient as the CPUs can get hot-plugged out while the driver is in use, the same also happens during system suspend/resume. In such a cases we can reach a state where the CPU is removed by the kernel but its kthread_work or irq_work aren't stopped. Fix this by implementing the start_cpu() and stop_cpu() callbacks in the cpufreq core, which will be called for each CPU's addition/removal. A similar call was already available in the cpufreq core, which isn't required anymore and so its users are migrated to use exit() callback instead. This is targeted for v5.14-rc1. -- Viresh Viresh Kumar (5): cpufreq: cppc: Migrate to ->exit() callback instead of ->stop_cpu() cpufreq: intel_pstate: Migrate to ->exit() callback instead of ->stop_cpu() cpufreq: powerenv: Migrate to ->exit() callback instead of ->stop_cpu() cpufreq: Add start_cpu() and stop_cpu() callbacks cpufreq: cppc: Fix suspend/resume specific races with the FIE code Documentation/cpu-freq/cpu-drivers.rst | 7 +- drivers/cpufreq/Kconfig.arm | 1 - drivers/cpufreq/cppc_cpufreq.c | 163 ++++++++++++++----------- drivers/cpufreq/cpufreq.c | 11 +- drivers/cpufreq/intel_pstate.c | 9 +- drivers/cpufreq/powernv-cpufreq.c | 23 ++-- include/linux/cpufreq.h | 5 +- 7 files changed, 119 insertions(+), 100 deletions(-) -- 2.31.1.272.g89b43f80a514