Received: by 10.213.65.68 with SMTP id h4csp2194945imn; Mon, 2 Apr 2018 03:02:18 -0700 (PDT) X-Google-Smtp-Source: AIpwx48bnFl19OQPL+ZW4GBhwWBwlUY/humqB61yzYiFsSu/v44mkE4ASEt8a169aFtmv8RWdrJf X-Received: by 2002:a17:902:7084:: with SMTP id z4-v6mr9510103plk.395.1522663338947; Mon, 02 Apr 2018 03:02:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522663338; cv=none; d=google.com; s=arc-20160816; b=gYGWjrudUBhna3frtOJOMEZ8X1KO/9KqNtxvBto0diMDd8GVE/57+Ilm0OUS2UH/rc L3jDHT5d3PilgLOARqjVG+fAY+DMNsNOlMFGxvvNlGIhHV+92wJUqUCfkpfpSFPH25u0 mtxOnJzRo/yQJawntSJl6JEslZ3r8Q4fAu8ryT3R4IIZUzFLlHbFTjbAToWD/a+yisX2 ePr2Hez4m20o2uXPhN/cmPadruF2f+toq300EWCe59gpUqh3FeUECxiPUTdmdCv1GXHu wBpznlXQV26sxNvsX3urM8aUmFWTF2RE04VYj+MY0AhvfQ633IvOT/xjiux3EvpQFss7 Ly7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-id:content-language:accept-language:in-reply-to:references :message-id:date:thread-index:thread-topic:subject:cc:to:from :arc-authentication-results; bh=goCPgALKRJimqLA4CFzSW792yJTd2JJ5JcGs7dUfUig=; b=mkNEvPUAUtaQB6wkr3qt7m+tAcmiBby2aI7MjMqLM0bRSox0xVqo773f3c8j/KYRlL 1bB0Zm+3+ilmhLwjYqhVgiI/0CQdVIkzaQRH3DDXa+bbgIlQpQLqj3XAFVBowmzYKQ+Q iM7lIQZDQPox9JWrT2Jse0aZnHw3mhdOeFZNeGKMraKxrXthz6SeuU0K9/v+W8eA30yB Xv+OnMTuUxH/Il/ixt5qWfAUMNnO/p7JAo3bkBCoCX4VAO5knTgC2kxd8IkgCMlIdyks pjvgX5sE0Wbz5kuURpBg/ubznlnZbdnarK6j9+s8hscDlByU9tBJRPZc5d5CuUVHO+63 00Sg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k190si11896pgk.196.2018.04.02.03.02.03; Mon, 02 Apr 2018 03:02:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754322AbeDBKAt convert rfc822-to-8bit (ORCPT + 99 others); Mon, 2 Apr 2018 06:00:49 -0400 Received: from mx01.hxt-semitech.com.96.203.223.in-addr.arpa ([223.203.96.7]:59646 "EHLO barracuda.hxt-semitech.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1754130AbeDBKAr (ORCPT ); Mon, 2 Apr 2018 06:00:47 -0400 X-ASG-Debug-ID: 1522663242-093b7e10b30c1a0001-xx1T2L Received: from HXTBJIDCEMVIW02.hxtcorp.net (localhost [10.128.0.15]) by barracuda.hxt-semitech.com with ESMTP id jofwmjvgCxYavZ47 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 02 Apr 2018 18:00:42 +0800 (CST) X-Barracuda-Envelope-From: shunyong.yang@hxt-semitech.com Received: from HXTBJIDCEMVIW01.hxtcorp.net (10.128.0.14) by HXTBJIDCEMVIW02.hxtcorp.net (10.128.0.15) with Microsoft SMTP Server (TLS) id 15.0.847.32; Mon, 2 Apr 2018 18:00:43 +0800 Received: from HXTBJIDCEMVIW01.hxtcorp.net ([fe80::f451:a443:c0b5:87d1]) by HXTBJIDCEMVIW01.hxtcorp.net ([fe80::f451:a443:c0b5:87d1%12]) with mapi id 15.00.0847.030; Mon, 2 Apr 2018 18:00:43 +0800 From: "Yang, Shunyong" To: "viresh.kumar@linaro.org" CC: "linux-kernel@vger.kernel.org" , "Zheng, Joey" , "linux-pm@vger.kernel.org" , "rjw@rjwysocki.net" Subject: Re: [PATCH] cpufreq: cppc_cpufreq: Initialize shared cpu's perf capabilities Thread-Topic: [PATCH] cpufreq: cppc_cpufreq: Initialize shared cpu's perf capabilities X-ASG-Orig-Subj: Re: [PATCH] cpufreq: cppc_cpufreq: Initialize shared cpu's perf capabilities Thread-Index: AQHTxnej2cVTpFHCIEicwJJ9iRTflKPsj6EAgAAwPYA= Date: Mon, 2 Apr 2018 10:00:42 +0000 Message-ID: <1522663241.8018.3.camel@hxt-semitech.com> References: <1522229514-14377-1-git-send-email-shunyong.yang@hxt-semitech.com> <20180402070802.GE4714@vireshk-i7> In-Reply-To: <20180402070802.GE4714@vireshk-i7> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.64.6.69] Content-Type: text/plain; charset="iso-8859-15" Content-ID: <13C51476FCD5504D862AD055F20F9A28@hxt-semitech.com> Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-Barracuda-Connect: localhost[10.128.0.15] X-Barracuda-Start-Time: 1522663242 X-Barracuda-Encrypted: ECDHE-RSA-AES256-SHA X-Barracuda-URL: https://192.168.50.101:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at hxt-semitech.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Bayes: INNOCENT GLOBAL 0.5294 1.0000 0.7500 X-Barracuda-Spam-Score: 0.75 X-Barracuda-Spam-Status: No, SCORE=0.75 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=9.0 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.49513 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Kumar, On Mon, 2018-04-02 at 12:38 +0530, Viresh Kumar wrote: > On 28-03-18, 17:31, Shunyong Yang wrote: > > > > When multiple cpus are related in one cpufreq policy, the first > > online > > cpu will be chosen by default to handle cpufreq operations. Let's > > take > > cpu0 and cpu1 as an example. > > > > When cpu0 is offline, policy->cpu will be shifted to cpu1. Cpu1's > > should > > be initialized. Otherwise, perf capabilities are 0s and speed > > change can > > not take effect. > > > > This patch copies perf capabilities of the first online cpu to > > other > > shared cpus when policy shared type is CPUFREQ_SHARED_TYPE_ANY. > > > > Cc: Joey Zheng > > Signed-off-by: Shunyong Yang > > --- > > > > The original RFC link, > > ? https://patchwork.kernel.org/patch/10299055/. > > > > This patch solves same issue as RFC above. > > > > Patch name is changed as code is too much different with RFC above. > > > > Remove extra init() per Viresh Kumar's comments and only handle > > CPPC CPUFREQ_SHARED_TYPE_ANY case. > > > > --- > > ?drivers/cpufreq/cppc_cpufreq.c | 12 +++++++++++- > > ?1 file changed, 11 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/cpufreq/cppc_cpufreq.c > > b/drivers/cpufreq/cppc_cpufreq.c > > index 8f7b21a4d537..dc625a93a58e 100644 > > --- a/drivers/cpufreq/cppc_cpufreq.c > > +++ b/drivers/cpufreq/cppc_cpufreq.c > > @@ -164,8 +164,18 @@ static int cppc_cpufreq_cpu_init(struct > > cpufreq_policy *policy) > > ? policy->cpuinfo.transition_latency = > > cppc_get_transition_latency(cpu_num); > > ? policy->shared_type = cpu->shared_type; > > ? > > - if (policy->shared_type == CPUFREQ_SHARED_TYPE_ANY) > > + if (policy->shared_type == CPUFREQ_SHARED_TYPE_ANY) { > > + int i; > > + > > ? cpumask_copy(policy->cpus, cpu->shared_cpu_map); > > + > > + for_each_cpu(i, policy->cpus) { > > + if (i != policy->cpu) > I would rather do: > > ????????????????????????if (unlikely(i == policy->cpu)) > ????????????????????????????????continue; Thanks. Will change in v2. > > > > + memcpy(&all_cpu_data[i]- > > >perf_caps, > > + ???????&cpu->perf_caps, > > + ???????sizeof(cpu->perf_caps)); > > + } > > + } > > ? else if (policy->shared_type == CPUFREQ_SHARED_TYPE_ALL) { > It should be: > > ?? } else if (policy->shared_type == CPUFREQ_SHARED_TYPE_ALL) > { > Thanks. Will change in v2. I ignored this as checkpatch.pl reports nothing here. Thanks. Shunyong. > > > > ? /* Support only SW_ANY for now. */ > > ? pr_debug("Unsupported CPU co-ord type\n"); > And thanks for making it work this way. >