From: sashiko-bot@kernel.org
To: "Pranjal Shrivastava" <praan@google.com>
Cc: linux-pci@vger.kernel.org
Subject: Re: [PATCH v6 4/6] iommu/arm-smmu-v3: Standardize ATS enablement failure reporting
Date: Fri, 29 May 2026 13:44:46 +0000 [thread overview]
Message-ID: <20260529134447.292921F00893@smtp.kernel.org> (raw)
In-Reply-To: <20260529111208.387412-5-praan@google.com>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Medium] The error message drops the specific device context.
- [Low] State-mutating function call placed inside WARN() macro condition.
--
commit f858943c568bf1c4936c2371054b39b080e8ae6a
Author: Pranjal Shrivastava <praan@google.com>
iommu/arm-smmu-v3: Standardize ATS enablement failure reporting
This commit moves failable ATS configuration to the probe phase and
updates the commit phase to use WARN() for enablement failures. Since
hardware capabilities are verified earlier, failures here are considered
kernel bugs.
Link: https://lore.kernel.org/all/cover.1779392420.git.nicolinc@nvidia.com/
> diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
> --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
> +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
[ ... ]
> @@ -2956,8 +2956,14 @@ static void arm_smmu_enable_ats(struct arm_smmu_master *master)
> * ATC invalidation of PASID 0 causes the entire ATC to be flushed.
> */
> arm_smmu_atc_inv_master(master, IOMMU_NO_PASID);
> - if (pci_enable_ats(pdev, stu))
> - dev_err(master->dev, "Failed to enable ATS (STU %zu)\n", stu);
> +
> + /*
> + * Any failure at this point is a kernel bug. pci_ats_supported()
> + * and pci_prepare_ats() have already verified the hardware capability
> + * and programmed the STU. Thus, pci_enable_ats() should not fail here.
> + */
> + WARN(pci_enable_ats(pdev, stu),
> + "Failed to enable ATS (STU %zu)\n", stu);
[Severity: Low]
Does placing a state-mutating function like pci_enable_ats() directly inside
the WARN() macro condition hide essential hardware configuration logic?
While Linux's generic WARN() macro currently evaluates its condition exactly
once, placing this logic inside an error-reporting macro can degrade code
readability and break developer expectations. Could the function call be
extracted and its return value evaluated instead?
[Severity: Medium]
Does this change drop the specific device context from the error message?
The previous dev_err() call automatically prefixed the log message with the
specific device's identifier (like its PCI BDF address), which is crucial
for determining exactly which hardware component failed. By switching to a
generic WARN(), this device context is lost.
Would it be better to use dev_WARN(master->dev, ...) or explicitly include
dev_name(master->dev) in the format string to preserve observability for
debugging specific hardware failures?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260529111208.387412-1-praan@google.com?part=4
next prev parent reply other threads:[~2026-05-29 13:44 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-29 11:12 [PATCH v6 0/6] iommu: Standardize ATS robustness and state tracking Pranjal Shrivastava
2026-05-29 11:12 ` [PATCH v6 1/6] PCI/ATS: Ensure pci_ats_supported() is PF-aware for VFs Pranjal Shrivastava
2026-05-29 11:12 ` [PATCH v6 2/6] PCI/ATS: Validate STU for VFs in pci_prepare_ats() Pranjal Shrivastava
2026-05-29 11:12 ` [PATCH v6 3/6] PCI/ATS: Mandate checking pci_ats_supported() before pci_prepare_ats() Pranjal Shrivastava
2026-05-29 13:07 ` sashiko-bot
2026-05-29 21:56 ` Nicolin Chen
2026-05-29 11:12 ` [PATCH v6 4/6] iommu/arm-smmu-v3: Standardize ATS enablement failure reporting Pranjal Shrivastava
2026-05-29 13:44 ` sashiko-bot [this message]
2026-05-29 21:51 ` Nicolin Chen
2026-05-31 17:13 ` Pranjal Shrivastava
2026-05-29 11:12 ` [PATCH v6 5/6] iommu/vt-d: Fail probe on ATS configuration failure Pranjal Shrivastava
2026-05-29 14:30 ` sashiko-bot
2026-05-29 11:12 ` [PATCH v6 6/6] iommu/amd: " Pranjal Shrivastava
2026-05-29 15:32 ` sashiko-bot
2026-06-01 6:00 ` Ankit Soni
2026-06-01 6:20 ` Pranjal Shrivastava
2026-06-01 8:17 ` Ankit Soni
2026-06-01 10:35 ` Pranjal Shrivastava
2026-06-01 9:28 ` Vasant Hegde
2026-06-01 10:41 ` Pranjal Shrivastava
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=20260529134447.292921F00893@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=praan@google.com \
--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