From: LECOINTRE Philippe <philippe.lecointre@thalesgroup.com>
To: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>,
"dmaengine@vger.kernel.org" <dmaengine@vger.kernel.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"LENAIN Simon" <simon.lenain@thalesgroup.com>,
LEJEUNE Sebastien <sebastien.lejeune@thalesgroup.com>,
RENAULT Xavier <xavier.renault@thalesgroup.com>
Subject: RE: [PATCH] dmaengine: dw-axi-dmac: optional reset support
Date: Tue, 1 Apr 2025 07:29:14 +0000 [thread overview]
Message-ID: <5e3cb4a130cf4834a48ace99c61bf0e2@thalesgroup.com> (raw)
In-Reply-To: <bf8f02ced6604f80acb84e82ea3a9268@thalesgroup.com>
Classified as: {OPEN}
Hello,
Do you see any interest in this patch?
I believe it makes the driver more generic to match all current and future use cases on SoCs that uses this controller.
Also, I think it simplifies the reading of the driver by removing if statement.
What do you think?
Regards,
Philippe
{OPEN}
> -----Original Message-----
> From: LECOINTRE Philippe
> Sent: Wednesday, February 5, 2025 2:39 PM
> To: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>;
> dmaengine@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org; LENAIN Simon
> <simon.lenain@thalesgroup.com>; LEJEUNE Sebastien
> <sebastien.lejeune@thalesgroup.com>; BARBEAU Etienne
> <etienne.barbeau@thalesgroup.com>; RENAULT Xavier
> <xavier.renault@thalesgroup.com>
> Subject: [PATCH] dmaengine: dw-axi-dmac: optional reset support
>
> Use optional reset support to avoid having to add a new entry to
> dw_dma_of_id_table for each target requiring reset support
>
> Signed-off-by: Philippe Lecointre <philippe.lecointre@thalesgroup.com>
> Acked-by: Simon Lenain <simon.lenain@thalesgroup.com>
> ---
> .../dma/dw-axi-dmac/dw-axi-dmac-platform.c | 20 ++++++++-----------
> 1 file changed, 8 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
> b/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
> index b23536645ff7..186bfb35b9eb 100644
> --- a/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
> +++ b/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
> @@ -48,8 +48,7 @@
> DMA_SLAVE_BUSWIDTH_64_BYTES)
>
> #define AXI_DMA_FLAG_HAS_APB_REGS BIT(0)
> -#define AXI_DMA_FLAG_HAS_RESETS BIT(1)
> -#define AXI_DMA_FLAG_USE_CFG2 BIT(2)
> +#define AXI_DMA_FLAG_USE_CFG2 BIT(1)
>
> static inline void
> axi_dma_iowrite32(struct axi_dma_chip *chip, u32 reg, u32 val) @@ -
> 1498,15 +1497,13 @@ static int dw_probe(struct platform_device *pdev)
> return PTR_ERR(chip->apb_regs);
> }
>
> - if (flags & AXI_DMA_FLAG_HAS_RESETS) {
> - resets = devm_reset_control_array_get_exclusive(&pdev-
> >dev);
> - if (IS_ERR(resets))
> - return PTR_ERR(resets);
> + resets = devm_reset_control_array_get_optional_exclusive(&pdev-
> >dev);
> + if (IS_ERR(resets))
> + return PTR_ERR(resets);
>
> - ret = reset_control_deassert(resets);
> - if (ret)
> - return ret;
> - }
> + ret = reset_control_deassert(resets);
> + if (ret)
> + return ret;
>
> chip->dw->hdata->use_cfg2 = !!(flags &
> AXI_DMA_FLAG_USE_CFG2);
>
> @@ -1665,10 +1662,9 @@ static const struct of_device_id
> dw_dma_of_id_table[] = {
> .data = (void *)AXI_DMA_FLAG_HAS_APB_REGS,
> }, {
> .compatible = "starfive,jh7110-axi-dma",
> - .data = (void *)(AXI_DMA_FLAG_HAS_RESETS |
> AXI_DMA_FLAG_USE_CFG2),
> + .data = (void *)AXI_DMA_FLAG_USE_CFG2,
> }, {
> .compatible = "starfive,jh8100-axi-dma",
> - .data = (void *)AXI_DMA_FLAG_HAS_RESETS,
> },
> {}
> };
> --
> 2.44.1
prev parent reply other threads:[~2025-04-01 7:30 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-05 13:38 [PATCH] dmaengine: dw-axi-dmac: optional reset support LECOINTRE Philippe
2025-04-01 7:29 ` LECOINTRE Philippe [this message]
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=5e3cb4a130cf4834a48ace99c61bf0e2@thalesgroup.com \
--to=philippe.lecointre@thalesgroup.com \
--cc=Eugeniy.Paltsev@synopsys.com \
--cc=dmaengine@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sebastien.lejeune@thalesgroup.com \
--cc=simon.lenain@thalesgroup.com \
--cc=xavier.renault@thalesgroup.com \
/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