Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Dmitry Baryshkov" <dmitry.baryshkov@oss.qualcomm.com>
Cc: robh@kernel.org, conor+dt@kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH 11/12] iommu: qcom_iommu: add the MSM8974 instances
Date: Sun, 09 Aug 2026 20:28:44 +0000	[thread overview]
Message-ID: <20260809202845.3E4141F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260809-msm8974-iommu-upstream-v1-11-87f5cd492560@oss.qualcomm.com>

Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:

New issues:
- [Medium] The commit message claims to add per-instance configurations for five MSM8974 IOMMUs (explicitly mentioning camera blocks), but only three are provided.
- [Low] The Venus IOMMU is configured to halt the micro-MMU, but the commit message only justifies this behavior for the display (MDP) IOMMU.

Pre-existing issues:
- [High] This problem wasn't introduced by this patch, but the qcom_iommu_fault interrupt handler accesses device hardware registers directly without checking the device's PM state.
--

--- Patch [11]: [PATCH 11/12] iommu: qcom_iommu: add the MSM8974 instances ---
commit bfa29c5d93fde62303c2c0ea8deeb5f5b59f6431
Author: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>

iommu: qcom_iommu: add the MSM8974 instances

This commit adds per-instance configurations for MSM8974 IOMMUs. It configures
them to terminate faulting transactions rather than stalling.

> Add the per-instance configurations for the five MSM8974 IOMMUs. MDP and
> Venus are TZ-secured (SCM secure IDs 1 and 0), so only their context
> banks are programmed, like on MSM8916. GPU is fully OS-managed. The
> stream ID maps come from the downstream MSM8974-v2 DT. All instances use
> the short-descriptor pagetable format with the AFE quirk.

[Severity: Medium]
The commit message claims to add per-instance configurations for five
MSM8974 IOMMUs, but only three are provided in this patch. Are the other
instances missing from the patch, or does the commit message need updating?

> All instances terminate faulting transactions rather than stalling them,
> as downstream does. The display IOMMU also halts the micro-MMU while its
> context banks are programmed: a hung GPU cannot drain, so halting it
> during GPU recovery resets the SoC.

[Severity: Low]
Does the Venus IOMMU also need to halt the micro-MMU? The commit message
only justifies this behavior for the display (MDP) IOMMU, but the Venus
configuration in msm8974_venus_cfg sets halt = true. Could the commit
message be expanded to document this?

> diff --git a/drivers/iommu/arm/arm-smmu/qcom_iommu.c b/drivers/iommu/arm/arm-smmu/qcom_iommu.c
> index 9523ae95fa125..bc7d692a20436 100644
> --- a/drivers/iommu/arm/arm-smmu/qcom_iommu.c
> +++ b/drivers/iommu/arm/arm-smmu/qcom_iommu.c

[ ... ]

> +static const struct qcom_iommu_cfg msm8974_venus_cfg = {
> +	.halt = true,
> +	.no_stall = true,
> +	.fmt = ARM_V7S,
> +	.no_afe = true,
> +	.ctx_restore = true,
> +	.bfb = msm8974_venus_bfb,
> +	.num_bfb = ARRAY_SIZE(msm8974_venus_bfb),
> +};

[ ... ]

>  static const struct of_device_id qcom_iommu_of_match[] = {
>  	{ .compatible = "qcom,msm-iommu-v1" },
>  	{ .compatible = "qcom,msm-iommu-v2" },
> +	{ .compatible = "qcom,msm8974-gpu-iommu", .data = &msm8974_gpu_cfg },
> +	{ .compatible = "qcom,msm8974-mdp-iommu", .data = &msm8974_mdp_cfg },
> +	{ .compatible = "qcom,msm8974-venus-iommu", .data = &msm8974_venus_cfg },
>  	{ /* sentinel */ }
>  };

[Severity: High]
This is a pre-existing issue, but the qcom_iommu_fault interrupt handler
accesses hardware registers directly without checking the device PM state:

drivers/iommu/arm/arm-smmu/qcom_iommu.c:qcom_iommu_fault() {
    ...
	fsr = iommu_readl(ctx, ARM_SMMU_CB_FSR);

	if (!(fsr & ARM_SMMU_CB_FSR_FAULT))
		return IRQ_NONE;
    ...
}

Because the interrupt is shared (IRQF_SHARED), an interrupt from another
device on the same line could trigger this handler while the IOMMU is in a
suspended PM state. Can reading from the unpowered hardware register
ARM_SMMU_CB_FSR cause a bus stall or return 0xffffffff? Should the handler
use pm_runtime_get_if_active before accessing the registers?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260809-msm8974-iommu-upstream-v1-0-87f5cd492560@oss.qualcomm.com?part=11

  reply	other threads:[~2026-08-09 20:28 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-09 20:15 [PATCH 00/12] iommu: qcom_iommu: implement support for instances on MSM8974 Dmitry Baryshkov
2026-08-09 20:15 ` [PATCH 01/12] dt-bindings: iommu: qcom,iommu: document the MSM8974 IOMMUs Dmitry Baryshkov
2026-08-09 20:28   ` sashiko-bot
2026-08-09 20:15 ` [PATCH 02/12] iommu: arm-smmu: add global register definitions used by the QSMMU Dmitry Baryshkov
2026-08-09 20:15 ` [PATCH 03/12] iommu: qcom_iommu: extract context bank programming into a helper Dmitry Baryshkov
2026-08-09 20:27   ` sashiko-bot
2026-08-09 20:15 ` [PATCH 04/12] iommu: qcom_iommu: support the short-descriptor pagetable format Dmitry Baryshkov
2026-08-09 20:30   ` sashiko-bot
2026-08-09 20:15 ` [PATCH 05/12] iommu: qcom_iommu: handle the SMMU global register space Dmitry Baryshkov
2026-08-09 20:29   ` sashiko-bot
2026-08-09 20:15 ` [PATCH 06/12] iommu: qcom_iommu: support non-TZ-managed instances Dmitry Baryshkov
2026-08-09 20:39   ` sashiko-bot
2026-08-09 20:15 ` [PATCH 07/12] iommu: qcom_iommu: restore context bank state after power collapse Dmitry Baryshkov
2026-08-09 20:28   ` sashiko-bot
2026-08-09 20:15 ` [PATCH 08/12] iommu: qcom_iommu: halt the micro-MMU while programming context banks Dmitry Baryshkov
2026-08-09 20:33   ` sashiko-bot
2026-08-09 20:15 ` [PATCH 09/12] iommu: qcom_iommu: allow faulting transactions to terminate Dmitry Baryshkov
2026-08-09 20:28   ` sashiko-bot
2026-08-09 20:15 ` [PATCH 10/12] iommu: qcom_iommu: program BFP (prefetch) settings Dmitry Baryshkov
2026-08-09 20:28   ` sashiko-bot
2026-08-09 20:15 ` [PATCH 11/12] iommu: qcom_iommu: add the MSM8974 instances Dmitry Baryshkov
2026-08-09 20:28   ` sashiko-bot [this message]
2026-08-09 20:15 ` [PATCH 12/12] ARM: dts: qcom: msm8974: add the IOMMUs Dmitry Baryshkov
2026-08-10 10:16 ` [PATCH 00/12] iommu: qcom_iommu: implement support for instances on MSM8974 Luca Weiss

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=20260809202845.3E4141F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.baryshkov@oss.qualcomm.com \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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