From: Akhil P Oommen <quic_akhilpo@quicinc.com>
To: Rob Clark <robdclark@gmail.com>
Cc: freedreno <freedreno@lists.freedesktop.org>,
<dri-devel@lists.freedesktop.org>,
<linux-arm-msm@vger.kernel.org>,
"Bjorn Andersson" <bjorn.andersson@linaro.org>,
Jordan Crouse <jordan@cosmicpenguin.net>,
Jonathan Marek <jonathan@marek.ca>,
"Douglas Anderson" <dianders@chromium.org>,
Matthias Kaehlcke <mka@chromium.org>,
Abhinav Kumar <quic_abhinavk@quicinc.com>,
Daniel Vetter <daniel@ffwll.ch>, David Airlie <airlied@linux.ie>,
Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
Sean Paul <sean@poorly.run>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3 2/8] drm/msm: Take single rpm refcount on behalf of all submits
Date: Sun, 31 Jul 2022 22:02:32 +0530 [thread overview]
Message-ID: <d7f95663-c0f7-8227-dbc0-fac43bdf6faa@quicinc.com> (raw)
In-Reply-To: <CAF6AEGs7zKDoRY=ijxFQvaZig=UiSPgWkJFA-PY2MTxKWr5bpw@mail.gmail.com>
On 7/31/2022 9:26 PM, Rob Clark wrote:
> On Sat, Jul 30, 2022 at 2:41 AM Akhil P Oommen <quic_akhilpo@quicinc.com> wrote:
>> Instead of separate refcount for each submit, take single rpm refcount
>> on behalf of all the submits. This makes it easier to drop the rpm
>> refcount during recovery in an upcoming patch.
>>
>> Signed-off-by: Akhil P Oommen <quic_akhilpo@quicinc.com>
>> ---
>>
>> (no changes since v1)
> I see no earlier version of this patch?
>
>> drivers/gpu/drm/msm/msm_gpu.c | 12 ++++++++----
>> 1 file changed, 8 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/msm/msm_gpu.c b/drivers/gpu/drm/msm/msm_gpu.c
>> index c8cd9bf..e1dd3cc 100644
>> --- a/drivers/gpu/drm/msm/msm_gpu.c
>> +++ b/drivers/gpu/drm/msm/msm_gpu.c
>> @@ -663,11 +663,12 @@ static void retire_submit(struct msm_gpu *gpu, struct msm_ringbuffer *ring,
>> mutex_lock(&gpu->active_lock);
>> gpu->active_submits--;
>> WARN_ON(gpu->active_submits < 0);
>> - if (!gpu->active_submits)
>> + if (!gpu->active_submits) {
>> msm_devfreq_idle(gpu);
>> - mutex_unlock(&gpu->active_lock);
>> + pm_runtime_put_autosuspend(&gpu->pdev->dev);
>> + }
>>
>> - pm_runtime_put_autosuspend(&gpu->pdev->dev);
>> + mutex_unlock(&gpu->active_lock);
>>
>> msm_gem_submit_put(submit);
>> }
>> @@ -756,14 +757,17 @@ void msm_gpu_submit(struct msm_gpu *gpu, struct msm_gem_submit *submit)
>>
>> /* Update devfreq on transition from idle->active: */
>> mutex_lock(&gpu->active_lock);
>> - if (!gpu->active_submits)
>> + if (!gpu->active_submits) {
>> + pm_runtime_get(&gpu->pdev->dev);
>> msm_devfreq_active(gpu);
>> + }
>> gpu->active_submits++;
>> mutex_unlock(&gpu->active_lock);
>>
>> gpu->funcs->submit(gpu, submit);
>> gpu->cur_ctx_seqno = submit->queue->ctx->seqno;
>>
>> + pm_runtime_put(&gpu->pdev->dev);
> this looks unbalanced?
There is another pm_runtime_get_sync at the top of this function. Just
before hw_init().
https://elixir.bootlin.com/linux/v5.19-rc8/source/drivers/gpu/drm/msm/msm_gpu.c#L737
-Akhil.
>
> BR,
> -R
>
>> hangcheck_timer_reset(gpu);
>> }
>>
>> --
>> 2.7.4
>>
next prev parent reply other threads:[~2022-07-31 16:33 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-30 9:40 [PATCH v3 0/8] Improve GPU Recovery Akhil P Oommen
2022-07-30 9:40 ` [PATCH v3 1/8] drm/msm: Remove unnecessary pm_runtime_get/put Akhil P Oommen
2022-07-31 15:55 ` Rob Clark
2022-08-01 14:32 ` Akhil P Oommen
2022-07-30 9:40 ` [PATCH v3 2/8] drm/msm: Take single rpm refcount on behalf of all submits Akhil P Oommen
2022-07-31 15:56 ` Rob Clark
2022-07-31 16:32 ` Akhil P Oommen [this message]
2022-07-31 22:15 ` Rob Clark
2022-08-01 14:35 ` Akhil P Oommen
2022-07-30 9:40 ` [PATCH v3 3/8] drm/msm: Correct pm_runtime votes in recover worker Akhil P Oommen
2022-07-30 9:40 ` [PATCH v3 4/8] drm/msm: Fix cx collapse issue during recovery Akhil P Oommen
2022-07-31 16:22 ` Rob Clark
2022-08-01 15:10 ` Akhil P Oommen
2022-07-30 9:40 ` [PATCH v3 5/8] drm/msm/a6xx: Ensure CX collapse during gpu recovery Akhil P Oommen
2022-08-02 7:14 ` Dmitry Baryshkov
2022-08-03 10:15 ` Akhil P Oommen
2022-08-03 11:09 ` Dmitry Baryshkov
2022-07-30 9:40 ` [PATCH v3 6/8] drm/msm/adreno: Remove a WARN() during runtime_suspend Akhil P Oommen
2022-07-30 9:40 ` [PATCH v3 7/8] drm/msm/a6xx: Improve gpu recovery sequence Akhil P Oommen
2022-07-30 9:40 ` [PATCH v3 8/8] drm/msm/a6xx: Handle GMU prepare-slumber hfi failure Akhil P Oommen
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=d7f95663-c0f7-8227-dbc0-fac43bdf6faa@quicinc.com \
--to=quic_akhilpo@quicinc.com \
--cc=airlied@linux.ie \
--cc=bjorn.andersson@linaro.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=jonathan@marek.ca \
--cc=jordan@cosmicpenguin.net \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mka@chromium.org \
--cc=quic_abhinavk@quicinc.com \
--cc=robdclark@gmail.com \
--cc=sean@poorly.run \
/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