From mboxrd@z Thu Jan 1 00:00:00 1970 From: Viresh Kumar Subject: Re: [PATCH 2/2] cpufreq: cpu0: Extend support beyond CPU0 Date: Fri, 27 Jun 2014 07:56:39 +0530 Message-ID: References: <53AB1CC1.4010907@codeaurora.org> <53ACB568.4000903@codeaurora.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: Received: from mail-ob0-f172.google.com ([209.85.214.172]:52553 "EHLO mail-ob0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751406AbaF0C0k (ORCPT ); Thu, 26 Jun 2014 22:26:40 -0400 Received: by mail-ob0-f172.google.com with SMTP id uy5so4961154obc.31 for ; Thu, 26 Jun 2014 19:26:39 -0700 (PDT) In-Reply-To: <53ACB568.4000903@codeaurora.org> Sender: linux-arm-msm-owner@vger.kernel.org List-Id: linux-arm-msm@vger.kernel.org To: Stephen Boyd Cc: "Rafael J. Wysocki" , Shawn Guo , Lists linaro-kernel , "linux-pm@vger.kernel.org" , Linux Kernel Mailing List , Arvind Chauhan , Mike Turquette , "linux-arm-kernel@lists.infradead.org" , linux-arm-msm@vger.kernel.org, Sachin Kamat , Thomas P Abraham , Nishanth Menon , Tomasz Figa , Mark Brown , Mark Rutland On 27 June 2014 05:36, Stephen Boyd wrote: > I gave it a spin. It looks mostly good except for the infinite loop: Great !! > diff --git a/drivers/cpufreq/cpufreq-cpu0.c b/drivers/cpufreq/cpufreq-cpu0.c > index b7ee67c4d1c0..6744321ae33d 100644 > --- a/drivers/cpufreq/cpufreq-cpu0.c > +++ b/drivers/cpufreq/cpufreq-cpu0.c > @@ -138,8 +138,10 @@ try_again: > } > > /* Try with "cpu-supply" */ > - if (reg == reg_cpu0) > + if (reg == reg_cpu0) { > + reg = reg_cpu; > goto try_again; > + } > > dev_warn(cpu_dev, "failed to get cpu%d regulator: %ld\n", > cpu, PTR_ERR(cpu_reg)); Awesome code, I wrote it. Thanks for fixing it. > and I think we just want reg_cpu to be "cpu", not "cpu-supply" because I > think the regulator core adds in the "-supply" part already. Okay. > After fixing that I can get cpufreq going. I'm currently working on > populating the OPPs at runtime without relying on DT. So eventually I'll > need this patch: I see.. > diff --git a/drivers/cpufreq/cpufreq-cpu0.c b/drivers/cpufreq/cpufreq-cpu0.c > index b7ee67c4d1c0..6744321ae33d 100644 > --- a/drivers/cpufreq/cpufreq-cpu0.c > +++ b/drivers/cpufreq/cpufreq-cpu0.c > @@ -239,11 +241,6 @@ static int cpu0_cpufreq_init(struct cpufreq_policy *policy) > } > > ret = of_init_opp_table(cpu_dev); > - if (ret) { > - dev_err(cpu_dev, "failed to init OPP table: %d\n", ret); > - goto out_put_node; > - } > - > ret = dev_pm_opp_init_cpufreq_table(cpu_dev, &freq_table); > if (ret) { > dev_err(cpu_dev, "failed to init cpufreq table: %d\n", ret); > > which I hope is ok. I need to see details of these routines once again, but will surely make it work for you. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752397AbaF0C0m (ORCPT ); Thu, 26 Jun 2014 22:26:42 -0400 Received: from mail-ob0-f172.google.com ([209.85.214.172]:38701 "EHLO mail-ob0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751178AbaF0C0k (ORCPT ); Thu, 26 Jun 2014 22:26:40 -0400 MIME-Version: 1.0 In-Reply-To: <53ACB568.4000903@codeaurora.org> References: <53AB1CC1.4010907@codeaurora.org> <53ACB568.4000903@codeaurora.org> Date: Fri, 27 Jun 2014 07:56:39 +0530 Message-ID: Subject: Re: [PATCH 2/2] cpufreq: cpu0: Extend support beyond CPU0 From: Viresh Kumar To: Stephen Boyd Cc: "Rafael J. Wysocki" , Shawn Guo , Lists linaro-kernel , "linux-pm@vger.kernel.org" , Linux Kernel Mailing List , Arvind Chauhan , Mike Turquette , "linux-arm-kernel@lists.infradead.org" , linux-arm-msm@vger.kernel.org, Sachin Kamat , Thomas P Abraham , Nishanth Menon , Tomasz Figa , Mark Brown , Mark Rutland Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 27 June 2014 05:36, Stephen Boyd wrote: > I gave it a spin. It looks mostly good except for the infinite loop: Great !! > diff --git a/drivers/cpufreq/cpufreq-cpu0.c b/drivers/cpufreq/cpufreq-cpu0.c > index b7ee67c4d1c0..6744321ae33d 100644 > --- a/drivers/cpufreq/cpufreq-cpu0.c > +++ b/drivers/cpufreq/cpufreq-cpu0.c > @@ -138,8 +138,10 @@ try_again: > } > > /* Try with "cpu-supply" */ > - if (reg == reg_cpu0) > + if (reg == reg_cpu0) { > + reg = reg_cpu; > goto try_again; > + } > > dev_warn(cpu_dev, "failed to get cpu%d regulator: %ld\n", > cpu, PTR_ERR(cpu_reg)); Awesome code, I wrote it. Thanks for fixing it. > and I think we just want reg_cpu to be "cpu", not "cpu-supply" because I > think the regulator core adds in the "-supply" part already. Okay. > After fixing that I can get cpufreq going. I'm currently working on > populating the OPPs at runtime without relying on DT. So eventually I'll > need this patch: I see.. > diff --git a/drivers/cpufreq/cpufreq-cpu0.c b/drivers/cpufreq/cpufreq-cpu0.c > index b7ee67c4d1c0..6744321ae33d 100644 > --- a/drivers/cpufreq/cpufreq-cpu0.c > +++ b/drivers/cpufreq/cpufreq-cpu0.c > @@ -239,11 +241,6 @@ static int cpu0_cpufreq_init(struct cpufreq_policy *policy) > } > > ret = of_init_opp_table(cpu_dev); > - if (ret) { > - dev_err(cpu_dev, "failed to init OPP table: %d\n", ret); > - goto out_put_node; > - } > - > ret = dev_pm_opp_init_cpufreq_table(cpu_dev, &freq_table); > if (ret) { > dev_err(cpu_dev, "failed to init cpufreq table: %d\n", ret); > > which I hope is ok. I need to see details of these routines once again, but will surely make it work for you. From mboxrd@z Thu Jan 1 00:00:00 1970 From: viresh.kumar@linaro.org (Viresh Kumar) Date: Fri, 27 Jun 2014 07:56:39 +0530 Subject: [PATCH 2/2] cpufreq: cpu0: Extend support beyond CPU0 In-Reply-To: <53ACB568.4000903@codeaurora.org> References: <53AB1CC1.4010907@codeaurora.org> <53ACB568.4000903@codeaurora.org> Message-ID: To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On 27 June 2014 05:36, Stephen Boyd wrote: > I gave it a spin. It looks mostly good except for the infinite loop: Great !! > diff --git a/drivers/cpufreq/cpufreq-cpu0.c b/drivers/cpufreq/cpufreq-cpu0.c > index b7ee67c4d1c0..6744321ae33d 100644 > --- a/drivers/cpufreq/cpufreq-cpu0.c > +++ b/drivers/cpufreq/cpufreq-cpu0.c > @@ -138,8 +138,10 @@ try_again: > } > > /* Try with "cpu-supply" */ > - if (reg == reg_cpu0) > + if (reg == reg_cpu0) { > + reg = reg_cpu; > goto try_again; > + } > > dev_warn(cpu_dev, "failed to get cpu%d regulator: %ld\n", > cpu, PTR_ERR(cpu_reg)); Awesome code, I wrote it. Thanks for fixing it. > and I think we just want reg_cpu to be "cpu", not "cpu-supply" because I > think the regulator core adds in the "-supply" part already. Okay. > After fixing that I can get cpufreq going. I'm currently working on > populating the OPPs at runtime without relying on DT. So eventually I'll > need this patch: I see.. > diff --git a/drivers/cpufreq/cpufreq-cpu0.c b/drivers/cpufreq/cpufreq-cpu0.c > index b7ee67c4d1c0..6744321ae33d 100644 > --- a/drivers/cpufreq/cpufreq-cpu0.c > +++ b/drivers/cpufreq/cpufreq-cpu0.c > @@ -239,11 +241,6 @@ static int cpu0_cpufreq_init(struct cpufreq_policy *policy) > } > > ret = of_init_opp_table(cpu_dev); > - if (ret) { > - dev_err(cpu_dev, "failed to init OPP table: %d\n", ret); > - goto out_put_node; > - } > - > ret = dev_pm_opp_init_cpufreq_table(cpu_dev, &freq_table); > if (ret) { > dev_err(cpu_dev, "failed to init cpufreq table: %d\n", ret); > > which I hope is ok. I need to see details of these routines once again, but will surely make it work for you.