Skip to content

drm/vc4: Reset the V3D block through the reset controller

Maíra Canal dri-devel linux-arm-kernel linux-devicetree 2 versions – Applied

Status from this message: Applied, thanks!

Get series with b4
b4 am [email protected] change-id 20260812-vc4-reset-control-cddf3eb8a9e9

Versions newest first

  1. v2 Latest4 patches 2 repliesApplied
  2. v14 patches 12 repliesSuperseded

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/4drm/vc4: Drop the undocumented brcm,vc4-v3d compatibledrivers/gpu/drm/vc4/vc4_drv.c drivers/gpu/drm/vc4/vc4_v3d.c+0 -20 replies
2/4dt-bindings: display: bcm2835-v3d: Add an optional reset lineDocumentation/devicetree/bindings/display/brcm,bcm2835-v3d.yaml+3 -01 reply
3/4drm/vc4: Use the reset controller to recover from a GPU hangdrivers/gpu/drm/vc4/vc4_drv.h drivers/gpu/drm/vc4/vc4_gem.c drivers/gpu/drm/vc4/vc4_irq.c +1 more+47 -490 replies
4/4ARM: dts: bcm2835: Add the V3D reset linearch/arm/boot/dts/broadcom/bcm2835-common.dtsi+1 -00 replies

Reviews trailers per patch

All 4 patches have a Reviewed-by or Acked-by.

PatchFlorian FainelliKrzysztof KozlowskiStefan Wahren
1/4R-b A-b
2/4A-b R-b
3/4R-b
4/4R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v2 thread

Cover letter [PATCH v2 0/4] drm/vc4: Reset the V3D block through the reset controller

vc4_reset() recovers a hung GPU by dropping the runtime PM usage count to zero so that the V3D power domain goes down, and then taking it again. Forcing the count to zero only works if the driver knows exactly how many references it holds, which is why vc4 unconventionaly wraps every pm_runtime_get_sync() call in a private refcount and mutex, making the code cumbersome.

The BCM2835 PM block has exposed a reset line for the V3D block since commit 670c672608a1 ("soc: bcm: bcm2835-pm: Add support for power domains under a new binding."), added for exactly this reason, but vc4 never picked it up. This series switches vc4 over to it and drops the private refcount, leaving vc4_v3d_pm_get/put() as plain runtime PM wrappers.

The reset line is optional, so device trees that do not describe one keep
working: they get the driver-side recovery in vc4_irq_reset() while the hardware is left untouched. Of the two in-tree platforms,

1. BCM2835 gains the property in PATCH 4.
2. Cygnus has no V3D power domain to begin with, so the power-cycle only ever gated its clock there.

PATCH 1 is an independent cleanup. "brcm,vc4-v3d" was never documented and was never used by any in-tree device tree, so it is a candidate for removal on its own.

This series was tested on the Raspberry Pi 3B and 3B+.

Best regards,
- Maíra

---
v1 -> v2: https://lore.kernel.org/r/[email protected]

- [1/4, 2/4, 3/4, 4/4] Add R-b and A-b tags from Krzysztof, Florian, and Stefan.
- [2/4] Rewrite commit message (Stefan, Krzysztof)

---
Maíra Canal (4):
drm/vc4: Drop the undocumented brcm,vc4-v3d compatible
dt-bindings: display: bcm2835-v3d: Add an optional reset line drm/vc4: Use the reset controller to recover from a GPU hang
ARM: dts: bcm2835: Add the V3D reset line

 .../bindings/display/brcm,bcm2835-v3d.yaml         |  3 ++
 arch/arm/boot/dts/broadcom/bcm2835-common.dtsi     |  1 +
 drivers/gpu/drm/vc4/vc4_drv.c                      |  1 -
 drivers/gpu/drm/vc4/vc4_drv.h                      | 13 ++++---
 drivers/gpu/drm/vc4/vc4_gem.c                      | 40 +++++++++++++---------
 drivers/gpu/drm/vc4/vc4_irq.c                      |  7 ++--
 drivers/gpu/drm/vc4/vc4_v3d.c                      | 37 +++++++-------------
 7 files changed, 51 insertions(+), 51 deletions(-)

---
base-commit: 5363e01e4ff03a204cab85292b89cf90c2d1b101
change-id: 20260812-vc4-reset-control-cddf3eb8a9e9