All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 00/12] media: iris: Migrate iommus to iris sub nodes
@ 2026-07-31 18:22 Vikash Garodia
  2026-07-31 18:22 ` [PATCH v2 01/12] dt-bindings: media: qcom,venus: Add context bank subnodes to common schema Vikash Garodia
                   ` (11 more replies)
  0 siblings, 12 replies; 21+ messages in thread
From: Vikash Garodia @ 2026-07-31 18:22 UTC (permalink / raw)
  To: Dikshita Agarwal, Abhinav Kumar, Bryan O'Donoghue,
	Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Bjorn Andersson, Konrad Dybcio, Stanimir Varbanov,
	Neil Armstrong, Dmitry Baryshkov, Bryan O'Donoghue,
	Stephan Gerhold
  Cc: linux-media, linux-arm-msm, devicetree, linux-kernel,
	Konrad Dybcio, Vikash Garodia, stable, Daniel J Blueman,
	Vishnu Reddy

The VPU issues DMA through several SMMU streams, and the hardware does
not give every stream the same addressable range. The non-pixel stream
is restricted to use 0-600MB of IOVA space, while the pixel stream can 
address the full range:
    +-----------------------------------------------------------+
    | non-pixel stream addressable range (600 MB - 3.5 GB)      |
    | 0x25800000 - 0xe0000000                                   |
    +-----------------------------------------------------------+
    | pixel stream addressable range (0 - 3.5 GB)               |
    | 0x00000000 - 0xe0000000                                   |
    +-----------------------------------------------------------+

A single "iommus" property on the video-codec node puts every stream in
one IOMMU domain sharing one IOVA allocator, so nothing keeps a
non-pixel buffer inside the low 600 MB. Once an allocation lands below
that boundary the hardware faults, which shows up as unhandled SMMU page
faults and spontaneous reboots:
https://gitlab.freedesktop.org/drm/msm/-/work_items/100

Daniel, who reported the crash issue, have also raised a patch to workaround
the issue. While the patch partially handles the limitation, it is inefficient
in a way that it keep iris hardwares away from using the 600MB address space
for all the different streams.

To address this limitation, the subset of stream/s are now represented as
sub nodes, so that they can be associated to the respective addressable
range.
In the past, this limitation was tried with iommu-map approach, with iris
driver dynamically creating the devices. The approach was later concluded
as an hack to avoid having sub nodes and NAKed by iommu maintainers.
It was discussed in detail in the discussion
https://lore.kernel.org/all/c7b956a9-d3e8-4e18-b780-5d08f5cd2ca1@kernel.org/

It was agreed by maintainers to proceed with sub node approach to address
the VPU hardware limitation.

Stable branch handling - one of the suggestion was to bring the 
workaround on mainline and stable, and later revert it on mainline and
apply this series. This would ideally breach the binding policy of
adding something to describe the hardware and then reverting it. As per 
binding maintainer, the approach is not acceptable.
This series can be applied to mainline as well as -stable, and in the process
if there are any conflicts in stable, I would resolve them.

Signed-off-by: Vikash Garodia <vikash.garodia@oss.qualcomm.com>
---
Changes in v2:
- Fixed sashiko issues.
- Moved subnodes into common schema (Dmitry)
- Kept the firmware name as the one defained earlier (Dmitry)
- Added dma-ranges to specify parent-child address translation
- Moved context bank hooks to VPU ops (Dmitry)
- Updated commit description.
- Link to v1: https://lore.kernel.org/r/20260709-vpu_iommu_iova_handling-v1-0-72bb62cb2dfd@oss.qualcomm.com

