Message ID | 1688773943-3887-2-git-send-email-quic_khsieh@quicinc.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp3613678vqx; Fri, 7 Jul 2023 17:06:47 -0700 (PDT) X-Google-Smtp-Source: APBJJlEQtnXd/hc7uZCOR0d4YJMb4kgCFReKr/RDgNuRpMpRxWo9PF6vUrauzC2OgVGrTenat56S X-Received: by 2002:a17:90b:4ac6:b0:262:e439:5013 with SMTP id mh6-20020a17090b4ac600b00262e4395013mr5369423pjb.9.1688774806864; Fri, 07 Jul 2023 17:06:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688774806; cv=none; d=google.com; s=arc-20160816; b=N2m/o9WFd4N56/4VR3MMm3PW0wM5ppD6+HNMj2zjbnYQXSYr9lqweSHNvKBTnGjXyH SxyJeP4XlA95F8yxBfmRY8U3GIOSWkQI/EYesP/YEMJvbx9IaQIHt8Cf8LgmgKFw4QzP 1BJF4rERAU36tog6MjilBBYUZXryC4+07rkeADv8m96QXKdWFpeo5ltaA5jvAfrxsvEw 8vWlYG8l680PBpNld+NW88ZYYqJxISE/EXLU/phPQfvWgDy/UA0YEWfuuvALDgstSr4o Lr+DX/oSkfmNjQ+hfP5cv0XKl/oPwtemcOf2rauz2nhKR+5j/EtsIdb0kJNSx2ntGbHJ kAhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=dAbBg13hz7CILJZIJ+JIt6hR9JC3RmK2RRjZGrVbRaY=; fh=iLBDXtppA26XbUzg3OoIf+Xf8T8VNt57htQsV5BwKSs=; b=PH69wP2HQX71tRE6HVT51J+E9G/rznschUtqRcbkuYSNWElmzHJBAG4rQNSfffNliB QlZ7rO6CTWcVYOszMznimCQEhtEE5k1poGrB5qFChPd5W+erqlQYS6rDYWlyjuU4Dw5v Tc/LUFjzylpJY0MHtcKz6t43XzBfHQAAfmBXt4EX3rd1A6ZRXYXcplsp2ld2hmGKwH/k YtdD7cRyRePrsEtxcbU0Xx/ZHeczXd6lrY/GuYa07GXzSu3Kd2m8ZBUQdCsgFmuCqLla Lixu0pPyv7bxzbWo3/opVInWf1ViISsibiKCLDVWr9z2q+BOUWbTxQjFrRQ1flTRY2gG 4QIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=naN51xgx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t21-20020a17090ad51500b002534f4ce2b6si2963018pju.125.2023.07.07.17.06.32; Fri, 07 Jul 2023 17:06:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=naN51xgx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231929AbjGGXxK (ORCPT <rfc822;tebrre53rla2o@gmail.com> + 99 others); Fri, 7 Jul 2023 19:53:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43216 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230289AbjGGXxF (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 7 Jul 2023 19:53:05 -0400 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2F63A2115; Fri, 7 Jul 2023 16:53:04 -0700 (PDT) Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 367N5Df7028102; Fri, 7 Jul 2023 23:52:52 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=qcppdkim1; bh=dAbBg13hz7CILJZIJ+JIt6hR9JC3RmK2RRjZGrVbRaY=; b=naN51xgxEC0LMubv5hCUvanjsvf5pZJlCVq9oy83xs+TkEmLp6zEwPHXIcQ8Y1PLIPTr QAzzotEevQY4odRkc44IHEjLICZjAK80R7uJYw0lf3kryqaA+zhb0yHJ6IMEXV4YnUkb r8wKUmC2/6hIa0Fdr3InFxOBS1ChCwQazIxsJWsH85tHME2jDRv82WF4V41YVVFVuuQj BGt78f2ZfnTRh0ehdqffW7Lufdp9vArNovePWsi5sWzx1vowNjfF5GiOAwxX4uryKgAQ VWtGT29/ojUjrCVBlr88eeeowiK9Ew3fB+3GlFqUj3KUhzGulS/Qw9WLCNSxz/G/wjhT kA== Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3rpgud1nj2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 07 Jul 2023 23:52:51 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA03.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 367Nqo3H008768 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 7 Jul 2023 23:52:50 GMT Received: from khsieh-linux1.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.30; Fri, 7 Jul 2023 16:52:49 -0700 From: Kuogee Hsieh <quic_khsieh@quicinc.com> To: <dri-devel@lists.freedesktop.org>, <robdclark@gmail.com>, <sean@poorly.run>, <swboyd@chromium.org>, <dianders@chromium.org>, <vkoul@kernel.org>, <daniel@ffwll.ch>, <airlied@gmail.com>, <agross@kernel.org>, <dmitry.baryshkov@linaro.org>, <andersson@kernel.org> CC: Kuogee Hsieh <quic_khsieh@quicinc.com>, <quic_abhinavk@quicinc.com>, <quic_jesszhan@quicinc.com>, <quic_sbillaka@quicinc.com>, <marijn.suijten@somainline.org>, <freedreno@lists.freedesktop.org>, <linux-arm-msm@vger.kernel.org>, <linux-kernel@vger.kernel.org> Subject: [PATCH v1 1/5] drm/msm/dp: remove pm_runtime_xxx() from dp_power.c Date: Fri, 7 Jul 2023 16:52:19 -0700 Message-ID: <1688773943-3887-2-git-send-email-quic_khsieh@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1688773943-3887-1-git-send-email-quic_khsieh@quicinc.com> References: <1688773943-3887-1-git-send-email-quic_khsieh@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: tDWCyFgzQHXggdZnctA_h8FpnOiX3uo8 X-Proofpoint-GUID: tDWCyFgzQHXggdZnctA_h8FpnOiX3uo8 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-07-07_14,2023-07-06_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 adultscore=0 mlxlogscore=999 bulkscore=0 phishscore=0 clxscore=1015 malwarescore=0 suspectscore=0 priorityscore=1501 mlxscore=0 lowpriorityscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2307070217 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770808731984876115?= X-GMAIL-MSGID: =?utf-8?q?1770808731984876115?= |
Series |
incorporate pm runtime framework and eDP clean up
|
|
Commit Message
Kuogee Hsieh
July 7, 2023, 11:52 p.m. UTC
Since both pm_runtime_resume() and pm_runtime_suspend() are not
populated at dp_pm_ops. Those pm_runtime_get/put() functions within
dp_power.c will not have any effects in addition to increase/decrease
power counter. Also pm_runtime_xxx() should be executed at top
layer.
Signed-off-by: Kuogee Hsieh <quic_khsieh@quicinc.com>
---
drivers/gpu/drm/msm/dp/dp_power.c | 9 ---------
1 file changed, 9 deletions(-)
Comments
On 08/07/2023 02:52, Kuogee Hsieh wrote: > Since both pm_runtime_resume() and pm_runtime_suspend() are not > populated at dp_pm_ops. Those pm_runtime_get/put() functions within > dp_power.c will not have any effects in addition to increase/decrease > power counter. Lie. > Also pm_runtime_xxx() should be executed at top > layer. Why? > > Signed-off-by: Kuogee Hsieh <quic_khsieh@quicinc.com> > --- > drivers/gpu/drm/msm/dp/dp_power.c | 9 --------- > 1 file changed, 9 deletions(-) > > diff --git a/drivers/gpu/drm/msm/dp/dp_power.c b/drivers/gpu/drm/msm/dp/dp_power.c > index 5cb84ca..ed2f62a 100644 > --- a/drivers/gpu/drm/msm/dp/dp_power.c > +++ b/drivers/gpu/drm/msm/dp/dp_power.c > @@ -152,8 +152,6 @@ int dp_power_client_init(struct dp_power *dp_power) > > power = container_of(dp_power, struct dp_power_private, dp_power); > > - pm_runtime_enable(power->dev); > - > return dp_power_clk_init(power); > } > > @@ -162,8 +160,6 @@ void dp_power_client_deinit(struct dp_power *dp_power) > struct dp_power_private *power; > > power = container_of(dp_power, struct dp_power_private, dp_power); > - > - pm_runtime_disable(power->dev); > } > > int dp_power_init(struct dp_power *dp_power) > @@ -173,11 +169,7 @@ int dp_power_init(struct dp_power *dp_power) > > power = container_of(dp_power, struct dp_power_private, dp_power); > > - pm_runtime_get_sync(power->dev); > - > rc = dp_power_clk_enable(dp_power, DP_CORE_PM, true); > - if (rc) > - pm_runtime_put_sync(power->dev); > > return rc; > } > @@ -189,7 +181,6 @@ int dp_power_deinit(struct dp_power *dp_power) > power = container_of(dp_power, struct dp_power_private, dp_power); > > dp_power_clk_enable(dp_power, DP_CORE_PM, false); > - pm_runtime_put_sync(power->dev); > return 0; > } >
On Fri, Jul 07, 2023 at 04:52:19PM -0700, Kuogee Hsieh wrote: > Since both pm_runtime_resume() and pm_runtime_suspend() are not > populated at dp_pm_ops. Those pm_runtime_get/put() functions within > dp_power.c will not have any effects in addition to increase/decrease > power counter. Also pm_runtime_xxx() should be executed at top > layer. > Getting/putting the runtime PM state affects the vote for the GDSC. So I would suggest that you move this after patch 2, to not create a gap in the git history of lacking GDSC votes. Regards, Bjorn > Signed-off-by: Kuogee Hsieh <quic_khsieh@quicinc.com> > --- > drivers/gpu/drm/msm/dp/dp_power.c | 9 --------- > 1 file changed, 9 deletions(-) > > diff --git a/drivers/gpu/drm/msm/dp/dp_power.c b/drivers/gpu/drm/msm/dp/dp_power.c > index 5cb84ca..ed2f62a 100644 > --- a/drivers/gpu/drm/msm/dp/dp_power.c > +++ b/drivers/gpu/drm/msm/dp/dp_power.c > @@ -152,8 +152,6 @@ int dp_power_client_init(struct dp_power *dp_power) > > power = container_of(dp_power, struct dp_power_private, dp_power); > > - pm_runtime_enable(power->dev); > - > return dp_power_clk_init(power); > } > > @@ -162,8 +160,6 @@ void dp_power_client_deinit(struct dp_power *dp_power) > struct dp_power_private *power; > > power = container_of(dp_power, struct dp_power_private, dp_power); > - > - pm_runtime_disable(power->dev); > } > > int dp_power_init(struct dp_power *dp_power) > @@ -173,11 +169,7 @@ int dp_power_init(struct dp_power *dp_power) > > power = container_of(dp_power, struct dp_power_private, dp_power); > > - pm_runtime_get_sync(power->dev); > - > rc = dp_power_clk_enable(dp_power, DP_CORE_PM, true); > - if (rc) > - pm_runtime_put_sync(power->dev); > > return rc; > } > @@ -189,7 +181,6 @@ int dp_power_deinit(struct dp_power *dp_power) > power = container_of(dp_power, struct dp_power_private, dp_power); > > dp_power_clk_enable(dp_power, DP_CORE_PM, false); > - pm_runtime_put_sync(power->dev); > return 0; > } > > -- > 2.7.4 >
On 7/7/2023 5:06 PM, Dmitry Baryshkov wrote: > On 08/07/2023 02:52, Kuogee Hsieh wrote: >> Since both pm_runtime_resume() and pm_runtime_suspend() are not >> populated at dp_pm_ops. Those pm_runtime_get/put() functions within >> dp_power.c will not have any effects in addition to increase/decrease >> power counter. > > Lie. > Even if the commit text is incorrect, review comments like this are not helping the patch nor the author and will just get ignored anyway. >> Also pm_runtime_xxx() should be executed at top >> layer. > > Why? > I guess he meant to centralize this around dp_display.c. Will elaborate while posting the next rev. >> >> Signed-off-by: Kuogee Hsieh <quic_khsieh@quicinc.com> >> --- >> drivers/gpu/drm/msm/dp/dp_power.c | 9 --------- >> 1 file changed, 9 deletions(-) >> >> diff --git a/drivers/gpu/drm/msm/dp/dp_power.c >> b/drivers/gpu/drm/msm/dp/dp_power.c >> index 5cb84ca..ed2f62a 100644 >> --- a/drivers/gpu/drm/msm/dp/dp_power.c >> +++ b/drivers/gpu/drm/msm/dp/dp_power.c >> @@ -152,8 +152,6 @@ int dp_power_client_init(struct dp_power *dp_power) >> power = container_of(dp_power, struct dp_power_private, dp_power); >> - pm_runtime_enable(power->dev); >> - >> return dp_power_clk_init(power); >> } >> @@ -162,8 +160,6 @@ void dp_power_client_deinit(struct dp_power >> *dp_power) >> struct dp_power_private *power; >> power = container_of(dp_power, struct dp_power_private, dp_power); >> - >> - pm_runtime_disable(power->dev); >> } >> int dp_power_init(struct dp_power *dp_power) >> @@ -173,11 +169,7 @@ int dp_power_init(struct dp_power *dp_power) >> power = container_of(dp_power, struct dp_power_private, dp_power); >> - pm_runtime_get_sync(power->dev); >> - >> rc = dp_power_clk_enable(dp_power, DP_CORE_PM, true); >> - if (rc) >> - pm_runtime_put_sync(power->dev); >> return rc; >> } >> @@ -189,7 +181,6 @@ int dp_power_deinit(struct dp_power *dp_power) >> power = container_of(dp_power, struct dp_power_private, dp_power); >> dp_power_clk_enable(dp_power, DP_CORE_PM, false); >> - pm_runtime_put_sync(power->dev); >> return 0; >> } >
On 7/8/2023 7:34 PM, Bjorn Andersson wrote: > On Fri, Jul 07, 2023 at 04:52:19PM -0700, Kuogee Hsieh wrote: >> Since both pm_runtime_resume() and pm_runtime_suspend() are not >> populated at dp_pm_ops. Those pm_runtime_get/put() functions within >> dp_power.c will not have any effects in addition to increase/decrease >> power counter. Also pm_runtime_xxx() should be executed at top >> layer. >> > > Getting/putting the runtime PM state affects the vote for the GDSC. So I > would suggest that you move this after patch 2, to not create a gap in > the git history of lacking GDSC votes. > > Regards, > Bjorn > the mdss_dp node has rpmhpd SC7180_CX in its power domains. the parent device has the GDSC. So just so that I understand this right, the DP's vote on this will still count because the parent's power domain wont get collapsed till the child PM votes are removed too? If so, I see your point and yes it will make sense to move this later to avoid the gap. >> Signed-off-by: Kuogee Hsieh <quic_khsieh@quicinc.com> >> --- >> drivers/gpu/drm/msm/dp/dp_power.c | 9 --------- >> 1 file changed, 9 deletions(-) >> >> diff --git a/drivers/gpu/drm/msm/dp/dp_power.c b/drivers/gpu/drm/msm/dp/dp_power.c >> index 5cb84ca..ed2f62a 100644 >> --- a/drivers/gpu/drm/msm/dp/dp_power.c >> +++ b/drivers/gpu/drm/msm/dp/dp_power.c >> @@ -152,8 +152,6 @@ int dp_power_client_init(struct dp_power *dp_power) >> >> power = container_of(dp_power, struct dp_power_private, dp_power); >> >> - pm_runtime_enable(power->dev); >> - >> return dp_power_clk_init(power); >> } >> >> @@ -162,8 +160,6 @@ void dp_power_client_deinit(struct dp_power *dp_power) >> struct dp_power_private *power; >> >> power = container_of(dp_power, struct dp_power_private, dp_power); >> - >> - pm_runtime_disable(power->dev); >> } >> >> int dp_power_init(struct dp_power *dp_power) >> @@ -173,11 +169,7 @@ int dp_power_init(struct dp_power *dp_power) >> >> power = container_of(dp_power, struct dp_power_private, dp_power); >> >> - pm_runtime_get_sync(power->dev); >> - >> rc = dp_power_clk_enable(dp_power, DP_CORE_PM, true); >> - if (rc) >> - pm_runtime_put_sync(power->dev); >> >> return rc; >> } >> @@ -189,7 +181,6 @@ int dp_power_deinit(struct dp_power *dp_power) >> power = container_of(dp_power, struct dp_power_private, dp_power); >> >> dp_power_clk_enable(dp_power, DP_CORE_PM, false); >> - pm_runtime_put_sync(power->dev); >> return 0; >> } >> >> -- >> 2.7.4 >>
On Sun, 9 Jul 2023 at 20:22, Abhinav Kumar <quic_abhinavk@quicinc.com> wrote: > > > > On 7/7/2023 5:06 PM, Dmitry Baryshkov wrote: > > On 08/07/2023 02:52, Kuogee Hsieh wrote: > >> Since both pm_runtime_resume() and pm_runtime_suspend() are not > >> populated at dp_pm_ops. Those pm_runtime_get/put() functions within > >> dp_power.c will not have any effects in addition to increase/decrease > >> power counter. > > > > Lie. > > > > Even if the commit text is incorrect, review comments like this are not > helping the patch nor the author and will just get ignored anyway. The review comment might be overreacting, excuse me. I was really impressed by the commit message, which contradicts the basic source code. pm_runtime_get() does a lot more than just increasing the power counter. > >> Also pm_runtime_xxx() should be executed at top > >> layer. > > > > Why? > > > > I guess he meant to centralize this around dp_display.c. Will elaborate > while posting the next rev. > > >> > >> Signed-off-by: Kuogee Hsieh <quic_khsieh@quicinc.com> > >> --- > >> drivers/gpu/drm/msm/dp/dp_power.c | 9 --------- > >> 1 file changed, 9 deletions(-) > >> > >> diff --git a/drivers/gpu/drm/msm/dp/dp_power.c > >> b/drivers/gpu/drm/msm/dp/dp_power.c > >> index 5cb84ca..ed2f62a 100644 > >> --- a/drivers/gpu/drm/msm/dp/dp_power.c > >> +++ b/drivers/gpu/drm/msm/dp/dp_power.c > >> @@ -152,8 +152,6 @@ int dp_power_client_init(struct dp_power *dp_power) > >> power = container_of(dp_power, struct dp_power_private, dp_power); > >> - pm_runtime_enable(power->dev); > >> - > >> return dp_power_clk_init(power); > >> } > >> @@ -162,8 +160,6 @@ void dp_power_client_deinit(struct dp_power > >> *dp_power) > >> struct dp_power_private *power; > >> power = container_of(dp_power, struct dp_power_private, dp_power); > >> - > >> - pm_runtime_disable(power->dev); > >> } > >> int dp_power_init(struct dp_power *dp_power) > >> @@ -173,11 +169,7 @@ int dp_power_init(struct dp_power *dp_power) > >> power = container_of(dp_power, struct dp_power_private, dp_power); > >> - pm_runtime_get_sync(power->dev); > >> - > >> rc = dp_power_clk_enable(dp_power, DP_CORE_PM, true); > >> - if (rc) > >> - pm_runtime_put_sync(power->dev); > >> return rc; > >> } > >> @@ -189,7 +181,6 @@ int dp_power_deinit(struct dp_power *dp_power) > >> power = container_of(dp_power, struct dp_power_private, dp_power); > >> dp_power_clk_enable(dp_power, DP_CORE_PM, false); > >> - pm_runtime_put_sync(power->dev); > >> return 0; > >> } > >
On 7/9/2023 11:00 AM, Dmitry Baryshkov wrote: > On Sun, 9 Jul 2023 at 20:22, Abhinav Kumar <quic_abhinavk@quicinc.com> wrote: >> >> >> >> On 7/7/2023 5:06 PM, Dmitry Baryshkov wrote: >>> On 08/07/2023 02:52, Kuogee Hsieh wrote: >>>> Since both pm_runtime_resume() and pm_runtime_suspend() are not >>>> populated at dp_pm_ops. Those pm_runtime_get/put() functions within >>>> dp_power.c will not have any effects in addition to increase/decrease >>>> power counter. >>> >>> Lie. >>> >> >> Even if the commit text is incorrect, review comments like this are not >> helping the patch nor the author and will just get ignored anyway. > > The review comment might be overreacting, excuse me. I was really > impressed by the commit message, which contradicts the basic source > code. pm_runtime_get() does a lot more than just increasing the power > counter. > It says within dp_power.c. Nonetheless, please let us know what is missing in the context of this patch like Bjorn did to make it an effective review and we can correct it. In its current form, the review comment is adding no value. >>>> Also pm_runtime_xxx() should be executed at top >>>> layer. >>> >>> Why? >>> >> >> I guess he meant to centralize this around dp_display.c. Will elaborate >> while posting the next rev. >> >>>> >>>> Signed-off-by: Kuogee Hsieh <quic_khsieh@quicinc.com> >>>> --- >>>> drivers/gpu/drm/msm/dp/dp_power.c | 9 --------- >>>> 1 file changed, 9 deletions(-) >>>> >>>> diff --git a/drivers/gpu/drm/msm/dp/dp_power.c >>>> b/drivers/gpu/drm/msm/dp/dp_power.c >>>> index 5cb84ca..ed2f62a 100644 >>>> --- a/drivers/gpu/drm/msm/dp/dp_power.c >>>> +++ b/drivers/gpu/drm/msm/dp/dp_power.c >>>> @@ -152,8 +152,6 @@ int dp_power_client_init(struct dp_power *dp_power) >>>> power = container_of(dp_power, struct dp_power_private, dp_power); >>>> - pm_runtime_enable(power->dev); >>>> - >>>> return dp_power_clk_init(power); >>>> } >>>> @@ -162,8 +160,6 @@ void dp_power_client_deinit(struct dp_power >>>> *dp_power) >>>> struct dp_power_private *power; >>>> power = container_of(dp_power, struct dp_power_private, dp_power); >>>> - >>>> - pm_runtime_disable(power->dev); >>>> } >>>> int dp_power_init(struct dp_power *dp_power) >>>> @@ -173,11 +169,7 @@ int dp_power_init(struct dp_power *dp_power) >>>> power = container_of(dp_power, struct dp_power_private, dp_power); >>>> - pm_runtime_get_sync(power->dev); >>>> - >>>> rc = dp_power_clk_enable(dp_power, DP_CORE_PM, true); >>>> - if (rc) >>>> - pm_runtime_put_sync(power->dev); >>>> return rc; >>>> } >>>> @@ -189,7 +181,6 @@ int dp_power_deinit(struct dp_power *dp_power) >>>> power = container_of(dp_power, struct dp_power_private, dp_power); >>>> dp_power_clk_enable(dp_power, DP_CORE_PM, false); >>>> - pm_runtime_put_sync(power->dev); >>>> return 0; >>>> } >>> > > >
On 7/9/2023 1:32 PM, Abhinav Kumar wrote: > > > On 7/9/2023 11:00 AM, Dmitry Baryshkov wrote: >> On Sun, 9 Jul 2023 at 20:22, Abhinav Kumar >> <quic_abhinavk@quicinc.com> wrote: >>> >>> >>> >>> On 7/7/2023 5:06 PM, Dmitry Baryshkov wrote: >>>> On 08/07/2023 02:52, Kuogee Hsieh wrote: >>>>> Since both pm_runtime_resume() and pm_runtime_suspend() are not >>>>> populated at dp_pm_ops. Those pm_runtime_get/put() functions within >>>>> dp_power.c will not have any effects in addition to increase/decrease >>>>> power counter. >>>> >>>> Lie. >>>> >>> >>> Even if the commit text is incorrect, review comments like this are not >>> helping the patch nor the author and will just get ignored anyway. >> >> The review comment might be overreacting, excuse me. I was really >> impressed by the commit message, which contradicts the basic source >> code. pm_runtime_get() does a lot more than just increasing the power >> counter. >> > > It says within dp_power.c. Nonetheless, please let us know what is > missing in the context of this patch like Bjorn did to make it an > effective review and we can correct it. In its current form, the > review comment is adding no value. > I am new in pm. Any recommendation to revise this commit test? >>>>> Also pm_runtime_xxx() should be executed at top >>>>> layer. >>>> >>>> Why? >>>> >>> >>> I guess he meant to centralize this around dp_display.c. Will elaborate >>> while posting the next rev. >>> >>>>> >>>>> Signed-off-by: Kuogee Hsieh <quic_khsieh@quicinc.com> >>>>> --- >>>>> drivers/gpu/drm/msm/dp/dp_power.c | 9 --------- >>>>> 1 file changed, 9 deletions(-) >>>>> >>>>> diff --git a/drivers/gpu/drm/msm/dp/dp_power.c >>>>> b/drivers/gpu/drm/msm/dp/dp_power.c >>>>> index 5cb84ca..ed2f62a 100644 >>>>> --- a/drivers/gpu/drm/msm/dp/dp_power.c >>>>> +++ b/drivers/gpu/drm/msm/dp/dp_power.c >>>>> @@ -152,8 +152,6 @@ int dp_power_client_init(struct dp_power >>>>> *dp_power) >>>>> power = container_of(dp_power, struct dp_power_private, >>>>> dp_power); >>>>> - pm_runtime_enable(power->dev); >>>>> - >>>>> return dp_power_clk_init(power); >>>>> } >>>>> @@ -162,8 +160,6 @@ void dp_power_client_deinit(struct dp_power >>>>> *dp_power) >>>>> struct dp_power_private *power; >>>>> power = container_of(dp_power, struct dp_power_private, >>>>> dp_power); >>>>> - >>>>> - pm_runtime_disable(power->dev); >>>>> } >>>>> int dp_power_init(struct dp_power *dp_power) >>>>> @@ -173,11 +169,7 @@ int dp_power_init(struct dp_power *dp_power) >>>>> power = container_of(dp_power, struct dp_power_private, >>>>> dp_power); >>>>> - pm_runtime_get_sync(power->dev); >>>>> - >>>>> rc = dp_power_clk_enable(dp_power, DP_CORE_PM, true); >>>>> - if (rc) >>>>> - pm_runtime_put_sync(power->dev); >>>>> return rc; >>>>> } >>>>> @@ -189,7 +181,6 @@ int dp_power_deinit(struct dp_power *dp_power) >>>>> power = container_of(dp_power, struct dp_power_private, >>>>> dp_power); >>>>> dp_power_clk_enable(dp_power, DP_CORE_PM, false); >>>>> - pm_runtime_put_sync(power->dev); >>>>> return 0; >>>>> } >>>> >> >> >>
On 10/07/2023 20:25, Kuogee Hsieh wrote: > > On 7/9/2023 1:32 PM, Abhinav Kumar wrote: >> >> >> On 7/9/2023 11:00 AM, Dmitry Baryshkov wrote: >>> On Sun, 9 Jul 2023 at 20:22, Abhinav Kumar >>> <quic_abhinavk@quicinc.com> wrote: >>>> >>>> >>>> >>>> On 7/7/2023 5:06 PM, Dmitry Baryshkov wrote: >>>>> On 08/07/2023 02:52, Kuogee Hsieh wrote: >>>>>> Since both pm_runtime_resume() and pm_runtime_suspend() are not >>>>>> populated at dp_pm_ops. Those pm_runtime_get/put() functions within >>>>>> dp_power.c will not have any effects in addition to increase/decrease >>>>>> power counter. >>>>> >>>>> Lie. >>>>> >>>> >>>> Even if the commit text is incorrect, review comments like this are not >>>> helping the patch nor the author and will just get ignored anyway. >>> >>> The review comment might be overreacting, excuse me. I was really >>> impressed by the commit message, which contradicts the basic source >>> code. pm_runtime_get() does a lot more than just increasing the power >>> counter. >>> >> >> It says within dp_power.c. Nonetheless, please let us know what is >> missing in the context of this patch like Bjorn did to make it an >> effective review and we can correct it. In its current form, the >> review comment is adding no value. >> > I am new in pm. > > Any recommendation to revise this commit test? I'd say, squash patches 1 and 2 and then state in the commit message that you are changing pm_runtime code paths because you want to power up the device from the runtime callbacks rather than just waking up the device in the power up path. Generally it is much easier to justify changing from A to B rather than just dropping A and then adding B. > >>>>>> Also pm_runtime_xxx() should be executed at top >>>>>> layer. >>>>> >>>>> Why? >>>>> >>>> >>>> I guess he meant to centralize this around dp_display.c. Will elaborate >>>> while posting the next rev. >>>> >>>>>> >>>>>> Signed-off-by: Kuogee Hsieh <quic_khsieh@quicinc.com> >>>>>> --- >>>>>> drivers/gpu/drm/msm/dp/dp_power.c | 9 --------- >>>>>> 1 file changed, 9 deletions(-) >>>>>> >>>>>> diff --git a/drivers/gpu/drm/msm/dp/dp_power.c >>>>>> b/drivers/gpu/drm/msm/dp/dp_power.c >>>>>> index 5cb84ca..ed2f62a 100644 >>>>>> --- a/drivers/gpu/drm/msm/dp/dp_power.c >>>>>> +++ b/drivers/gpu/drm/msm/dp/dp_power.c >>>>>> @@ -152,8 +152,6 @@ int dp_power_client_init(struct dp_power >>>>>> *dp_power) >>>>>> power = container_of(dp_power, struct dp_power_private, >>>>>> dp_power); >>>>>> - pm_runtime_enable(power->dev); >>>>>> - >>>>>> return dp_power_clk_init(power); >>>>>> } >>>>>> @@ -162,8 +160,6 @@ void dp_power_client_deinit(struct dp_power >>>>>> *dp_power) >>>>>> struct dp_power_private *power; >>>>>> power = container_of(dp_power, struct dp_power_private, >>>>>> dp_power); >>>>>> - >>>>>> - pm_runtime_disable(power->dev); >>>>>> } >>>>>> int dp_power_init(struct dp_power *dp_power) >>>>>> @@ -173,11 +169,7 @@ int dp_power_init(struct dp_power *dp_power) >>>>>> power = container_of(dp_power, struct dp_power_private, >>>>>> dp_power); >>>>>> - pm_runtime_get_sync(power->dev); >>>>>> - >>>>>> rc = dp_power_clk_enable(dp_power, DP_CORE_PM, true); >>>>>> - if (rc) >>>>>> - pm_runtime_put_sync(power->dev); >>>>>> return rc; >>>>>> } >>>>>> @@ -189,7 +181,6 @@ int dp_power_deinit(struct dp_power *dp_power) >>>>>> power = container_of(dp_power, struct dp_power_private, >>>>>> dp_power); >>>>>> dp_power_clk_enable(dp_power, DP_CORE_PM, false); >>>>>> - pm_runtime_put_sync(power->dev); >>>>>> return 0; >>>>>> } >>>>> >>> >>> >>>
diff --git a/drivers/gpu/drm/msm/dp/dp_power.c b/drivers/gpu/drm/msm/dp/dp_power.c index 5cb84ca..ed2f62a 100644 --- a/drivers/gpu/drm/msm/dp/dp_power.c +++ b/drivers/gpu/drm/msm/dp/dp_power.c @@ -152,8 +152,6 @@ int dp_power_client_init(struct dp_power *dp_power) power = container_of(dp_power, struct dp_power_private, dp_power); - pm_runtime_enable(power->dev); - return dp_power_clk_init(power); } @@ -162,8 +160,6 @@ void dp_power_client_deinit(struct dp_power *dp_power) struct dp_power_private *power; power = container_of(dp_power, struct dp_power_private, dp_power); - - pm_runtime_disable(power->dev); } int dp_power_init(struct dp_power *dp_power) @@ -173,11 +169,7 @@ int dp_power_init(struct dp_power *dp_power) power = container_of(dp_power, struct dp_power_private, dp_power); - pm_runtime_get_sync(power->dev); - rc = dp_power_clk_enable(dp_power, DP_CORE_PM, true); - if (rc) - pm_runtime_put_sync(power->dev); return rc; } @@ -189,7 +181,6 @@ int dp_power_deinit(struct dp_power *dp_power) power = container_of(dp_power, struct dp_power_private, dp_power); dp_power_clk_enable(dp_power, DP_CORE_PM, false); - pm_runtime_put_sync(power->dev); return 0; }