mbox series

[v5,0/5] Improve GPU reset sequence for Adreno GPU

Message ID 1672656511-1931-1-git-send-email-quic_akhilpo@quicinc.com
Headers show
Series Improve GPU reset sequence for Adreno GPU | expand

Message

Akhil P Oommen Jan. 2, 2023, 10:48 a.m. UTC
This is a rework of [1] using genpd instead of 'reset' framework.

As per the recommended reset sequence of Adreno gpu, we should ensure that
gpucc-cx-gdsc has collapsed at hardware to reset gpu's internal hardware states.
Because this gdsc is implemented as 'votable', gdsc driver doesn't poll and
wait until its hw status says OFF.

So use the newly introduced genpd api (dev_pm_genpd_synced_poweroff()) to
provide a hint to the gdsc driver to poll for the hw status and use genpd
notifier to wait from adreno gpu driver until gdsc is turned OFF.

This series is rebased on top of linux-next (20221215) since the changes span
multiple drivers.

[1] https://patchwork.freedesktop.org/series/107507/

Changes in v5:
- Capture all Reviewed-by tags

Changes in v4:
- Update genpd function documentation (Ulf)

Changes in v3:
- Rename the var 'force_sync' to 'wait (Stephen)

Changes in v2:
- Minor formatting fix
- Select PM_GENERIC_DOMAINS from Kconfig

Akhil P Oommen (4):
  clk: qcom: gdsc: Support 'synced_poweroff' genpd flag
  drm/msm/a6xx: Vote for cx gdsc from gpu driver
  drm/msm/a6xx: Remove cx gdsc polling using 'reset'
  drm/msm/a6xx: Use genpd notifier to ensure cx-gdsc collapse

Ulf Hansson (1):
  PM: domains: Allow a genpd consumer to require a synced power off

 drivers/base/power/domain.c           | 26 ++++++++++++++++++++
 drivers/clk/qcom/gdsc.c               | 11 +++++----
 drivers/gpu/drm/msm/Kconfig           |  1 +
 drivers/gpu/drm/msm/adreno/a6xx_gmu.c | 46 ++++++++++++++++++++++++++++++++---
 drivers/gpu/drm/msm/adreno/a6xx_gmu.h |  7 ++++++
 drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 13 +++++++---
 drivers/gpu/drm/msm/msm_gpu.c         |  4 ---
 drivers/gpu/drm/msm/msm_gpu.h         |  4 ---
 include/linux/pm_domain.h             |  5 ++++
 9 files changed, 97 insertions(+), 20 deletions(-)

Comments

Philipp Zabel Jan. 2, 2023, 3:21 p.m. UTC | #1
On Mon, Jan 02, 2023 at 04:18:30PM +0530, Akhil P Oommen wrote:
> Remove the unused 'reset' interface which was supposed to help to ensure
> that cx gdsc has collapsed during gpu recovery. This is was not enabled
> so far due to missing gpucc driver support. Similar functionality using
> genpd framework will be implemented in the upcoming patch.
> 
> This effectively reverts commit 1f6cca404918
> ("drm/msm/a6xx: Ensure CX collapse during gpu recovery").
> 
> Signed-off-by: Akhil P Oommen <quic_akhilpo@quicinc.com>
> Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>

Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>

regards
Philipp
Bjorn Andersson Jan. 10, 2023, 5:16 p.m. UTC | #2
On Mon, Jan 02, 2023 at 04:18:26PM +0530, Akhil P Oommen wrote:
> 
> This is a rework of [1] using genpd instead of 'reset' framework.
> 
> As per the recommended reset sequence of Adreno gpu, we should ensure that
> gpucc-cx-gdsc has collapsed at hardware to reset gpu's internal hardware states.
> Because this gdsc is implemented as 'votable', gdsc driver doesn't poll and
> wait until its hw status says OFF.
> 
> So use the newly introduced genpd api (dev_pm_genpd_synced_poweroff()) to
> provide a hint to the gdsc driver to poll for the hw status and use genpd
> notifier to wait from adreno gpu driver until gdsc is turned OFF.
> 
> This series is rebased on top of linux-next (20221215) since the changes span
> multiple drivers.
> 
> [1] https://patchwork.freedesktop.org/series/107507/
> 

@Rob, please find the PM and gdsc implementation changes picked up here:

  https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux.git tags/1672656511-1931-1-git-send-email-quic_akhilpo@quicinc.com

Regards,
Bjorn

> Changes in v5:
> - Capture all Reviewed-by tags
> 
> Changes in v4:
> - Update genpd function documentation (Ulf)
> 
> Changes in v3:
> - Rename the var 'force_sync' to 'wait (Stephen)
> 
> Changes in v2:
> - Minor formatting fix
> - Select PM_GENERIC_DOMAINS from Kconfig
> 
> Akhil P Oommen (4):
>   clk: qcom: gdsc: Support 'synced_poweroff' genpd flag
>   drm/msm/a6xx: Vote for cx gdsc from gpu driver
>   drm/msm/a6xx: Remove cx gdsc polling using 'reset'
>   drm/msm/a6xx: Use genpd notifier to ensure cx-gdsc collapse
> 
> Ulf Hansson (1):
>   PM: domains: Allow a genpd consumer to require a synced power off
> 
>  drivers/base/power/domain.c           | 26 ++++++++++++++++++++
>  drivers/clk/qcom/gdsc.c               | 11 +++++----
>  drivers/gpu/drm/msm/Kconfig           |  1 +
>  drivers/gpu/drm/msm/adreno/a6xx_gmu.c | 46 ++++++++++++++++++++++++++++++++---
>  drivers/gpu/drm/msm/adreno/a6xx_gmu.h |  7 ++++++
>  drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 13 +++++++---
>  drivers/gpu/drm/msm/msm_gpu.c         |  4 ---
>  drivers/gpu/drm/msm/msm_gpu.h         |  4 ---
>  include/linux/pm_domain.h             |  5 ++++
>  9 files changed, 97 insertions(+), 20 deletions(-)
> 
> -- 
> 2.7.4
>
Bjorn Andersson Jan. 10, 2023, 5:17 p.m. UTC | #3
On Mon, 2 Jan 2023 16:18:26 +0530, Akhil P Oommen wrote:
> This is a rework of [1] using genpd instead of 'reset' framework.
> 
> As per the recommended reset sequence of Adreno gpu, we should ensure that
> gpucc-cx-gdsc has collapsed at hardware to reset gpu's internal hardware states.
> Because this gdsc is implemented as 'votable', gdsc driver doesn't poll and
> wait until its hw status says OFF.
> 
> [...]

Applied, thanks!

[1/5] PM: domains: Allow a genpd consumer to require a synced power off
      commit: a9236a0aa7d7f52a974cc7eaa971fae92aa477c5
[2/5] clk: qcom: gdsc: Support 'synced_poweroff' genpd flag
      commit: 8b6af3b58cafc2cbdf6269f655b2d3731eb93c2f

Best regards,