public inbox for linux-serial@vger.kernel.org
 help / color / mirror / Atom feed
From: Praveen Talari <quic_ptalari@quicinc.com>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jirislaby@kernel.org>, Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Bjorn Andersson <andersson@kernel.org>,
	Konrad Dybcio <konradybcio@kernel.org>,
	Viresh Kumar <vireshk@kernel.org>, Nishanth Menon <nm@ti.com>,
	Stephen Boyd <sboyd@kernel.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	<linux-arm-msm@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<linux-serial@vger.kernel.org>, <devicetree@vger.kernel.org>,
	<linux-pm@vger.kernel.org>, <psodagud@quicinc.com>,
	<djaggi@quicinc.com>, <quic_msavaliy@quicinc.com>,
	<quic_vtanuku@quicinc.com>, <quic_arandive@quicinc.com>,
	<quic_mnaresh@quicinc.com>, <quic_shazhuss@quicinc.com>
Subject: Re: [PATCH v3 1/9] opp: add new helper API dev_pm_opp_set_level()
Date: Fri, 2 May 2025 13:07:33 +0530	[thread overview]
Message-ID: <e72aeda8-035d-4144-a9ce-ae276bca87bf@quicinc.com> (raw)
In-Reply-To: <20250502053758.utawzhq6famwenc2@vireshk-i7>

Hi Viresh

Thank you for review.

