From: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
To: Bjorn Andersson <quic_bjorande@quicinc.com>,
Rob Clark <robdclark@gmail.com>,
Abhinav Kumar <quic_abhinavk@quicinc.com>,
Kuogee Hsieh <quic_khsieh@quicinc.com>
Cc: Johan Hovold <johan+linaro@kernel.org>,
Vinod Polimera <quic_vpolimer@quicinc.com>,
Sankeerth Billakanti <quic_sbillaka@quicinc.com>,
linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org,
dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org
Subject: Re: [PATCH 2/3] drm/msm/dp: Clean up logs dp_power module
Date: Sat, 20 May 2023 04:20:20 +0300 [thread overview]
Message-ID: <3a5d2a34-bdc3-ac64-f69a-c7d99ff2f275@linaro.org> (raw)
In-Reply-To: <20230515030256.300104-2-quic_bjorande@quicinc.com>
On 15/05/2023 06:02, Bjorn Andersson wrote:
> The clk_bulk API already provides error messages indicating which
> specific clock in the request for which the operation failed, further
> more these errors are associated with the specific DisplayPort
> controller (rather than the shared drm_device). The additional error
> messages int he dp_power module does thereby not provide any benefit.
>
> While at it, none of the dp_power handles passed to these functions are
> dynamic in nature, so there should not be any need for runtime checking
> them. Drop these as well.
It might have been slightly better to have this split into two patches,
but as this is a debug/logs only, it's fine with me.
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
>
> Signed-off-by: Bjorn Andersson <quic_bjorande@quicinc.com>
> ---
> drivers/gpu/drm/msm/dp/dp_power.c | 62 +++++--------------------------
> 1 file changed, 9 insertions(+), 53 deletions(-)
>
> diff --git a/drivers/gpu/drm/msm/dp/dp_power.c b/drivers/gpu/drm/msm/dp/dp_power.c
> index c0aaabb03389..031d2eefef07 100644
> --- a/drivers/gpu/drm/msm/dp/dp_power.c
> +++ b/drivers/gpu/drm/msm/dp/dp_power.c
> @@ -35,25 +35,16 @@ static int dp_power_clk_init(struct dp_power_private *power)
> stream = &power->parser->mp[DP_STREAM_PM];
>
> rc = devm_clk_bulk_get(dev, core->num_clk, core->clocks);
> - if (rc) {
> - DRM_ERROR("failed to get %s clk. err=%d\n",
> - dp_parser_pm_name(DP_CORE_PM), rc);
> + if (rc)
> return rc;
> - }
>
> rc = devm_clk_bulk_get(dev, ctrl->num_clk, ctrl->clocks);
> - if (rc) {
> - DRM_ERROR("failed to get %s clk. err=%d\n",
> - dp_parser_pm_name(DP_CTRL_PM), rc);
> + if (rc)
> return -ENODEV;
> - }
>
> rc = devm_clk_bulk_get(dev, stream->num_clk, stream->clocks);
> - if (rc) {
> - DRM_ERROR("failed to get %s clk. err=%d\n",
> - dp_parser_pm_name(DP_CTRL_PM), rc);
> + if (rc)
> return -ENODEV;
> - }
>
> return 0;
> }
> @@ -121,11 +112,9 @@ int dp_power_clk_enable(struct dp_power *dp_power,
> mp = &power->parser->mp[DP_CORE_PM];
>
> rc = clk_bulk_prepare_enable(mp->num_clk, mp->clocks);
> - if (rc) {
> - DRM_ERROR("fail to enable clks: %s. err=%d\n",
> - dp_parser_pm_name(DP_CORE_PM), rc);
> + if (rc)
> return rc;
> - }
> +
> dp_power->core_clks_on = true;
> }
> }
> @@ -133,10 +122,8 @@ int dp_power_clk_enable(struct dp_power *dp_power,
> mp = &power->parser->mp[pm_type];
> if (enable) {
> rc = clk_bulk_prepare_enable(mp->num_clk, mp->clocks);
> - if (rc) {
> - DRM_ERROR("failed to enable clks, err: %d\n", rc);
> + if (rc)
> return rc;
> - }
> } else {
> clk_bulk_disable_unprepare(mp->num_clk, mp->clocks);
> }
> @@ -162,34 +149,19 @@ int dp_power_clk_enable(struct dp_power *dp_power,
>
> int dp_power_client_init(struct dp_power *dp_power)
> {
> - int rc = 0;
> struct dp_power_private *power;
>
> - if (!dp_power) {
> - DRM_ERROR("invalid power data\n");
> - return -EINVAL;
> - }
> -
> power = container_of(dp_power, struct dp_power_private, dp_power);
>
> pm_runtime_enable(&power->pdev->dev);
>
> - rc = dp_power_clk_init(power);
> - if (rc)
> - DRM_ERROR("failed to init clocks %d\n", rc);
> -
> - return rc;
> + return dp_power_clk_init(power);
> }
>
> void dp_power_client_deinit(struct dp_power *dp_power)
> {
> struct dp_power_private *power;
>
> - if (!dp_power) {
> - DRM_ERROR("invalid power data\n");
> - return;
> - }
> -
> power = container_of(dp_power, struct dp_power_private, dp_power);
>
> pm_runtime_disable(&power->pdev->dev);
> @@ -200,25 +172,14 @@ int dp_power_init(struct dp_power *dp_power, bool flip)
> int rc = 0;
> struct dp_power_private *power = NULL;
>
> - if (!dp_power) {
> - DRM_ERROR("invalid power data\n");
> - return -EINVAL;
> - }
> -
> power = container_of(dp_power, struct dp_power_private, dp_power);
>
> pm_runtime_get_sync(&power->pdev->dev);
>
> rc = dp_power_clk_enable(dp_power, DP_CORE_PM, true);
> - if (rc) {
> - DRM_ERROR("failed to enable DP core clocks, %d\n", rc);
> - goto exit;
> - }
> -
> - return 0;
> + if (rc)
> + pm_runtime_put_sync(&power->pdev->dev);
>
> -exit:
> - pm_runtime_put_sync(&power->pdev->dev);
> return rc;
> }
>
> @@ -238,11 +199,6 @@ struct dp_power *dp_power_get(struct device *dev, struct dp_parser *parser)
> struct dp_power_private *power;
> struct dp_power *dp_power;
>
> - if (!parser) {
> - DRM_ERROR("invalid input\n");
> - return ERR_PTR(-EINVAL);
> - }
> -
> power = devm_kzalloc(&parser->pdev->dev, sizeof(*power), GFP_KERNEL);
> if (!power)
> return ERR_PTR(-ENOMEM);
--
With best wishes
Dmitry
next prev parent reply other threads:[~2023-05-20 1:20 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-15 3:02 [PATCH 1/3] drm/msm/dp: Drop now unused dp_hpd module Bjorn Andersson
2023-05-15 3:02 ` [PATCH 2/3] drm/msm/dp: Clean up logs dp_power module Bjorn Andersson
2023-05-20 1:20 ` Dmitry Baryshkov [this message]
2023-05-15 3:02 ` [PATCH 3/3] drm/msm/dp: Clean up pdev/dev duplication in dp_power Bjorn Andersson
2023-05-20 1:26 ` Dmitry Baryshkov
2023-05-21 3:53 ` Bjorn Andersson
2023-06-04 1:47 ` Dmitry Baryshkov
2023-05-20 1:18 ` [PATCH 1/3] drm/msm/dp: Drop now unused dp_hpd module Dmitry Baryshkov
2023-06-04 3:01 ` Dmitry Baryshkov
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=3a5d2a34-bdc3-ac64-f69a-c7d99ff2f275@linaro.org \
--to=dmitry.baryshkov@linaro.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=freedreno@lists.freedesktop.org \
--cc=johan+linaro@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=quic_abhinavk@quicinc.com \
--cc=quic_bjorande@quicinc.com \
--cc=quic_khsieh@quicinc.com \
--cc=quic_sbillaka@quicinc.com \
--cc=quic_vpolimer@quicinc.com \
--cc=robdclark@gmail.com \
/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®