Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Peng Fan (OSS)" <peng.fan@oss.nxp.com>
Cc: imx@lists.linux.dev, dmaengine@vger.kernel.org,
	devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org,
	vkoul@kernel.org, Frank.Li@kernel.org
Subject: Re: [PATCH v4 2/7] dmaengine: add a bus for DMA channel devices
Date: Tue, 03 Nov 2026 15:30:17 +0000	[thread overview]
Message-ID: <sashiko-outbox-195621@kernel.org> (raw)
In-Reply-To: <20261103-edma-iommu-v3-v4-2-470415d418c5@Example.Com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] dmaengine: bus name collision with SuperH dma_subsys in dma_bus_init()
--

commit 6400cfe74e7a9d7882031548be64a3d0e53cb075
Author: Peng Fan <peng.fan@nxp.com>

dmaengine: add a bus for DMA channel devices

This commit adds a dedicated dma_chan_bus_type bus for DMA channel devices and
registers it at core_initcall so that per-channel IOMMU configuration can be
performed properly. It also cleans up the unmap pools on initialization
failure.

> diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c
> index 34be53487a21d..3a297f2754915 100644
> --- a/drivers/dma/dmaengine.c
> +++ b/drivers/dma/dmaengine.c
> @@ -1643,6 +1643,17 @@ void dma_run_dependencies(struct dma_async_tx_descriptor *tx)
>  }
>  EXPORT_SYMBOL_GPL(dma_run_dependencies);
>  
> +static int dma_chan_bus_match(struct device *dev,
> +			      const struct device_driver *drv)
> +{
> +	return 0;
> +}
> +
> +const struct bus_type dma_chan_bus_type = {
> +	.name  = "dma",
> +	.match = dma_chan_bus_match,
> +};
> +
>  static int __init dma_bus_init(void)
>  {
>  	int err = dmaengine_init_unmap_pool();
> @@ -1650,10 +1661,21 @@ static int __init dma_bus_init(void)
>  	if (err)
>  		return err;
>  
> +	err = bus_register(&dma_chan_bus_type);
> +	if (err)
> +		goto err_destroy_unmap_pool;

[Severity: Medium]
Does registering dma_chan_bus_type with the name "dma" collide with the
existing SuperH DMA subsystem bus?

In arch/sh/drivers/dma/dma-sysfs.c, SuperH already defines and registers a
bus_type with the same name:

    static const struct bus_type dma_subsys = {
            .name = "dma",
            .dev_name = "dma",
    };

    static int __init dma_subsys_init(void)
    {
            ...
            ret = subsys_system_register(&dma_subsys, NULL);
            if (unlikely(ret))
                    return ret;
    ...
    }
    postcore_initcall(dma_subsys_init);

On SuperH configurations where both CONFIG_DMA_ENGINE=y and CONFIG_SH_DMA_API=y
are enabled (such as sh2007_defconfig), dma_bus_init() runs at core_initcall
and registers /sys/bus/dma first. When dma_subsys_init() subsequently runs at
postcore_initcall, subsys_system_register() -> subsys_register() ->
bus_register() fails with -EEXIST and triggers a sysfs duplicate filename
warning, which then causes register_dmac() -> dma_create_sysfs_files() ->
device_register() to fail with -EINVAL when registering SuperH DMA channels.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261103-edma-iommu-v3-v4-0-470415d418c5@Example.Com?part=2

  reply	other threads:[~2026-11-03 15:30 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-03 15:18 [PATCH v4 0/7] dmaengine: add DMA channel bus and fsl-edma per-channel IOMMU support Peng Fan (OSS)
2026-11-03 15:18 ` [PATCH v4 1/7] dmaengine: fsl-edma: unregister channels before vchan cleanup Peng Fan (OSS)
2026-11-03 15:18 ` [PATCH v4 2/7] dmaengine: add a bus for DMA channel devices Peng Fan (OSS)
2026-11-03 15:30   ` sashiko-bot [this message]
2026-11-03 15:19 ` [PATCH v4 3/7] iommu: register the DMA channel bus for IOMMU notifications Peng Fan (OSS)
2026-11-03 15:19 ` [PATCH v4 4/7] dmaengine: move channel devices to the DMA channel bus Peng Fan (OSS)
2026-11-03 15:19 ` [PATCH v4 5/7] dt-bindings: dma: fsl,edma: add per-channel child node support Peng Fan (OSS)
2026-11-03 15:19 ` [PATCH v4 6/7] dmaengine: fsl-edma: support per-channel DT child nodes Peng Fan (OSS)
2026-11-03 15:34   ` sashiko-bot
2026-11-03 15:19 ` [PATCH v4 7/7] arm64: dts: imx95: convert eDMA to per-channel " Peng Fan (OSS)

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=sashiko-outbox-195621@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=Frank.Li@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmaengine@vger.kernel.org \
    --cc=imx@lists.linux.dev \
    --cc=peng.fan@oss.nxp.com \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=vkoul@kernel.org \
    /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