From: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
To: Konrad Dybcio <konrad.dybcio@linaro.org>,
Rob Clark <robdclark@gmail.com>, Sean Paul <sean@poorly.run>,
Abhinav Kumar <quic_abhinavk@quicinc.com>,
Marijn Suijten <marijn.suijten@somainline.org>
Cc: Stephen Boyd <swboyd@chromium.org>,
David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>,
Bjorn Andersson <andersson@kernel.org>,
linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org,
freedreno@lists.freedesktop.org
Subject: Re: [PATCH 01/13] drm/msm/dpu: cleanup dpu_kms_hw_init error path
Date: Sat, 8 Jul 2023 02:48:52 +0300 [thread overview]
Message-ID: <cc312e51-e0c0-c1f9-aa56-60cf95e23b79@linaro.org> (raw)
In-Reply-To: <81ff3de5-4fe4-9c01-5655-78f5311f7817@linaro.org>
On 08/07/2023 02:25, Konrad Dybcio wrote:
> On 7.07.2023 22:37, Dmitry Baryshkov wrote:
>> It was noticed that dpu_kms_hw_init()'s error path contains several
>> labels which point to the same code path. Replace all of them with a
>> single label.
>>
>> Suggested-by: Konrad Dybcio <konrad.dybcio@linaro.org>
> it's the first time I'm seeing this code
>
It is Suggested-by, not something else. And you pointed it out in
https://lore.kernel.org/linux-arm-msm/6d598438-f10f-8678-7878-829b8b3ae790@linaro.org/
> Konrad
>> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
>> ---
>> drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 21 +++++++++------------
>> 1 file changed, 9 insertions(+), 12 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
>> index c11b3ab572ab..e7ac02e92f42 100644
>> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
>> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
>> @@ -1037,7 +1037,7 @@ static int dpu_kms_hw_init(struct msm_kms *kms)
>> if (!dpu_kms->catalog) {
>> DPU_ERROR("device config not known!\n");
>> rc = -EINVAL;
>> - goto power_error;
>> + goto err_pm_put;
>> }
>>
>> /*
>> @@ -1047,13 +1047,13 @@ static int dpu_kms_hw_init(struct msm_kms *kms)
>> rc = _dpu_kms_mmu_init(dpu_kms);
>> if (rc) {
>> DPU_ERROR("dpu_kms_mmu_init failed: %d\n", rc);
>> - goto power_error;
>> + goto err_pm_put;
>> }
>>
>> rc = dpu_rm_init(&dpu_kms->rm, dpu_kms->catalog, dpu_kms->mmio);
>> if (rc) {
>> DPU_ERROR("rm init failed: %d\n", rc);
>> - goto power_error;
>> + goto err_pm_put;
>> }
>>
>> dpu_kms->rm_init = true;
>> @@ -1065,7 +1065,7 @@ static int dpu_kms_hw_init(struct msm_kms *kms)
>> rc = PTR_ERR(dpu_kms->hw_mdp);
>> DPU_ERROR("failed to get hw_mdp: %d\n", rc);
>> dpu_kms->hw_mdp = NULL;
>> - goto power_error;
>> + goto err_pm_put;
>> }
>>
>> for (i = 0; i < dpu_kms->catalog->vbif_count; i++) {
>> @@ -1076,7 +1076,7 @@ static int dpu_kms_hw_init(struct msm_kms *kms)
>> if (IS_ERR(hw)) {
>> rc = PTR_ERR(hw);
>> DPU_ERROR("failed to init vbif %d: %d\n", vbif->id, rc);
>> - goto power_error;
>> + goto err_pm_put;
>> }
>>
>> dpu_kms->hw_vbif[vbif->id] = hw;
>> @@ -1092,7 +1092,7 @@ static int dpu_kms_hw_init(struct msm_kms *kms)
>> rc = dpu_core_perf_init(&dpu_kms->perf, dpu_kms->catalog->perf, max_core_clk_rate);
>> if (rc) {
>> DPU_ERROR("failed to init perf %d\n", rc);
>> - goto perf_err;
>> + goto err_pm_put;
>> }
>>
>> dpu_kms->hw_intr = dpu_hw_intr_init(dpu_kms->mmio, dpu_kms->catalog);
>> @@ -1100,7 +1100,7 @@ static int dpu_kms_hw_init(struct msm_kms *kms)
>> rc = PTR_ERR(dpu_kms->hw_intr);
>> DPU_ERROR("hw_intr init failed: %d\n", rc);
>> dpu_kms->hw_intr = NULL;
>> - goto hw_intr_init_err;
>> + goto err_pm_put;
>> }
>>
>> dev->mode_config.min_width = 0;
>> @@ -1125,7 +1125,7 @@ static int dpu_kms_hw_init(struct msm_kms *kms)
>> rc = _dpu_kms_drm_obj_init(dpu_kms);
>> if (rc) {
>> DPU_ERROR("modeset init failed: %d\n", rc);
>> - goto drm_obj_init_err;
>> + goto err_pm_put;
>> }
>>
>> dpu_vbif_init_memtypes(dpu_kms);
>> @@ -1134,10 +1134,7 @@ static int dpu_kms_hw_init(struct msm_kms *kms)
>>
>> return 0;
>>
>> -drm_obj_init_err:
>> -hw_intr_init_err:
>> -perf_err:
>> -power_error:
>> +err_pm_put:
>> pm_runtime_put_sync(&dpu_kms->pdev->dev);
>> error:
>> _dpu_kms_hw_destroy(dpu_kms);
--
With best wishes
Dmitry
next prev parent reply other threads:[~2023-07-07 23:48 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-07 20:37 [PATCH 00/13] drm/msm/dpu: use managed memory allocations Dmitry Baryshkov
2023-07-07 20:37 ` [PATCH 01/13] drm/msm/dpu: cleanup dpu_kms_hw_init error path Dmitry Baryshkov
2023-07-07 23:25 ` Konrad Dybcio
2023-07-07 23:48 ` Dmitry Baryshkov [this message]
2023-07-08 10:01 ` Konrad Dybcio
2023-07-07 20:37 ` [PATCH 02/13] drm/msm/dpu: remove IS_ERR_OR_NULL for dpu_hw_intr_init() error handling Dmitry Baryshkov
2023-07-07 20:37 ` [PATCH 03/13] drm/msm/dpu: use devres-managed allocation for interrupts data Dmitry Baryshkov
2023-07-07 20:37 ` [PATCH 04/13] drm/msm/dpu: use devres-managed allocation for VBIF data Dmitry Baryshkov
2023-07-07 20:37 ` [PATCH 05/13] drm/msm/dpu: use devres-managed allocation for MDP TOP Dmitry Baryshkov
2023-07-07 20:37 ` [PATCH 06/13] drm/msm/dpu: use devres-managed allocation for HW blocks Dmitry Baryshkov
2023-07-07 20:37 ` [PATCH 07/13] drm/msm/dpu: drop unused dpu_plane::lock Dmitry Baryshkov
2023-07-07 20:37 ` [PATCH 08/13] drm/msm/dpu: remove QoS teardown on plane destruction Dmitry Baryshkov
2023-07-07 20:37 ` [PATCH 09/13] drm/msm/dpu: use drmm-managed allocation for dpu_plane Dmitry Baryshkov
2023-07-07 20:37 ` [PATCH 10/13] drm/msm/dpu: use drmm-managed allocation for dpu_crtc Dmitry Baryshkov
2023-07-07 20:37 ` [PATCH 11/13] drm/msm/dpu: use drmm-managed allocation for dpu_encoder_phys Dmitry Baryshkov
2023-07-07 20:37 ` [PATCH 12/13] drm/msm/dpu: drop dpu_encoder_phys_ops::destroy Dmitry Baryshkov
2023-07-07 20:37 ` [PATCH 13/13] drm/msm/dpu: use drmm-managed allocation for dpu_encoder_virt 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=cc312e51-e0c0-c1f9-aa56-60cf95e23b79@linaro.org \
--to=dmitry.baryshkov@linaro.org \
--cc=airlied@gmail.com \
--cc=andersson@kernel.org \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=freedreno@lists.freedesktop.org \
--cc=konrad.dybcio@linaro.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=marijn.suijten@somainline.org \
--cc=quic_abhinavk@quicinc.com \
--cc=robdclark@gmail.com \
--cc=sean@poorly.run \
--cc=swboyd@chromium.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