mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Kuogee Hsieh <quic_khsieh@quicinc.com>
To: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Cc: <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>, <andersson@kernel.org>,
	<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: Re: [PATCH v3 1/7] drm/msm/dp: tie dp_display_irq_handler() with dp driver
Date: Wed, 27 Sep 2023 08:25:26 -0700	[thread overview]
Message-ID: <31bff2df-40a1-21f7-e155-38028b2688e8@quicinc.com> (raw)
In-Reply-To: <CAA8EJpoW8COZD7+yg9oZ=k=x36+XQKaJgvhab=XZPwTVuixh2A@mail.gmail.com>


On 9/23/2023 11:45 AM, Dmitry Baryshkov wrote:
> On Sat, 23 Sept 2023 at 02:03, Kuogee Hsieh <quic_khsieh@quicinc.com> wrote:
>>
>> On 9/15/2023 5:29 PM, Dmitry Baryshkov wrote:
>>> On Sat, 16 Sept 2023 at 00:38, Kuogee Hsieh <quic_khsieh@quicinc.com> wrote:
>>>> Currently the dp_display_irq_handler() is executed at msm_dp_modeset_init()
>>>> which ties irq registration to the DPU device's life cycle, while depending on
>>>> resources that are released as the DP device is torn down. Move register DP
>>>> driver irq handler at dp_display_probe() to have dp_display_irq_handler()
>>>> is tied with DP device.
>>>>
>>>> Changes in v3:
>>>> -- move calling dp_display_irq_handler() to probe
>>> Was there a changelog for the previous reivions? What is the
>>> difference between v1 and v2?
>>>
>>>> Signed-off-by: Kuogee Hsieh <quic_khsieh@quicinc.com>
>>>> ---
>>>>    drivers/gpu/drm/msm/dp/dp_display.c | 35 +++++++++++++----------------------
>>>>    drivers/gpu/drm/msm/dp/dp_display.h |  1 -
>>>>    2 files changed, 13 insertions(+), 23 deletions(-)
>>>>
>>>> diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c
>>>> index 76f1395..c217430 100644
>>>> --- a/drivers/gpu/drm/msm/dp/dp_display.c
>>>> +++ b/drivers/gpu/drm/msm/dp/dp_display.c
>>>> @@ -1193,30 +1193,23 @@ static irqreturn_t dp_display_irq_handler(int irq, void *dev_id)
>>>>           return ret;
>>>>    }
>>>>
>>>> -int dp_display_request_irq(struct msm_dp *dp_display)
>>>> +static int dp_display_request_irq(struct dp_display_private *dp)
>>>>    {
>>>>           int rc = 0;
>>>> -       struct dp_display_private *dp;
>>>> -
>>>> -       if (!dp_display) {
>>>> -               DRM_ERROR("invalid input\n");
>>>> -               return -EINVAL;
>>>> -       }
>>>> -
>>>> -       dp = container_of(dp_display, struct dp_display_private, dp_display);
>>>> +       struct device *dev = &dp->pdev->dev;
>>>>
>>>> -       dp->irq = irq_of_parse_and_map(dp->pdev->dev.of_node, 0);
>>>>           if (!dp->irq) {
>>> What is the point in this check?
>>>
>>>> -               DRM_ERROR("failed to get irq\n");
>>>> -               return -EINVAL;
>>>> +               dp->irq = platform_get_irq(dp->pdev, 0);
>>>> +               if (!dp->irq) {
>>>> +                       DRM_ERROR("failed to get irq\n");
>>>> +                       return -EINVAL;
>>>> +               }
>>>>           }
>>>>
>>>> -       rc = devm_request_irq(dp_display->drm_dev->dev, dp->irq,
>>>> -                       dp_display_irq_handler,
>>>> +       rc = devm_request_irq(dev, dp->irq, dp_display_irq_handler,
>>>>                           IRQF_TRIGGER_HIGH, "dp_display_isr", dp);
>>>>           if (rc < 0) {
>>>> -               DRM_ERROR("failed to request IRQ%u: %d\n",
>>>> -                               dp->irq, rc);
>>>> +               DRM_ERROR("failed to request IRQ%u: %d\n", dp->irq, rc);
>>>>                   return rc;
>>>>           }
>>>>
>>>> @@ -1287,6 +1280,10 @@ static int dp_display_probe(struct platform_device *pdev)
>>>>
>>>>           platform_set_drvdata(pdev, &dp->dp_display);
>>>>
>>>> +       rc = dp_display_request_irq(dp);
>>>> +       if (rc)
>>>> +               return rc;
>>> This way the IRQ ends up being enabled in _probe. Are we ready to
>>> handle it here? Is the DP device fully setup at this moment?
>> The irq is enabled here.
>>
>> but DP driver hpd hardware block has not yet be enabled. this means no
>> irq will be delivered.
> There are other IRQ kinds, not only just HPD ones.

pm_runtime_resume_and_get() will enable host controller (including hpd and aux block).
so that as long as pm_runtime_resume_and_get() called, then all DP related interrupts will be handled accordingly.

>
>>    .hpd_enable() will call pm_runtime_resume_and_get() and
>> dp_catalog_ctrl_hpd_enable().
>>
>> after .hpd_enable() irq will be delivered and handled properly.
>>
>>
>>
>>>> +
>>>>           rc = component_add(&pdev->dev, &dp_display_comp_ops);
>>>>           if (rc) {
>>>>                   DRM_ERROR("component add failed, rc=%d\n", rc);
>>>> @@ -1549,12 +1546,6 @@ int msm_dp_modeset_init(struct msm_dp *dp_display, struct drm_device *dev,
>>>>
>>>>           dp_priv = container_of(dp_display, struct dp_display_private, dp_display);
>>>>
>>>> -       ret = dp_display_request_irq(dp_display);
>>>> -       if (ret) {
>>>> -               DRM_ERROR("request_irq failed, ret=%d\n", ret);
>>>> -               return ret;
>>>> -       }
>>>> -
>>>>           ret = dp_display_get_next_bridge(dp_display);
>>>>           if (ret)
>>>>                   return ret;
>>>> diff --git a/drivers/gpu/drm/msm/dp/dp_display.h b/drivers/gpu/drm/msm/dp/dp_display.h
>>>> index 1e9415a..b3c08de 100644
>>>> --- a/drivers/gpu/drm/msm/dp/dp_display.h
>>>> +++ b/drivers/gpu/drm/msm/dp/dp_display.h
>>>> @@ -35,7 +35,6 @@ struct msm_dp {
>>>>    int dp_display_set_plugged_cb(struct msm_dp *dp_display,
>>>>                   hdmi_codec_plugged_cb fn, struct device *codec_dev);
>>>>    int dp_display_get_modes(struct msm_dp *dp_display);
>>>> -int dp_display_request_irq(struct msm_dp *dp_display);
>>>>    bool dp_display_check_video_test(struct msm_dp *dp_display);
>>>>    int dp_display_get_test_bpp(struct msm_dp *dp_display);
>>>>    void dp_display_signal_audio_start(struct msm_dp *dp_display);
>>>> --
>>>> 2.7.4
>>>>
>
>

  reply	other threads:[~2023-09-27 15:25 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-15 21:38 [PATCH v3 0/7] incorporate pm runtime framework and eDP clean up Kuogee Hsieh
2023-09-15 21:38 ` [PATCH v3 1/7] drm/msm/dp: tie dp_display_irq_handler() with dp driver Kuogee Hsieh
2023-09-16  0:29   ` Dmitry Baryshkov
2023-09-18 17:02     ` Kuogee Hsieh
2023-09-19  9:44       ` Dmitry Baryshkov
2023-09-22 23:02     ` Kuogee Hsieh
2023-09-23 18:45       ` Dmitry Baryshkov
2023-09-27 15:25         ` Kuogee Hsieh [this message]
2023-09-15 21:38 ` [PATCH v3 2/7] drm/msm/dp: replace is_connected with link_ready Kuogee Hsieh
2023-09-16  1:51   ` Dmitry Baryshkov
2023-09-18 17:09     ` Kuogee Hsieh
2023-09-19  9:44       ` Dmitry Baryshkov
2023-09-15 21:38 ` [PATCH v3 3/7] drm/msm/dp: use drm_bridge_hpd_notify() to report HPD status changes Kuogee Hsieh
2023-09-16  0:41   ` Dmitry Baryshkov
2023-09-18 20:16     ` Kuogee Hsieh
2023-09-19  9:45       ` Dmitry Baryshkov
2023-09-15 21:38 ` [PATCH v3 4/7] drm/msm/dp: incorporate pm_runtime framework into DP driver Kuogee Hsieh
2023-09-16  1:07   ` Dmitry Baryshkov
2023-09-20 22:46     ` Kuogee Hsieh
2023-09-25  9:06       ` Dmitry Baryshkov
2023-09-16  5:25   ` kernel test robot
2023-09-15 21:38 ` [PATCH v3 5/7] drm/msm/dp: delete EV_HPD_INIT_SETUP Kuogee Hsieh
2023-09-16  1:09   ` Dmitry Baryshkov
2023-09-15 21:38 ` [PATCH v3 6/7] drm/msm/dp: add pm_runtime_force_suspend()/resume() Kuogee Hsieh
2023-09-16  1:21   ` Dmitry Baryshkov
2023-09-18 17:47     ` Kuogee Hsieh
2023-09-19  9:50       ` Dmitry Baryshkov
2023-09-20 19:49         ` Kuogee Hsieh
2023-09-22 21:54         ` Stephen Boyd
2023-09-23  1:35           ` Abhinav Kumar
2023-09-25 16:07             ` Kuogee Hsieh
2023-09-27 22:01               ` Stephen Boyd
2023-09-27 22:04                 ` Dmitry Baryshkov
2023-09-29  0:46                 ` Abhinav Kumar
2023-10-02 22:58                   ` Stephen Boyd
2023-10-03  1:32                     ` Abhinav Kumar
2023-10-03  8:00                       ` Dmitry Baryshkov
2023-09-27 21:41             ` Stephen Boyd
2023-09-28 22:35               ` Abhinav Kumar
2023-09-15 21:38 ` [PATCH v3 7/7] drm/msm/dp: move of_dp_aux_populate_bus() to eDP probe() Kuogee Hsieh
2023-09-16  1:48   ` 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=31bff2df-40a1-21f7-e155-38028b2688e8@quicinc.com \
    --to=quic_khsieh@quicinc.com \
    --cc=agross@kernel.org \
    --cc=airlied@gmail.com \
    --cc=andersson@kernel.org \
    --cc=daniel@ffwll.ch \
    --cc=dianders@chromium.org \
    --cc=dmitry.baryshkov@linaro.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=freedreno@lists.freedesktop.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marijn.suijten@somainline.org \
    --cc=quic_abhinavk@quicinc.com \
    --cc=quic_jesszhan@quicinc.com \
    --cc=quic_sbillaka@quicinc.com \
    --cc=robdclark@gmail.com \
    --cc=sean@poorly.run \
    --cc=swboyd@chromium.org \
    --cc=vkoul@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®