From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D97F1C48BD1 for ; Thu, 10 Jun 2021 08:25:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C4EA0613DF for ; Thu, 10 Jun 2021 08:25:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230366AbhFJI1Y (ORCPT ); Thu, 10 Jun 2021 04:27:24 -0400 Received: from mail-pg1-f173.google.com ([209.85.215.173]:38491 "EHLO mail-pg1-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230304AbhFJI1R (ORCPT ); Thu, 10 Jun 2021 04:27:17 -0400 Received: by mail-pg1-f173.google.com with SMTP id t17so5428841pga.5 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=g7gy6DtI1ic9XrY5EBk04i0L4WAzR0srLBWbvI6GyJWsfoGLcOYdODfv2nK8zYOH8m SwaPGVhPRpZaf9VD1GzfKGi6Iifb7PFbOqZcSGIAw+EOWzgKt6kx4dtIdZHVeBnBGAvh u0L7inNHa+ie42Onrnp9C0Rb7F3MlUKvKvAx2l+6qnxtzMWJoF37bL1E9UJdyPqjpcao Ky0e/623TIIl6KM2fdXUGU/334Ym6w/q2s8L9uX2zSuFEo3lRdbUedJ3KFd3h0M0/pAK ooC2YuqAKv0qAcJ9VnSSBwuJRzvdZDJKuUGmSVZ8XF0PCHAz4gMQ5PQEMpu/Pw49/D0n Rnzw== X-Gm-Message-State: AOAM530sl4fKYBpmB4QkWCja/QGfwLu8mI4iyIfzR0/RD8Kaq1D8RMW7 D9+dzmrx69DAd/4KCOWxlnK/Mg== X-Google-Smtp-Source: ABdhPJyi+O4KwGPfvZR518NR4+exaoYeuUIiRL46B3bKaN8ChQ5bmYUKDSfTaz+qd2RgLjB3qxti9A== 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 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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