From: Pavan Kondeti <quic_pkondeti@quicinc.com>
To: Krishna chaitanya chundru <quic_krichai@quicinc.com>
Cc: <manivannan.sadhasivam@linaro.org>, <helgaas@kernel.org>,
<linux-pci@vger.kernel.org>, <linux-arm-msm@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, <quic_vbadigan@quicinc.com>,
<quic_nitegupt@quicinc.com>, <quic_skananth@quicinc.com>,
<quic_ramkri@quicinc.com>, <quic_parass@quicinc.com>,
<krzysztof.kozlowski@linaro.org>,
Viresh Kumar <vireshk@kernel.org>, "Nishanth Menon" <nm@ti.com>,
Stephen Boyd <sboyd@kernel.org>,
"Rafael J. Wysocki" <rafael@kernel.org>,
"open list:OPERATING PERFORMANCE POINTS (OPP)"
<linux-pm@vger.kernel.org>
Subject: Re: [PATCH v4 3/4] OPP: Add api to retrieve opps which is at most the provided level
Date: Wed, 23 Aug 2023 06:35:51 +0530 [thread overview]
Message-ID: <20c40635-0ad9-4de3-b18b-ccbcc2fd3779@quicinc.com> (raw)
In-Reply-To: <1692717141-32743-4-git-send-email-quic_krichai@quicinc.com>
On Tue, Aug 22, 2023 at 08:42:20PM +0530, Krishna chaitanya chundru wrote:
> Add dev_pm_opp_find_level_floor() for searching a lesser match or
> operating on OPP in the order of decreasing level.
>
"OPP: Add api to retrieve opps which is at most the provided level". Pls
change this to "opp: Add dev_pm_opp_find_level_floor()". The API name
conveys the message.
In the description, you can give a use case. i.e voting for the max
level during initialization of a driver.
> Signed-off-by: Krishna chaitanya chundru <quic_krichai@quicinc.com>
> ---
> drivers/opp/core.c | 26 ++++++++++++++++++++++++++
> include/linux/pm_opp.h | 4 ++++
> 2 files changed, 30 insertions(+)
>
> diff --git a/drivers/opp/core.c b/drivers/opp/core.c
> index 954c948..e668cf2 100644
> --- a/drivers/opp/core.c
> +++ b/drivers/opp/core.c
> @@ -727,6 +727,32 @@ struct dev_pm_opp *dev_pm_opp_find_level_ceil(struct device *dev,
> }
> EXPORT_SYMBOL_GPL(dev_pm_opp_find_level_ceil);
>
> +
> +/**
> + * dev_pm_opp_find_level_floor() - Search for a rounded floor freq
> + * @dev: device for which we do this operation
> + * @freq: Start level
> + *
%s/freq/level
Run make W=1 so that kerneldoc is tested.
> + * Search for the matching floor *available* OPP from a starting level
> + * for a device.
> + *
> + * Return: matching *opp and refreshes *level accordingly, else returns
> + * ERR_PTR in case of error and should be handled using IS_ERR. Error return
> + * values can be:
What do you mean by refresh here?
> + * EINVAL: for bad pointer
> + * ERANGE: no match found for search
> + * ENODEV: if device not found in list of registered devices
> + *
> + * The callers are required to call dev_pm_opp_put() for the returned OPP after
> + * use.
> + */
> +struct dev_pm_opp *dev_pm_opp_find_level_floor(struct device *dev,
> + unsigned long *level)
> +{
> + return _find_key_floor(dev, level, 0, true, _read_level, NULL);
> +}
> +EXPORT_SYMBOL_GPL(dev_pm_opp_find_level_floor);
> +
> /**
> * dev_pm_opp_find_bw_ceil() - Search for a rounded ceil bandwidth
> * @dev: device for which we do this operation
> diff --git a/include/linux/pm_opp.h b/include/linux/pm_opp.h
> index dc1fb58..a3bc386 100644
> --- a/include/linux/pm_opp.h
> +++ b/include/linux/pm_opp.h
> @@ -128,6 +128,8 @@ struct dev_pm_opp *dev_pm_opp_find_level_exact(struct device *dev,
> unsigned int level);
> struct dev_pm_opp *dev_pm_opp_find_level_ceil(struct device *dev,
> unsigned int *level);
> +struct dev_pm_opp *dev_pm_opp_find_level_floor(struct device *dev,
> + unsigned long *level);
>
> struct dev_pm_opp *dev_pm_opp_find_freq_ceil(struct device *dev,
> unsigned long *freq);
> @@ -285,6 +287,8 @@ static inline struct dev_pm_opp *dev_pm_opp_find_bw_ceil(struct device *dev,
>
> static inline struct dev_pm_opp *dev_pm_opp_find_bw_floor(struct device *dev,
> unsigned int *bw, int index)
> +static inline struct dev_pm_opp *dev_pm_opp_find_level_floor(struct device *dev,
> + unsigned long *level)
> {
> return ERR_PTR(-EOPNOTSUPP);
> }
>
Please run ./scripts/checkpatch.pl --strict <your patch> and fix the
indentation warnings from this patch.
Thanks,
Pavan
next prev parent reply other threads:[~2023-08-23 1:06 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-22 15:12 [PATCH v4 0/4] PCI: qcom: Add support for OPP Krishna chaitanya chundru
2023-08-22 15:12 ` [PATCH v4 1/4] dt-bindings: pci: qcom: Add opp table Krishna chaitanya chundru
2023-08-22 16:06 ` Konrad Dybcio
2023-09-07 6:01 ` Krishna Chaitanya Chundru
2023-08-23 6:25 ` Manivannan Sadhasivam
2023-08-22 15:12 ` [PATCH v4 2/4] arm64: dts: qcom: sm8450: Add opp table support to PCIe Krishna chaitanya chundru
2023-08-22 15:12 ` [PATCH v4 3/4] OPP: Add api to retrieve opps which is at most the provided level Krishna chaitanya chundru
2023-08-22 21:33 ` kernel test robot
2023-08-22 23:10 ` kernel test robot
2023-08-22 23:42 ` kernel test robot
2023-08-23 0:48 ` kernel test robot
2023-08-23 1:05 ` Pavan Kondeti [this message]
2023-09-07 6:04 ` Krishna Chaitanya Chundru
2023-08-23 1:13 ` kernel test robot
2023-08-22 15:12 ` [PATCH v4 4/4] PCI: qcom: Add OPP support for speed based performance state of RPMH Krishna chaitanya chundru
2023-08-23 7:06 ` Manivannan Sadhasivam
2023-09-07 6:05 ` Krishna Chaitanya Chundru
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=20c40635-0ad9-4de3-b18b-ccbcc2fd3779@quicinc.com \
--to=quic_pkondeti@quicinc.com \
--cc=helgaas@kernel.org \
--cc=krzysztof.kozlowski@linaro.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=manivannan.sadhasivam@linaro.org \
--cc=nm@ti.com \
--cc=quic_krichai@quicinc.com \
--cc=quic_nitegupt@quicinc.com \
--cc=quic_parass@quicinc.com \
--cc=quic_ramkri@quicinc.com \
--cc=quic_skananth@quicinc.com \
--cc=quic_vbadigan@quicinc.com \
--cc=rafael@kernel.org \
--cc=sboyd@kernel.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
all inboxes | Powered by JetHome®