Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Janne Grunau" <j@jannau.net>
Cc: robh@kernel.org, conor+dt@kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v2 2/2] iommu: apple-dart: Support specifying the DMA aperture in the DT
Date: Mon, 31 Aug 2026 16:29:13 +0000	[thread overview]
Message-ID: <20260831162913.ACCD61F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260831-iommu-apple-dart-aperture-v2-2-d16ce3770299@jannau.net>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] Missing Kconfig restriction for 64-bit architectures causes build warnings and undefined behavior on 32-bit compile tests
--

commit 366b6e1b688b18466f157e2752afc68e1389b902
Author: Janne Grunau <j@jannau.net>

iommu: apple-dart: Support specifying the DMA aperture in the DT

This commit adds support for parsing the "iommus" DT property to specify
the start and end of the DMA aperture. It intends to restrict compile
testing to 64-bit architectures to prevent warnings when calculating
64-bit dma_addr_t values.

> diff --git a/drivers/iommu/apple-dart.c b/drivers/iommu/apple-dart.c
> index b160fb464c5fb..ebf4547d32b41 100644
> --- a/drivers/iommu/apple-dart.c
> +++ b/drivers/iommu/apple-dart.c
[ ... ]
> @@ -803,20 +814,65 @@ static int apple_dart_of_xlate(struct device *dev,
>  	struct platform_device *iommu_pdev = of_find_device_by_node(args->np);
>  	struct apple_dart *dart = platform_get_drvdata(iommu_pdev);
>  	struct apple_dart *cfg_dart;
> +	dma_addr_t dma_max = DMA_BIT_MASK(dart->ias);
> +	dma_addr_t dma_min = 0;
>  	int i, sid;
>  
>  	put_device(&iommu_pdev->dev);
>  
> -	if (args->args_count != 1)
> +	if (args->args_count != 1 && args->args_count != 5)
>  		return -EINVAL;
> +
>  	sid = args->args[0];
>  
> +	if (args->args_count == 5) {
> +		dma_addr_t length = ((dma_addr_t)args->args[3] << 32) | args->args[4];

[Severity: Low]
The commit message states "Limit compile testing to 64-bit architectures to
avoid warnings in the calculation of 64-bit dma_addr_t values", but there are
no changes to drivers/iommu/Kconfig in this patch.

When building this driver on a 32-bit architecture with CONFIG_COMPILE_TEST=y
and without CONFIG_ARCH_DMA_ADDR_T_64BIT, doesn't shifting a 32-bit dma_addr_t
by 32 bits here trigger undefined behavior and compiler warnings like
-Wshift-count-overflow?

> +
> +		if (!length)
> +			return -EINVAL;

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260831-iommu-apple-dart-aperture-v2-0-d16ce3770299@jannau.net?part=2

  reply	other threads:[~2026-08-31 16:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-31 13:46 [PATCH v2 0/2] iommu: apple-dart: device specific DMA aperture support Janne Grunau
2026-08-31 13:46 ` [PATCH v2 1/2] dt-bindings: iommu: dart: Support specifying the DMA aperture Janne Grunau
2026-08-31 13:46 ` [PATCH v2 2/2] iommu: apple-dart: Support specifying the DMA aperture in the DT Janne Grunau
2026-08-31 16:29   ` sashiko-bot [this message]
2026-09-01 20:45   ` Sven Peter
2026-09-02 19:17     ` Janne Grunau

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=20260831162913.ACCD61F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=j@jannau.net \
    --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