From: Frank Li <Frank.li@oss.nxp.com>
To: Jelly Jia <Jelly.Jia@cixtech.com>
Cc: vkoul@kernel.org, Frank.Li@kernel.org, robh@kernel.org,
krzk+dt@kernel.org, conor+dt@kernel.org, robin.murphy@arm.com,
devicetree@vger.kernel.org, cix-kernel-upstream@cixtech.com,
dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v7 02/10] dmaengine: arm-dma350: Check DMA mask setup errors
Date: Fri, 20 Nov 2026 11:29:35 -0600 [thread overview]
Message-ID: <awCDf66NuD4FwZH7@SMW015318> (raw)
In-Reply-To: <20261117094335.1393735-3-Jelly.Jia@cixtech.com>
On Tue, Nov 17, 2026 at 05:43:27PM +0800, Jelly Jia wrote:
> The controller's address width is used to configure its DMA mask. If
> dma_set_mask_and_coherent() fails, continuing probe leaves the device
> registered with an unsupported DMA address configuration.
>
> Check the return value and fail probe before allocating DMA resources.
>
> Fixes: 5d099706449d ("dmaengine: Add Arm DMA-350 driver")
> Signed-off-by: Jelly Jia <Jelly.Jia@cixtech.com>
> ---
Reviewed-by: Frank Li <Frank.Li@nxp.com
>> drivers/dma/arm-dma350.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/dma/arm-dma350.c b/drivers/dma/arm-dma350.c
> index fdc4cd224579..d9f1d2976034 100644
> --- a/drivers/dma/arm-dma350.c
> +++ b/drivers/dma/arm-dma350.c
> @@ -553,7 +553,9 @@ static int d350_probe(struct platform_device *pdev)
> dw = 1 << FIELD_GET(DMA_CFG_DATA_WIDTH, reg);
> aw = FIELD_GET(DMA_CFG_ADDR_WIDTH, reg) + 1;
>
> - dma_set_mask_and_coherent(dev, DMA_BIT_MASK(aw));
> + ret = dma_set_mask_and_coherent(dev, DMA_BIT_MASK(aw));
> + if (ret)
> + return dev_err_probe(dev, ret, "failed to set DMA mask\n");
> coherent = device_get_dma_attr(dev) == DEV_DMA_COHERENT;
>
> dmac = devm_kzalloc(dev, struct_size(dmac, channels, nchan), GFP_KERNEL);
> --
> 2.54.0
>
next prev parent reply other threads:[~2026-11-20 17:29 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-17 9:43 [PATCH v7 00/10] dmaengine: arm-dma350: Add slave support and Sky1 integration Jelly Jia
2026-11-17 9:43 ` [PATCH v7 01/10] dmaengine: arm-dma350: Fix source trigger bit Jelly Jia
2026-11-17 9:43 ` [PATCH v7 02/10] dmaengine: arm-dma350: Check DMA mask setup errors Jelly Jia
2026-11-20 17:29 ` Frank Li [this message]
2026-11-17 9:43 ` [PATCH v7 03/10] dmaengine: arm-dma350: Initialize channel coherency Jelly Jia
2026-11-17 9:43 ` [PATCH v7 04/10] dmaengine: arm-dma350: Serialize IRQ and termination state Jelly Jia
2026-11-17 10:03 ` sashiko-bot
2026-11-20 6:15 ` Jelly Jia
2026-11-17 9:43 ` [PATCH v7 05/10] dmaengine: arm-dma350: Report submitted descriptor status Jelly Jia
2026-11-17 9:43 ` [PATCH v7 06/10] dmaengine: arm-dma350: Use managed device registration Jelly Jia
2026-11-17 9:43 ` [PATCH v7 07/10] dmaengine: arm-dma350: Track descriptor byte lengths explicitly Jelly Jia
2026-11-17 9:43 ` [PATCH v7 08/10] dmaengine: arm-dma350: Add slave and cyclic transfer support Jelly Jia
2026-11-17 9:43 ` [PATCH v7 09/10] dt-bindings: dma: arm,dma-350: Describe the CIX Sky1 integration Jelly Jia
2026-11-17 9:43 ` [PATCH v7 10/10] dmaengine: arm-dma350: Support integration clocks and resets Jelly Jia
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=awCDf66NuD4FwZH7@SMW015318 \
--to=frank.li@oss.nxp.com \
--cc=Frank.Li@kernel.org \
--cc=Jelly.Jia@cixtech.com \
--cc=cix-kernel-upstream@cixtech.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dmaengine@vger.kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robh@kernel.org \
--cc=robin.murphy@arm.com \
--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