From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760500AbdEWBJv (ORCPT ); Mon, 22 May 2017 21:09:51 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:50522 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759123AbdEWBJt (ORCPT ); Mon, 22 May 2017 21:09:49 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org AACF5601CF Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=sboyd@codeaurora.org Date: Mon, 22 May 2017 18:09:47 -0700 From: Stephen Boyd To: Viresh Kumar Cc: Rafael Wysocki , Viresh Kumar , Nishanth Menon , linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Vincent Guittot Subject: Re: [PATCH 1/4] PM / OPP: Reorganize _generic_set_opp_regulator() Message-ID: <20170523010947.GI20170@codeaurora.org> References: <7b9df40efa69d646840c097c04c56c7f42f458c4.1494995911.git.viresh.kumar@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7b9df40efa69d646840c097c04c56c7f42f458c4.1494995911.git.viresh.kumar@linaro.org> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/17, Viresh Kumar wrote: > The code was overly complicated here because of the limitations that we > had with RCUs (Couldn't use opp-table and OPPs outside RCU protected > section and can't call sleep-able routines from within that). But that > is long gone now. > > Reorganize _generic_set_opp_regulator() in order to avoid using "struct > dev_pm_set_opp_data" and copying data into it for the case where > opp_table->set_opp is not set. > > Signed-off-by: Viresh Kumar > --- > drivers/base/power/opp/core.c | 73 ++++++++++++++++++++----------------------- > 1 file changed, 34 insertions(+), 39 deletions(-) > > diff --git a/drivers/base/power/opp/core.c b/drivers/base/power/opp/core.c > index dae61720b314..402b9e86d77c 100644 > --- a/drivers/base/power/opp/core.c > +++ b/drivers/base/power/opp/core.c > @@ -543,17 +543,18 @@ _generic_set_opp_clk_only(struct device *dev, struct clk *clk, > return ret; > } > > -static int _generic_set_opp(struct dev_pm_set_opp_data *data) > +static int _generic_set_opp_regulator(struct opp_table *opp_table, Can opp_table be const? > + struct device *dev, Maybe dev too, but that looks like a ripple effect so maybe in another patch. > + unsigned long old_freq, > + unsigned long freq, > + struct dev_pm_opp_supply *old_supply, > + struct dev_pm_opp_supply *new_supply) Otherwise Reviewed-by: Stephen Boyd -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project