Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp29818imw; Mon, 4 Jul 2022 04:46:51 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uBJOQGmWOh6zV/NR3SLzrLoS/KgvvQlKOA36vmwnnx28RAi87xA47Z+j3lIk9OunbAV/mo X-Received: by 2002:a17:902:f68a:b0:16b:a762:9735 with SMTP id l10-20020a170902f68a00b0016ba7629735mr26090314plg.23.1656935210738; Mon, 04 Jul 2022 04:46:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656935210; cv=none; d=google.com; s=arc-20160816; b=VGaexbbiM4XHilFgK2Llx2d1a5epu3LAUNh4ekqN7iraYjLb9hpTkmBP+iXIMcfly8 egih8n4oNQwtXmDERLHDIqha8XgWoSfzwCWQkwramicZHt/9e6yYcJd6hAPcXgUe57Mm Q9BW46EPByp7E3I2MQh0IOgZymspjWIqCc7h9cAkNWMuRPUaejg8Anyqnj+wHVSGwQly hYlv8sTyv6zLWEuUmPlSDxjJUQJh2O3UkJOjvhsCGzgaixjFdfQGnjaQhrtP0pnFetzt t1mEDz6pwrHmLnW2CA4C1XEZDnvrd+TwR62XlHcUfbPaj3VtOfB3ExOxAV5jG3XCQ4lT ObKg== 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=GVU7ll6+FxCS89gK+PbTeYCOMpT+GaS5YYMXb4P5Qx8=; b=NThhBOQ0g0En49yKDMr7/5s2gbxyoyU/587j3a8TcVX2BwpCOEjKIXHepRbeVHYqRZ u/E1FY12IwkEAuYjXZV2OkwFz/lzO9ybjS4WXlIammGTMZz1YAlfzZPdAQUbG86kaIQ0 c92t+5E3+rLGdeanOYihGGoKGLz/cb6Jm8feksJLvzY4ww+TeDjDaKggNmHYY43ME8iz nRcgNa3YAUGdOm6rdyeXqE3XrHaSV8GWfQkwdD1hDPf2B1hzQEBYsnmgVU2Rbun3usdC aFXcXZuS3qyFyHjpdcYQc4+h2ahQkqQz2QqKQdjGSs4PJ2sBEdbYkRdZ3ixhhHEAOIBZ ooKw== 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 x11-20020aa78f0b000000b0051bbc660065si40665522pfr.328.2022.07.04.04.46.39; Mon, 04 Jul 2022 04:46:50 -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 S234229AbiGDL2t (ORCPT + 99 others); Mon, 4 Jul 2022 07:28:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41116 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233947AbiGDL2j (ORCPT ); Mon, 4 Jul 2022 07:28:39 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2A2BD11142; Mon, 4 Jul 2022 04:28:39 -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 459D223A; Mon, 4 Jul 2022 04:28:39 -0700 (PDT) Received: from pierre123.arm.com (unknown [10.57.41.108]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 5FDD33F66F; Mon, 4 Jul 2022 04:28:36 -0700 (PDT) From: Pierre Gondois To: linux-kernel@vger.kernel.org Cc: Ionela.Voinescu@arm.com, Dietmar.Eggemann@arm.com, Pierre Gondois , "Rafael J. Wysocki" , Viresh Kumar , Andy Gross , Bjorn Andersson , linux-pm@vger.kernel.org, linux-arm-msm@vger.kernel.org Subject: [PATCH v2 4/4] cpufreq: Change order of online() CB and policy->cpus modification Date: Mon, 4 Jul 2022 13:27:39 +0200 Message-Id: <20220704112739.3020516-5-pierre.gondois@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220704112739.3020516-1-pierre.gondois@arm.com> References: <20220704112739.3020516-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. 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