Received: by 10.213.65.68 with SMTP id h4csp333510imn; Wed, 21 Mar 2018 20:33:48 -0700 (PDT) X-Google-Smtp-Source: AG47ELt43jvK5UQ1qkWT5YlWJH3LJpTs2VWXcpMC/LFPukCUyZ5fVTydVMGwscyYOMmtNiLeFCe4 X-Received: by 2002:a17:902:2983:: with SMTP id h3-v6mr2798039plb.80.1521689628588; Wed, 21 Mar 2018 20:33:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521689628; cv=none; d=google.com; s=arc-20160816; b=K+50ExzjLOPqKRaaGOmoW5CNqQKwncYigoR5dmAZ/A4aelsg9p0pZwvq3yuhQJbtes psndNlSsqGiI4V4Xj/zu3a22Jz+maeqVCBHGBJuYjRszCDc+N8yXZWzTxHotl3I+u4CX T4dSXusomsyS87QiB4eu65SEAFmYPPOjuRGDkV35wDD7zHbN4yTfw3VVG0JPH327Obgb q54dINRHUZOJ+DIOJqQuXKRWQOtT6OQuFf3nBXkRx+3SERYjYWM+6vTA2F8/VXLHiBVg 8Rufllr83rTpvttxXRJybw9W55D7ewLQ9R21CmBxGi2iG6ppPGW/M97J0vOwFVuj70Tm cfNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=NHF7QrhS6o84cBKmV5rrSaBh/QSEs7791FOYB8Jwxow=; b=mAb8vUD/odGU0zW6ZRxQkR51Qovy+yybRTGH9nykwjgvLlrJwZq1spa2Qub/VX1KXF eotSBH5+ryyk0MPwur0Ohv72mVrJoN8C2f8oHlWdUWMGmJGPH7UM5pjpLgRx126maCu+ SMHPYTYfyrNGoq7G/xeedW8LCzbcb3jjwk9fbb14/mw/I9+w0aKfX4RBE7xse0B00LAw R6Gf62jhCr6wNBMnjVOJYZvF+UcjhJGSurMfy+rl4nENfhIr7yRGRNWYPqogy3fICexG SAekevZ1k5BtRnyDfuewjboAZKxJ/dZ+DHJrepKX2wbsDzhWybe09cqQCU/w4FXUtAmr NAnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Y2SZkhbd; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f61-v6si1328575plb.291.2018.03.21.20.32.55; Wed, 21 Mar 2018 20:33:48 -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; dkim=pass header.i=@linaro.org header.s=google header.b=Y2SZkhbd; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751909AbeCVDaU (ORCPT + 99 others); Wed, 21 Mar 2018 23:30:20 -0400 Received: from mail-pg0-f66.google.com ([74.125.83.66]:46810 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751728AbeCVDaR (ORCPT ); Wed, 21 Mar 2018 23:30:17 -0400 Received: by mail-pg0-f66.google.com with SMTP id t12so1004861pgp.13 for ; Wed, 21 Mar 2018 20:30:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=NHF7QrhS6o84cBKmV5rrSaBh/QSEs7791FOYB8Jwxow=; b=Y2SZkhbdI4bgVaqVDLlL0m9WburjQt5GaIMv/Kc0sBqTcvK1LQ34occLpf7NvnAamx /LnQBOrnyEFrzp8JSDsJnHd10Ks51WZLncp62GuFwX58FbI4sLAQRXeJcLMVXP+dwhX7 VaSJZF7Qg3hevvAKxYPxa8hI7zB25en+dInls= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=NHF7QrhS6o84cBKmV5rrSaBh/QSEs7791FOYB8Jwxow=; b=jCWNexIoPad9LocYB59ajo3LcAw6Ap5yGcB27UdgS3LwcT7rvijhoV8OVjBt1Y29tV TeCEqOnnI0whs8kLitj8lGXM+xrfYUpsul7EoaU8vmiKL3ixIr4p8li/oRejKIr0OMyb JbfnvcvDp4udChxwI3gs3bEuTG9gkd0cMss+vCTKs6jrRKDbuMljiRwamaFStTimi555 HxYG7V9f8+9MU3g7qiPibNeQ7JmE4wVLvGmWONR4GFS09myneIroHUSvIdA++hbDtvmD VVcwcAAQKysituwrh8JqRX3zggt66/kK9690KKtX8j2rGw3Uq6YW+CI9X4OzL0fTepqC NGYg== X-Gm-Message-State: AElRT7EQZ+1fE9l7BDrx+7hwhgsfi9XWuVamBM4GMktaup9CD/BeT/zE +4FAW6QrbbNpA5wtmpkC5DkSCA== X-Received: by 10.98.97.1 with SMTP id v1mr19255557pfb.119.1521689416732; Wed, 21 Mar 2018 20:30:16 -0700 (PDT) Received: from localhost ([218.255.99.6]) by smtp.gmail.com with ESMTPSA id z67sm9087386pgb.69.2018.03.21.20.30.15 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Mar 2018 20:30:15 -0700 (PDT) Date: Thu, 22 Mar 2018 11:30:13 +0800 From: Viresh Kumar To: Shunyong Yang Cc: rjw@rjwysocki.net, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Wang Dongsheng , Joey Zheng Subject: Re: [RFC PATCH] cpufreq: Calling init() of cpufreq_driver when policy inactive cpu online Message-ID: <20180322033013.3mqhf2fnbaqfdgay@vireshk-mac-ubuntu> References: <1521627703-7728-1-git-send-email-shunyong.yang@hxt-semitech.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1521627703-7728-1-git-send-email-shunyong.yang@hxt-semitech.com> User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 21-03-18, 18:21, 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. In a CPPC case, > let's take two related cpus, cpu0 and cpu1 as an example. > > After system start, cpu0 is the first online cpu. Cpufreq policy will be > allocated and init() in cpufreq_driver will be called to initialize cpu0's > perf capabilities and policy parameters. Not exactly. The init() is called to initialize stuff for all the CPUs that should be part of policy->related_cpus after init() has returned. So you should initialize perf capabilities for all of them. > When cpu1 is online, current code > will not call init() in cpufreq_driver as policy has been allocated and > activated by cpu0. So, cpu1's perf capabilities are not initialized > (all 0s). > > When cpu0 is offline, policy->cpu will be shifted to cpu1. As cpu1's perf > capabilities are 0s, speed change will not take effect when setting > speed. > > This patch adds calling init() of cpufreq_driver when policy inactive cpu > comes to online. No CPU should be inactive here, its just that you haven't initialized it properly. And we are not going to call init() multiple times for a group of CPUs. That's not what the purpose of init() is. -- viresh