Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp880643imm; Wed, 19 Sep 2018 08:20:50 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZOJzlNU7LPA7MFRzeUAUXXOpd4T+mQOW8ow/JYIi1OjxNU637FnPEOvcS+GRFMS733KZZN X-Received: by 2002:a63:5964:: with SMTP id j36-v6mr32643689pgm.222.1537370450459; Wed, 19 Sep 2018 08:20:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537370450; cv=none; d=google.com; s=arc-20160816; b=nfaNBmo0BHTcd+C+m14Ac05AZagTT6sLjMwKjdhfIIF9/1kcPWmDxiI2J467YubSrL /lAZhq8weLOC+6eqDckFDYJKf2HJjsS5epArtdqiopo01WYoIbt2SvJ+Qa5AUJsdV++g M0wah98KXM8SN2B0tUPVXVKLj7FxE6TK4TTDM+dkIdMrC1P6+biVaNmARma+qLrbVR6S 3AofXf5PQOF0O3jKyXOuUxd0lklTrB6u73HbA/H64DB+s/oUqL0eJEFvfb4sDcxnaX9T nF1d9NAfWc6EWystFEYnHH8fnNqYiTwuVQUftmOcB275irgNWVr8rpubelo3nw5gF2Mj jFDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from; bh=u7knQx3hBMPxvuVY6sw7wqPQmXlboVcAyfObQMJz/U4=; b=G2FI6SKO7BETwXaBAy4h+3W6Z6RVQvDvlGD4xtThYYuOdNHJTcitc+QBpxi/Z68Xnv 4qGukeu/Z5vaxVddYFAFNPoKm/+efqWr6776zaEuby0qoUENvDKdUtWqZ4CIcOKHkmps QSOw+iyDtvzKa3zOqsoa+RHapO84ea0p/pDsldxwss00QxFO2HiNuny/2O89VQAMlSbi wcRtdSt/v5m75FgVm5apzkqKkHfRzcokw2Kcx/bgQJOk6uo7xELVN54mrh1J1ThBKwDU JpQUhwbEGlhYTSPAOJdH+GbDNm91IV/eGwHCp90nntjp/WTrZBWtxT0aElZDjnlhllnq w3xA== 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 s10-v6si21031841pgh.6.2018.09.19.08.20.33; Wed, 19 Sep 2018 08:20:50 -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 S1732267AbeISU6w (ORCPT + 99 others); Wed, 19 Sep 2018 16:58:52 -0400 Received: from mail.bootlin.com ([62.4.15.54]:54426 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728054AbeISU6w (ORCPT ); Wed, 19 Sep 2018 16:58:52 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id 932BC206EE; Wed, 19 Sep 2018 17:20:25 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost (242.171.71.37.rev.sfr.net [37.71.171.242]) by mail.bootlin.com (Postfix) with ESMTPSA id 64333206EE; Wed, 19 Sep 2018 17:20:15 +0200 (CEST) From: Gregory CLEMENT To: Viresh Kumar Cc: niklas.cassel@linaro.org, Jason Cooper , Andrew Lunn , Sebastian Hesselbarth , "Rafael J. Wysocki" , linux-pm@vger.kernel.org, Stephen Boyd , Nishanth Menon , Vincent Guittot , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 07/11] cpufreq: mvebu: Remove OPPs using dev_pm_opp_remove() References: Date: Wed, 19 Sep 2018 17:20:16 +0200 In-Reply-To: (Viresh Kumar's message of "Wed, 12 Sep 2018 13:58:46 +0530") Message-ID: <87o9ctjyz3.fsf@bootlin.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Viresh, On mer., sept. 12 2018, Viresh Kumar wrote: > dev_pm_opp_cpumask_remove_table() is going to change in the next commit > and will not remove dynamic OPPs automatically. They must be removed > with a call to dev_pm_opp_remove(). So now that mean when adding more than 2 OPPs, we should have the list of them available in the driver to be able to remove them, right? > Signed-off-by: Viresh Kumar Reviewed-by: Gregory CLEMENT Gregory > --- > drivers/cpufreq/mvebu-cpufreq.c | 9 ++------- > 1 file changed, 2 insertions(+), 7 deletions(-) > > diff --git a/drivers/cpufreq/mvebu-cpufreq.c b/drivers/cpufreq/mvebu-cpufreq.c > index 31513bd42705..6d33a639f902 100644 > --- a/drivers/cpufreq/mvebu-cpufreq.c > +++ b/drivers/cpufreq/mvebu-cpufreq.c > @@ -84,9 +84,10 @@ static int __init armada_xp_pmsu_cpufreq_init(void) > > ret = dev_pm_opp_add(cpu_dev, clk_get_rate(clk) / 2, 0); > if (ret) { > + dev_pm_opp_remove(cpu_dev, clk_get_rate(clk)); > clk_put(clk); > dev_err(cpu_dev, "Failed to register OPPs\n"); > - goto opp_register_failed; > + return ret; > } > > ret = dev_pm_opp_set_sharing_cpus(cpu_dev, > @@ -99,11 +100,5 @@ static int __init armada_xp_pmsu_cpufreq_init(void) > > platform_device_register_simple("cpufreq-dt", -1, NULL, 0); > return 0; > - > -opp_register_failed: > - /* As registering has failed remove all the opp for all cpus */ > - dev_pm_opp_cpumask_remove_table(cpu_possible_mask); > - > - return ret; > } > device_initcall(armada_xp_pmsu_cpufreq_init); > -- > 2.18.0.rc1.242.g61856ae69a2c > -- Gregory Clement, Bootlin Embedded Linux and Kernel engineering http://bootlin.com