From: Frank Li <Frank.li@oss.nxp.com>
To: "Peng Fan (OSS)" <peng.fan@oss.nxp.com>
Cc: Vinod Koul <vkoul@kernel.org>, Frank Li <Frank.Li@kernel.org>,
Sascha Hauer <s.hauer@pengutronix.de>,
Pengutronix Kernel Team <kernel@pengutronix.de>,
Fabio Estevam <festevam@gmail.com>,
dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org,
imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org,
Peng Fan <peng.fan@nxp.com>
Subject: Re: [PATCH 3/3] dmaengine: imx-sdma: Use __assign_bit() for ownership configuration
Date: Thu, 24 Sep 2026 16:33:10 -0400 [thread overview]
Message-ID: <arWJBi8iHhaeNfcr@lizhi-Precision-Tower-5810> (raw)
In-Reply-To: <20260903-dma-mask-v1-3-211ffd12c236@nxp.com>
On Thu, Sep 03, 2026 at 10:16:14PM +0800, Peng Fan (OSS) wrote:
> From: Peng Fan <peng.fan@nxp.com>
>
> Replace the if/else pairs of __set_bit()/__clear_bit() in
> sdma_config_ownership() with __assign_bit(), which does exactly the
> same conditional set-or-clear in a single call.
>
> No functional change.
>
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> ---
Reviewed-by: Frank Li <Frank.Li@nxp.com>
> drivers/dma/imx-sdma.c | 17 +++--------------
> 1 file changed, 3 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c
> index 63261ab6402b9..da565409beaaa 100644
> --- a/drivers/dma/imx-sdma.c
> +++ b/drivers/dma/imx-sdma.c
> @@ -710,20 +710,9 @@ static int sdma_config_ownership(struct sdma_channel *sdmac,
> mcu = readl_relaxed(sdma->regs + SDMA_H_HOSTOVR);
> dsp = readl_relaxed(sdma->regs + SDMA_H_DSPOVR);
>
> - if (dsp_override)
> - __clear_bit(channel, &dsp);
> - else
> - __set_bit(channel, &dsp);
> -
> - if (event_override)
> - __clear_bit(channel, &evt);
> - else
> - __set_bit(channel, &evt);
> -
> - if (mcu_override)
> - __clear_bit(channel, &mcu);
> - else
> - __set_bit(channel, &mcu);
> + __assign_bit(channel, &dsp, !dsp_override);
> + __assign_bit(channel, &evt, !event_override);
> + __assign_bit(channel, &mcu, !mcu_override);
>
> writel_relaxed(evt, sdma->regs + SDMA_H_EVTOVR);
> writel_relaxed(mcu, sdma->regs + SDMA_H_HOSTOVR);
>
> --
> 2.34.1
>
next prev parent reply other threads:[~2026-09-24 20:33 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-03 14:16 [PATCH 0/3] dmaengine: Use non-atomic bit ops where safe Peng Fan (OSS)
2026-09-03 14:16 ` [PATCH 1/3] dmaengine: Use non-atomic bit ops for cap_mask manipulation Peng Fan (OSS)
2026-09-03 14:16 ` [PATCH 2/3] dmaengine: imx-sdma: Use non-atomic __set_bit() for event_mask setup Peng Fan (OSS)
2026-09-03 14:16 ` [PATCH 3/3] dmaengine: imx-sdma: Use __assign_bit() for ownership configuration Peng Fan (OSS)
2026-09-24 20:33 ` Frank Li [this message]
2026-09-25 1:45 ` Peng Fan
2026-09-03 19:29 ` [PATCH 0/3] dmaengine: Use non-atomic bit ops where safe Frank Li
2026-09-04 2:08 ` Peng Fan
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=arWJBi8iHhaeNfcr@lizhi-Precision-Tower-5810 \
--to=frank.li@oss.nxp.com \
--cc=Frank.Li@kernel.org \
--cc=dmaengine@vger.kernel.org \
--cc=festevam@gmail.com \
--cc=imx@lists.linux.dev \
--cc=kernel@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=peng.fan@nxp.com \
--cc=peng.fan@oss.nxp.com \
--cc=s.hauer@pengutronix.de \
--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