On 5/2/2025 11:07 AM, Viresh Kumar wrote:
> On 02-05-25, 08:40, Praveen Talari wrote:
>> To configure a device to a specific performance level, consumer drivers
>> currently need to determine the OPP based on the exact level and then
>> set it, resulting in code duplication across drivers.
>>
>> The new helper API, dev_pm_opp_set_level(), addresses this issue by
>> providing a streamlined method for consumer drivers to find and set the
>> OPP based on the desired performance level, thereby eliminating
>> redundancy.
>>
>> Signed-off-by: Praveen Talari <quic_ptalari@quicinc.com>
>>
>> v2 -> v3
>> - moved function defination to pm_opp.h from core.c with inline
>> - updated return value with IS_ERR(opp)
>>
>> v1 -> v2
>> - reorder sequence of tags in commit text
> As Trilok mentioned, this is not the right place for this.
>
>> ---
>>   include/linux/pm_opp.h | 27 +++++++++++++++++++++++++++
>>   1 file changed, 27 insertions(+)
>>
>> diff --git a/include/linux/pm_opp.h b/include/linux/pm_opp.h
>> index e7b5c602c92f..31ed8a7b554e 100644
>> --- a/include/linux/pm_opp.h
>> +++ b/include/linux/pm_opp.h
>> @@ -197,6 +197,28 @@ int dev_pm_opp_get_sharing_cpus(struct device *cpu_dev, struct cpumask *cpumask)
>>   void dev_pm_opp_remove_table(struct device *dev);
>>   void dev_pm_opp_cpumask_remove_table(const struct cpumask *cpumask);
>>   int dev_pm_opp_sync_regulators(struct device *dev);
>> +
>> +/*
>> + * dev_pm_opp_set_level() - Configure device for a level
>> + * @dev: device for which we do this operation
>> + * @level: level to set to
>> + *
>> + * Return: 0 on success, a non-zero value if there is an error otherwise.
>> + */
> No need of these for simple wrappers.
>
>> +static inline int dev_pm_opp_set_level(struct device *dev, unsigned int level)
>> +{
>> +	struct dev_pm_opp *opp = dev_pm_opp_find_level_exact(dev, level);
>> +	int ret;
>> +
>> +	if (IS_ERR(opp))
>> +		return IS_ERR(opp);
> IS_ERR is wrong here, should be PTR_ERR.
>
>> +
>> +	ret = dev_pm_opp_set_opp(dev, opp);
>> +	dev_pm_opp_put(opp);
>> +
>> +	return ret;
>> +}
>> +
>>   #else
>>   static inline struct opp_table *dev_pm_opp_get_opp_table(struct device *dev)
>>   {
>> @@ -461,6 +483,11 @@ static inline int dev_pm_opp_sync_regulators(struct device *dev)
>>   	return -EOPNOTSUPP;
>>   }
>>   
>> +static inline int dev_pm_opp_set_level(struct device *dev, unsigned int level)
>> +{
>> +	return -EOPNOTSUPP;
>> +}
>> +
> No need of these too for such wrappers. And then this isn't rebased
How come? i have synced  linux-next today itself and pushed from it, 
even i didn't face any issue.
Let me know how/where rebased i.e linux-next or linux?
> over latest changes in the OPP core.
>
> I modified it and applied the below version to my tree now.
>

  reply	other threads:[~2025-05-02  7:37 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-02  3:10 [PATCH v3 0/9] Enable QUPs and Serial on SA8255p Qualcomm platforms Praveen Talari
2025-05-02  3:10 ` [PATCH v3 1/9] opp: add new helper API dev_pm_opp_set_level() Praveen Talari
2025-05-02  3:49   ` Trilok Soni
2025-05-02  5:37   ` Viresh Kumar
2025-05-02  7:37     ` Praveen Talari [this message]
2025-05-02  7:45       ` Viresh Kumar
2025-05-02  8:01     ` Praveen Talari
2025-05-02  8:14       ` Viresh Kumar
2025-05-02 14:01         ` Praveen Talari
2025-05-02 14:11           ` Viresh Kumar
2025-05-02 14:39             ` Praveen Talari
2025-05-02  3:10 ` [PATCH v3 2/9] dt-bindings: serial: describe SA8255p Praveen Talari
2025-05-02  3:49   ` Trilok Soni
2025-05-02  6:36   ` Krzysztof Kozlowski
2025-05-02  3:10 ` [PATCH v3 3/9] dt-bindings: qcom: geni-se: " Praveen Talari
2025-05-02  6:37   ` Krzysztof Kozlowski
2025-05-02  8:07     ` Praveen Talari
2025-05-02  3:10 ` [PATCH v3 4/9] soc: qcom: geni-se: Enable QUPs on SA8255p Qualcomm platforms Praveen Talari
2025-05-02  9:28   ` neil.armstrong
2025-05-07  5:49   ` kernel test robot
2025-05-02  3:10 ` [PATCH v3 5/9] serial: qcom-geni: move resource initialization to separate function Praveen Talari
2025-05-02  3:10 ` [PATCH v3 6/9] serial: qcom-geni: move resource control logic to separate functions Praveen Talari
2025-05-02  3:10 ` [PATCH v3 7/9] serial: qcom-geni: move clock-rate logic to separate function Praveen Talari
2025-05-02  3:10 ` [PATCH v3 8/9] serial: qcom-geni: Enable PM runtime for serial driver Praveen Talari
2025-05-07  7:58   ` kernel test robot
2025-05-02  3:10 ` [PATCH v3 9/9] serial: qcom-geni: Enable Serial on SA8255p Qualcomm platforms Praveen Talari
2025-05-02  9:24   ` neil.armstrong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e72aeda8-035d-4144-a9ce-ae276bca87bf@quicinc.com \
    --to=quic_ptalari@quicinc.com \
    --cc=andersson@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=djaggi@quicinc.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jirislaby@kernel.org \
    --cc=konradybcio@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=nm@ti.com \
    --cc=psodagud@quicinc.com \
    --cc=quic_arandive@quicinc.com \
    --cc=quic_mnaresh@quicinc.com \
    --cc=quic_msavaliy@quicinc.com \
    --cc=quic_shazhuss@quicinc.com \
    --cc=quic_vtanuku@quicinc.com \
    --cc=rafael@kernel.org \
    --cc=robh@kernel.org \
    --cc=sboyd@kernel.org \
    --cc=viresh.kumar@linaro.org \
    --cc=vireshk@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox