From: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
To: Akhil P Oommen <quic_akhilpo@quicinc.com>,
freedreno <freedreno@lists.freedesktop.org>,
dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org,
Rob Clark <robdclark@gmail.com>,
Bjorn Andersson <bjorn.andersson@linaro.org>
Cc: 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>,
Chia-I Wu <olvaffe@gmail.com>, Daniel Vetter <daniel@ffwll.ch>,
David Airlie <airlied@linux.ie>,
Philipp Zabel <p.zabel@pengutronix.de>,
Sean Paul <sean@poorly.run>, Stephen Boyd <swboyd@chromium.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 5/8] drm/msm/a6xx: Ensure CX collapse during gpu recovery
Date: Tue, 2 Aug 2022 10:14:09 +0300 [thread overview]
Message-ID: <8715e07f-9d58-1ae3-9a3a-25828b545905@linaro.org> (raw)
In-Reply-To: <20220730150952.v3.5.I176567525af2b9439a7e485d0ca130528666a55c@changeid>
On 30/07/2022 12:40, Akhil P Oommen wrote:
> Because there could be transient votes from other drivers/tz/hyp which
> may keep the cx gdsc enabled, we should poll until cx gdsc collapses.
> We can use the reset framework to poll for cx gdsc collapse from gpucc
> clk driver.
>
> This feature requires support from the platform's gpucc driver.
>
> Signed-off-by: Akhil P Oommen <quic_akhilpo@quicinc.com>
> ---
>
> Changes in v3:
> - Use reset interface from gpucc driver to poll for cx gdsc collapse
> https://patchwork.freedesktop.org/series/106860/
>
> drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 4 ++++
> drivers/gpu/drm/msm/msm_gpu.c | 4 ++++
> drivers/gpu/drm/msm/msm_gpu.h | 4 ++++
> 3 files changed, 12 insertions(+)
>
> diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
> index 1b049c5..721d5e6 100644
> --- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
> +++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
> @@ -10,6 +10,7 @@
>
> #include <linux/bitfield.h>
> #include <linux/devfreq.h>
> +#include <linux/reset.h>
> #include <linux/soc/qcom/llcc-qcom.h>
>
> #define GPU_PAS_ID 13
> @@ -1224,6 +1225,9 @@ static void a6xx_recover(struct msm_gpu *gpu)
> /* And the final one from recover worker */
> pm_runtime_put_sync(&gpu->pdev->dev);
>
> + /* Call into gpucc driver to poll for cx gdsc collapse */
> + reset_control_reset(gpu->cx_collapse);
Do we have a race between the last pm_runtime_put_sync(), this polling
and other voters removing their votes beforehand?
> +
> pm_runtime_use_autosuspend(&gpu->pdev->dev);
>
> if (active_submits)
> diff --git a/drivers/gpu/drm/msm/msm_gpu.c b/drivers/gpu/drm/msm/msm_gpu.c
> index 07e55a6..4a57627 100644
> --- a/drivers/gpu/drm/msm/msm_gpu.c
> +++ b/drivers/gpu/drm/msm/msm_gpu.c
> @@ -14,6 +14,7 @@
> #include <generated/utsrelease.h>
> #include <linux/string_helpers.h>
> #include <linux/devcoredump.h>
> +#include <linux/reset.h>
> #include <linux/sched/task.h>
>
> /*
> @@ -903,6 +904,9 @@ int msm_gpu_init(struct drm_device *drm, struct platform_device *pdev,
> if (IS_ERR(gpu->gpu_cx))
> gpu->gpu_cx = NULL;
>
> + gpu->cx_collapse = devm_reset_control_get_optional(&pdev->dev,
> + "cx_collapse");
> +
> gpu->pdev = pdev;
> platform_set_drvdata(pdev, &gpu->adreno_smmu);
>
> diff --git a/drivers/gpu/drm/msm/msm_gpu.h b/drivers/gpu/drm/msm/msm_gpu.h
> index 6def008..ab59fd2 100644
> --- a/drivers/gpu/drm/msm/msm_gpu.h
> +++ b/drivers/gpu/drm/msm/msm_gpu.h
> @@ -13,6 +13,7 @@
> #include <linux/interconnect.h>
> #include <linux/pm_opp.h>
> #include <linux/regulator/consumer.h>
> +#include <linux/reset.h>
>
> #include "msm_drv.h"
> #include "msm_fence.h"
> @@ -268,6 +269,9 @@ struct msm_gpu {
> bool hw_apriv;
>
> struct thermal_cooling_device *cooling;
> +
> + /* To poll for cx gdsc collapse during gpu recovery */
> + struct reset_control *cx_collapse;
> };
>
> static inline struct msm_gpu *dev_to_gpu(struct device *dev)
--
With best wishes
Dmitry
next prev parent reply other threads:[~2022-08-02 7:14 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
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 [this message]
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=8715e07f-9d58-1ae3-9a3a-25828b545905@linaro.org \
--to=dmitry.baryshkov@linaro.org \
--cc=airlied@linux.ie \
--cc=bjorn.andersson@linaro.org \
--cc=daniel@ffwll.ch \
--cc=dianders@chromium.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=olvaffe@gmail.com \
--cc=p.zabel@pengutronix.de \
--cc=quic_abhinavk@quicinc.com \
--cc=quic_akhilpo@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