Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp570059iog; Wed, 15 Jun 2022 07:56:58 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tI8V6e4Yw2HaLMLtAZIoRA1fLsDBCHDZ5A+DAh8fdX/yU+3C0pl2p9bXVIlg+AsySjPUbc X-Received: by 2002:aa7:d481:0:b0:42d:d5fd:f963 with SMTP id b1-20020aa7d481000000b0042dd5fdf963mr122450edr.209.1655305018110; Wed, 15 Jun 2022 07:56:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655305018; cv=none; d=google.com; s=arc-20160816; b=zMdoqpqLgjPJA/j5eaQfbm5SIENdz2EyTj1gNfS8MaIgvrtGq8CKf6PyOyJz6Gs2wQ bJaQRq0/G5YeG8LYSZm36KSMR63U4o9nra1Q0df+3Sl8RxPXsjOV/fXQa3/n/TIocldQ lzmyeL/qwP7jqk6zi/Wl+CztO1fQbJawAYI+zxc7gSLhvsZuczh3lTpFxfuTtQuVnLY0 rGCxyBbZNPiXAU8ZHySL9SHuwPidWP2Cz/d/MlPl5kC3lHKmsV0NFsXIuyDaFVB7Fldn GxESKUwHpu2wT41ddUsWGuripFBkEVfdxIU1m+tx/vNnx/xeKtWHXqS5Vajj4CFRQWeP 8SDw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=8EH3/5F+slgjy2SjHS/5OSsEQ0ejsPfe0E7zslkqXuc=; b=0GH2g1jCzgbheZWf98aPdvyt+6+L/JiP6Jikg4puea/MuPi4AwKzuLIQpLqlBXjos4 Djxo3TdwBEWgxQAsMCWVGrBrLnFKdfgwGfXVeF9l2N1vOU2vCT2RsBhwDJ6gKuZWt/WB LmR3Vqtd8vvdSGc+9uxOKLPprN75TvXpBoz/ExE7wFERkl0CTrcxT3lzSGpjWu0Qf58D VQ7Df4D7X5wujYlzuRHQROVJQR5hlZ/YLrY+OfquW1gb2fDwkGMvuspkvHjBN2lNk3Sd fhFd4w6fQL3cwEfiOFlvBNL148W3799FWb8HHuzMM5dsLUAExrVlw3Bl8/+kCYJpoR9s pzfA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ds9-20020a170907724900b00711d2e5cc71si16905557ejc.935.2022.06.15.07.56.32; Wed, 15 Jun 2022 07:56:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1354092AbiFOOpD (ORCPT + 99 others); Wed, 15 Jun 2022 10:45:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59662 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353949AbiFOOpB (ORCPT ); Wed, 15 Jun 2022 10:45:01 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5ABF239BAA; Wed, 15 Jun 2022 07:45:00 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 2DB97153B; Wed, 15 Jun 2022 07:45:00 -0700 (PDT) Received: from pierre123.arm.com (unknown [10.57.5.38]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 91EC93F73B; Wed, 15 Jun 2022 07:44:57 -0700 (PDT) From: Pierre Gondois To: linux-kernel@vger.kernel.org Cc: Ionela.Voinescu@arm.com, Lukasz.Luba@arm.com, Dietmar.Eggemann@arm.com, Pierre Gondois , "Rafael J. Wysocki" , Viresh Kumar , Andy Gross , Bjorn Andersson , Vladimir Zapolskiy , Dmitry Baryshkov , linux-pm@vger.kernel.org, linux-arm-msm@vger.kernel.org Subject: [PATCH 4/4] cpufreq: Change order of online() CB and policy->cpus modification Date: Wed, 15 Jun 2022 16:43:21 +0200 Message-Id: <20220615144321.262773-5-pierre.gondois@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220615144321.262773-1-pierre.gondois@arm.com> References: <20220615144321.262773-1-pierre.gondois@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From a state where all policy->related_cpus are offline, putting one of the policy's CPU back online re-activates the policy by: 1. Calling cpufreq_driver->online() 2. Setting the CPU in policy->cpus qcom_cpufreq_hw_cpu_online() makes use of policy->cpus. Thus 1. and 2. should be inverted to avoid having a policy->cpus empty. The qcom-cpufreq-hw is the only driver affected by this. Fixes: a1eb080a0447 ("cpufreq: qcom-hw: provide online/offline operations") Signed-off-by: Pierre Gondois --- drivers/cpufreq/cpufreq.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 2cad42774164..36043be16d8e 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -1350,15 +1350,15 @@ static int cpufreq_online(unsigned int cpu) } if (!new_policy && cpufreq_driver->online) { + /* Recover policy->cpus using related_cpus */ + cpumask_copy(policy->cpus, policy->related_cpus); + ret = cpufreq_driver->online(policy); if (ret) { pr_debug("%s: %d: initialization failed\n", __func__, __LINE__); goto out_exit_policy; } - - /* Recover policy->cpus using related_cpus */ - cpumask_copy(policy->cpus, policy->related_cpus); } else { cpumask_copy(policy->cpus, cpumask_of(cpu)); -- 2.25.1