Re: [PATCH 14/22] arm64: dts: qcom: msm8916: Reserve low IOVA range for Venus

[email protected]
Newsgroups org.kernel.vger.linux-devicetree
Message-ID <[email protected]>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] The IOVA reservation added for Venus is ineffective because the qcom-iommu driver does not implement the `.get_resv_regions` callback.
--

--- Patch [14]: [PATCH 14/22] arm64: dts: qcom: msm8916: Reserve low IOVA range for Venus ---
commit d8c0142deff84cf404f92b187d9bada3c787a2bb
Author: Vikash Garodia <[email protected]>

arm64: dts: qcom: msm8916: Reserve low IOVA range for Venus

This commit reserves the IOVA address range below 0x25800000 for the
Venus VPU to prevent unhandled SMMU page faults and spontaneous reboots
during video decode. It adds a reserved-memory IOVA node and references
it in the venus node.

> diff --git a/arch/arm64/boot/dts/qcom/msm8916.dtsi b/arch/arm64/boot/dts/qcom/msm8916.dtsi
> index e39743e220438..b9f63d9f2c775 100644
> --- a/arch/arm64/boot/dts/qcom/msm8916.dtsi
> +++ b/arch/arm64/boot/dts/qcom/msm8916.dtsi
[ ... ]
> @@ -114,6 +114,17 @@ mba_mem: mba {
>  			no-map;
>  			status = "disabled";
>  		};
> +
> +		/*
> +		 * The Venus VPU reserves IOVA below 0x25800000 (600MB),
> +		 * primarily for non-pixel buffers using different Stream IDs.
> +		 * DMA into that range triggers unhandled SMMU faults and
> +		 * spontaneous reboots, so reserve it to keep IOMMU
> +		 * allocations above this boundary.
> +		 */
> +		venus_iova: venus-iova {
> +			iommu-addresses = <&venus 0x0 0x25800000>;
> +		};

[Severity: High]
Is this reservation effective on this platform? 

Looking at the qcom-iommu driver used by apps_iommu, the qcom_iommu_ops
structure does not implement the .get_resv_regions callback:

drivers/iommu/arm/arm-smmu/qcom_iommu.c:qcom_iommu_ops {
	static const struct iommu_ops qcom_iommu_ops = {
		.identity_domain = &qcom_iommu_identity_domain,
		.capable         = qcom_iommu_capable,
		...
	};
}

Without this callback, iommu_get_resv_regions() will return an empty list
and silently ignore the iommu-addresses property defined in the device tree.

Could this allow the DMA API to continue allocating IOVA addresses in the
reserved range, thereby still triggering the SMMU faults and system reboots?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=14
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.