---
Vikash Garodia (12):
      dt-bindings: media: qcom,venus: Add context bank subnodes to common schema
      dt-bindings: media: qcom,sm8550-iris: Add context bank subnodes
      media: iris: Add platform hooks for context bank device setup
      media: iris: Add helper to create a context bank device
      media: iris: Route buffers to the matching context bank device
      media: iris: Skip DMA mask setup when the core device has no IOMMU
      media: iris: Create pixel and non-pixel context banks on VPU3x
      arm64: dts: qcom: hamoa: Add Iris context bank subnodes
      arm64: dts: qcom: sm8550: Add Iris context bank subnodes
      arm64: dts: qcom: lemans: Add Iris context bank subnodes
      arm64: dts: qcom: monaco: Add Iris context bank subnodes
      arm64: dts: qcom: sm8650: Add Iris context bank subnodes

 .../bindings/media/qcom,sc7180-venus.yaml          | 15 -----
 .../bindings/media/qcom,sm8550-iris.yaml           | 18 +++++-
 .../bindings/media/qcom,venus-common.yaml          | 51 ++++++++++++++++
 arch/arm64/boot/dts/qcom/hamoa.dtsi                | 19 +++++-
 arch/arm64/boot/dts/qcom/lemans.dtsi               | 19 +++++-
 arch/arm64/boot/dts/qcom/monaco.dtsi               | 19 +++++-
 arch/arm64/boot/dts/qcom/qcs8550.dtsi              |  4 ++
 arch/arm64/boot/dts/qcom/sm8550.dtsi               | 19 +++++-
 arch/arm64/boot/dts/qcom/sm8650.dtsi               | 20 ++++++-
 drivers/media/platform/qcom/iris/iris_buffer.c     |  8 +--
 drivers/media/platform/qcom/iris/iris_core.h       |  4 ++
 drivers/media/platform/qcom/iris/iris_hfi_queue.c  | 16 ++---
 drivers/media/platform/qcom/iris/iris_probe.c      | 33 +++++++++--
 drivers/media/platform/qcom/iris/iris_resources.c  | 69 ++++++++++++++++++++++
 drivers/media/platform/qcom/iris/iris_resources.h  |  2 +
 drivers/media/platform/qcom/iris/iris_vidc.c       |  4 +-
 drivers/media/platform/qcom/iris/iris_vpu3x.c      | 38 ++++++++++++
 drivers/media/platform/qcom/iris/iris_vpu_common.h |  2 +
 18 files changed, 314 insertions(+), 46 deletions(-)
---
base-commit: 95d6a9ccef99117115e41e9adb271243bd5e985b
change-id: 20260701-vpu_iommu_iova_handling-556e969a1f1c

Best regards,
-- 
Vikash Garodia <vikash.garodia@oss.qualcomm.com>


^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2026-07-31 20:36 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-31 18:22 [PATCH v2 00/12] media: iris: Migrate iommus to iris sub nodes Vikash Garodia
2026-07-31 18:22 ` [PATCH v2 01/12] dt-bindings: media: qcom,venus: Add context bank subnodes to common schema Vikash Garodia
2026-07-31 18:36   ` sashiko-bot
2026-07-31 18:22 ` [PATCH v2 02/12] dt-bindings: media: qcom,sm8550-iris: Add context bank subnodes Vikash Garodia
2026-07-31 18:31   ` sashiko-bot
2026-07-31 20:36   ` Rob Herring (Arm)
2026-07-31 18:22 ` [PATCH v2 03/12] media: iris: Add platform hooks for context bank device setup Vikash Garodia
2026-07-31 18:36   ` sashiko-bot
2026-07-31 18:22 ` [PATCH v2 04/12] media: iris: Add helper to create a context bank device Vikash Garodia
2026-07-31 18:22 ` [PATCH v2 05/12] media: iris: Route buffers to the matching " Vikash Garodia
2026-07-31 18:57   ` sashiko-bot
2026-07-31 18:22 ` [PATCH v2 06/12] media: iris: Skip DMA mask setup when the core device has no IOMMU Vikash Garodia
2026-07-31 18:43   ` sashiko-bot
2026-07-31 18:22 ` [PATCH v2 07/12] media: iris: Create pixel and non-pixel context banks on VPU3x Vikash Garodia
2026-07-31 18:41   ` sashiko-bot
2026-07-31 18:22 ` [PATCH v2 08/12] arm64: dts: qcom: hamoa: Add Iris context bank subnodes Vikash Garodia
2026-07-31 18:22 ` [PATCH v2 09/12] arm64: dts: qcom: sm8550: " Vikash Garodia
2026-07-31 18:38   ` sashiko-bot
2026-07-31 18:22 ` [PATCH v2 10/12] arm64: dts: qcom: lemans: " Vikash Garodia
2026-07-31 18:22 ` [PATCH v2 11/12] arm64: dts: qcom: monaco: " Vikash Garodia
2026-07-31 18:22 ` [PATCH v2 12/12] arm64: dts: qcom: sm8650: " Vikash Garodia

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.