Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2647328imj; Mon, 11 Feb 2019 06:25:54 -0800 (PST) X-Google-Smtp-Source: AHgI3IZVF4fBELhMtfS62izVLpOSY9kPYIUdPB9ppEUXwrS5ZPD7RRSYX3c5qvB0oAdZljcWC44M X-Received: by 2002:a63:e451:: with SMTP id i17mr33605573pgk.413.1549895154175; Mon, 11 Feb 2019 06:25:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549895154; cv=none; d=google.com; s=arc-20160816; b=LeqoUFxeNendehFpeXlxqCtkRgrF9O2jMvaF0/zyacxFGJA8Uf7yfittBvVkjDd1+m AaOnNZckDjTx731N8zM0LumyTmgCjkT2BpKiADn4vqDp9jZC78D1LfQqKvL1i4H7eWxL ZkBTa6VHDu2mv0PfW3KHg8Evp1bHdEwsYsaUWWqAYDyQhT9I5ySK/oLXxZaayHb7GGYw Gd3Df7JPXVqVdH7Y9f6yRi0XIsWxzIK4Hm3AMk4sdIPK+JMhSwbIpUidOD1pdprV+vh+ jEqHtq8JlIEVmxlrdnqoy16UAJ4OpuxwCzIpwQrZqNURw5MVmuFXK32s34xZ/5bn3ZeV estQ== 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; bh=UA3/CXko0ZJ6CcJu6IPPdDXgNcNaZB29Jdz1qElWhNg=; b=IDUsZ9ZboA8TDHbo4s2NxSsGx2JYJadgLu+YNZ4vmXGD7LCJSDNJd8Tv/Hcj0Tw6Fn ah6s0fUilvZSKvrzcfhrvuCYb1DcEyK1vT1Dg3eu0G/6lzD7cCn1HmsSFxpOTnrpHXn8 qkk7G4vD2mfMEqzpDgh0Ec8NJLTVA9Ad34Xw7vi+FtpCzxyJZnWSny506W0GXje569xP PWlIanH68CYsWr+tNAqk+NDhDnrf7tK7C3FmkjRYDU1LRutesUhouLPDOfszNQV5LS/X 4aVOgdu0NiYePoDy5gqIZIoF5Q0UabJA7mrM1cjkR+ZhqM1nlAlNk1XcjsRPkEnFWSAO f3gA== 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 a8si9324987pgw.380.2019.02.11.06.25.37; Mon, 11 Feb 2019 06:25:54 -0800 (PST) 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 S1727620AbfBKOIi (ORCPT + 99 others); Mon, 11 Feb 2019 09:08:38 -0500 Received: from foss.arm.com ([217.140.101.70]:49224 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727327AbfBKOIi (ORCPT ); Mon, 11 Feb 2019 09:08:38 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id E3090A78; Mon, 11 Feb 2019 06:08:37 -0800 (PST) Received: from e107155-lin (e107155-lin.cambridge.arm.com [10.1.196.42]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id F122F3F557; Mon, 11 Feb 2019 06:08:35 -0800 (PST) Date: Mon, 11 Feb 2019 14:08:29 +0000 From: Sudeep Holla To: Viresh Kumar Cc: Marek Szyprowski , linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, linux-samsung-soc@vger.kernel.org, "Rafael J . Wysocki" , Nishanth Menon , Stephen Boyd , Bartlomiej Zolnierkiewicz , Dave Gerlach , Wolfram Sang Subject: Re: [PATCH 0/2] cpufreq/opp: rework regulator initialization Message-ID: <20190211140829.GA4269@e107155-lin> References: <20190207122227.19873-1-m.szyprowski@samsung.com> <20190208110053.GA7913@e107155-lin> <87302853-74cc-8eeb-6bd4-6338746e0738@samsung.com> <20190208115122.GA13043@e107155-lin> <66b33c07-4970-b60a-d924-d4baba79c836@samsung.com> <20190208174131.GB22401@e107155-lin> <20190211084714.nq3wqxk66dbrfqvy@vireshk-i7> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190211084714.nq3wqxk66dbrfqvy@vireshk-i7> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 11, 2019 at 02:17:14PM +0530, Viresh Kumar wrote: > On 08-02-19, 17:41, Sudeep Holla wrote: > > Based on Rafael's suggestion, I cooked up something. See if this helps ? > > The policy to cpu dance can be removed and we can just run through the > > online cpumask I think. > > > > Regards, > > Sudeep > > > > -->8 > > > > diff --git i/drivers/cpufreq/cpufreq.c w/drivers/cpufreq/cpufreq.c > > index e35a886e00bc..03d65a02a542 100644 > > --- i/drivers/cpufreq/cpufreq.c > > +++ w/drivers/cpufreq/cpufreq.c > > @@ -1640,6 +1640,7 @@ EXPORT_SYMBOL(cpufreq_generic_suspend); > > void cpufreq_suspend(void) > > { > > struct cpufreq_policy *policy; > > + int cpu; > > > > if (!cpufreq_driver) > > return; > > @@ -1662,6 +1663,11 @@ void cpufreq_suspend(void) > > } > > > > suspend: > > + if (cpufreq_driver->flags & CPUFREQ_DEFER_INIT_DURING_RESUME) > > + for_each_active_policy(policy) > > + for_each_cpu(cpu, policy->cpus) > > + cpufreq_offline(cpu); > > You will offline boot-cpu as well :) > Indeed, I was just trying to check the idea of flags and clearly missed the boot cpu :( [..] > > @@ -2444,14 +2455,16 @@ static enum cpuhp_state hp_online; > > > > static int cpuhp_cpufreq_online(unsigned int cpu) > > { > > - cpufreq_online(cpu); > > + if (!(cpufreq_driver->flags & CPUFREQ_DEFER_INIT_DURING_RESUME)) > > + cpufreq_online(cpu); > > This isn't correct as we can offline the CPUs without suspend as well > and cpufreq_online/offline should always be called in such cases. > Understood > Anyways, I have cc'd you on another series which may end up fixing > this problem as well. Sure, will have a look. -- Regards, Sudeep