Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2339304imj; Mon, 11 Feb 2019 00:48:09 -0800 (PST) X-Google-Smtp-Source: AHgI3IaloRBXav/0Hm2ZDCi2mImk+hSy/X0CaVym3HHnpd16nfJUjG3Fs1lffk17No3O6ibkxE9R X-Received: by 2002:a63:c0e:: with SMTP id b14mr7903116pgl.236.1549874888962; Mon, 11 Feb 2019 00:48:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549874888; cv=none; d=google.com; s=arc-20160816; b=gF3QSe1fZUM6PfdJzlwHtItGbRsOYTcYIn151Py1jTLZEI9d/klRj9kBQ1AyzBrWQC hiCe5pp3+wVNfEhU+szeSx81WEfzrlp4BH8NqKwXkopA7nmUUjtKq1e0h34UOH4Vq+Ju XJQ78wFG1jQRQK32f1+AAjaDQYl+1cKVxIoEHVZ7qp+KmgtQT+5hhzf+XrbpCtFoqHXl ms5lDFKmldmCNPVzLVStuQDTJMhSIhdY6KhNh2qWPyGq9yYtPBhn8RR9FaUxVgIjUCdG U0ONWTiCA1Eo8z4B4KXuOlMKttM+rGLQ1U3nYZ59wEgxcepbFv+icY6fXV9L9b+bI/nz ikJA== 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; bh=lKJkfvRf9vZMrT9r23qvKmpAYOOgMVXkF3jA/6qcIEw=; b=ooevetAaQkZzlyjRB2vcYsA9GvK/5c483hVAQ1kcwkoYuhgBe2yH6/4WsFZKarp/Io 9h9JkxBYsrU1T22KzUjsyx8I2avFOX8YxNiLz7AtXFeFTIzBVoGxbmnv7ZYeJTo6yxU9 PXM1XcoGrfAjsXHdGUZuMptikhk0dyjdJ/Rk9cIEY/myNlxeCO9gEJD/L323BACzqVgv 8CQhfiGCr5PXnEk1mBS5C6LNjaB/Q4IYLlwRzpalmlbcriZHoRmDz9W6VcL24EzjAm9p nKfUGO3WEgo06Pi0XWjVMD8xp279xUuGYNtNndvqiQfpcrsVZpe4Puu155oplCbtCD75 t4aQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zVaCHRjC; 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 v11si38400pgo.11.2019.02.11.00.47.53; Mon, 11 Feb 2019 00:48:08 -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; dkim=pass header.i=@linaro.org header.s=google header.b=zVaCHRjC; 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 S1726997AbfBKIrR (ORCPT + 99 others); Mon, 11 Feb 2019 03:47:17 -0500 Received: from mail-pl1-f195.google.com ([209.85.214.195]:43861 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725931AbfBKIrR (ORCPT ); Mon, 11 Feb 2019 03:47:17 -0500 Received: by mail-pl1-f195.google.com with SMTP id f90so4756718plb.10 for ; Mon, 11 Feb 2019 00:47:17 -0800 (PST) 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=lKJkfvRf9vZMrT9r23qvKmpAYOOgMVXkF3jA/6qcIEw=; b=zVaCHRjC3u5C92M1H48msWf5zOPUu7RuXY/ZnbtPCNUTSLGn4Ec5Zl1UknqpPLTf+B NvrlLk9M/U/kWwV/bbN6C21fiGpvZLGPowGXrNO1h647Txd/VRZ1+Zdx6u+cOJPH8adf 8tz1qphN8ucv7hl5LebdH1sUZ5PxxD71eJKHlRQFmWmiRI32NuqBjntB7eK0XRa7HDZz YGn+kzEutvULGlv/e61yQAHAIXsKTbshACVVqsRfvRRtvpK+nUVzxRjAaiRGx6qi+NdH UiaQy+Kft0pGOS9mnszHsdtV3VNmI+jdozogJoFwv8HDRt0RmLFojJnN3uQhCrK5wOxb NjXA== 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=lKJkfvRf9vZMrT9r23qvKmpAYOOgMVXkF3jA/6qcIEw=; b=NTd0dAAVOg29tP6QhIT+lo265iZj4FgCn50hwG6VxXD7GLCaRBMg+13fTTyzdIW/z0 2E8rnk1dNoH8L6N9NzbrBAJ4vhrmsYxLsKFPG31HKf3fE9dUWE+vbYfMJDx1eUYggOJ5 o3kjt8jm/TsOdpnzJ72i2eOGtOKgW59lZDPmQDFiruCWBp8O+6VWqfqUwhF4ci47Slsh zfFNGQphv9yPfFtfs4msCkNPUXKvCkNXdC8GEJWeZLrvOJPm7Ih+lTdsbon6rvzjRXSl ZcQvUKmRtgnvD98illoctIX6lw0yQoQIO5R3pTqan7f+9RVqpgr+uRXREFoffjuBxj1n xleg== X-Gm-Message-State: AHQUAuamxbvI7UY4BGYwiGWlXynQGt9iCnLcD5r3YBRLETno+ZUAw3Zf l3nIn8awTPXLkKiVVA7HG/dJyQ== X-Received: by 2002:a17:902:c05:: with SMTP id 5mr36554098pls.155.1549874836898; Mon, 11 Feb 2019 00:47:16 -0800 (PST) Received: from localhost ([122.172.102.63]) by smtp.gmail.com with ESMTPSA id f6sm16689612pfc.88.2019.02.11.00.47.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Feb 2019 00:47:16 -0800 (PST) Date: Mon, 11 Feb 2019 14:17:14 +0530 From: Viresh Kumar To: Sudeep Holla 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: <20190211084714.nq3wqxk66dbrfqvy@vireshk-i7> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190208174131.GB22401@e107155-lin> User-Agent: NeoMutt/20180323-120-3dd1ac Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 :) > + > cpufreq_suspended = true; > } > > @@ -1674,7 +1680,7 @@ void cpufreq_suspend(void) > void cpufreq_resume(void) > { > struct cpufreq_policy *policy; > - int ret; > + int ret, cpu; > > if (!cpufreq_driver) > return; > @@ -1682,6 +1688,11 @@ void cpufreq_resume(void) > if (unlikely(!cpufreq_suspended)) > return; > > + if (cpufreq_driver->flags & CPUFREQ_DEFER_INIT_DURING_RESUME) > + for_each_active_policy(policy) > + for_each_cpu(cpu, policy->cpus) > + cpufreq_online(cpu); > + > cpufreq_suspended = false; > > if (!has_target() && !cpufreq_driver->resume) > @@ -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. Anyways, I have cc'd you on another series which may end up fixing this problem as well. -- viresh