From: Frank Li <Frank.li@nxp.com>
To: Claudiu <claudiu.beznea@tuxon.dev>
Cc: vkoul@kernel.org, geert+renesas@glider.be,
biju.das.jz@bp.renesas.com, fabrizio.castro.jz@renesas.com,
prabhakar.mahadev-lad.rj@bp.renesas.com,
dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org,
Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Subject: Re: [PATCH v8 3/8] dmaengine: sh: rz-dmac: Drop read of CHCTRL register
Date: Wed, 25 Feb 2026 11:20:58 -0500 [thread overview]
Message-ID: <aZ8haq7RLgmxsifK@lizhi-Precision-Tower-5810> (raw)
In-Reply-To: <20260120133330.3738850-4-claudiu.beznea.uj@bp.renesas.com>
On Tue, Jan 20, 2026 at 03:33:25PM +0200, Claudiu wrote:
> From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
>
> The CHCTRL register has 11 bits that can be updated by software. The
> documentation for all these bits states the following:
> - A read operation results in 0 being read
> - Writing zero does not affect the operation
>
> All bits in the CHCTRL register accessible by software are set and clear
> bits.
>
> The documentation for the CLREND bit of CHCTRL states:
> Setting this bit to 1 can clear the END bit of the CHSTAT_n/nS register.
> Also, the DMA transfer end interrupt is cleared. An attempt to read this
> bit results in 0 being read.
> 1: Clears the END bit.
> 0: Does not affect the operation.
>
> Since writing zero to any bit in this register does not affect controller
> operation and reads always return zero, there is no need to perform
> read-modify-write accesses to set the CLREND bit. Drop the read of the
> CHCTRL register.
>
> Also, since setting the CLREND bit does not interact with other
> functionalities exposed through this register and only clears the END
> interrupt, there is no need to lock around this operation. Add a comment
> to document this.
>
> Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com>
> Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
> ---
Reviewed-by: Frank Li <Frank.Li@nxp.com>
>
> Changes in v8:
> - none
>
> Changes in v7:
> - collected tags
>
> Changes in v6:
> - none, this patch is new
>
> drivers/dma/sh/rz-dmac.c | 9 ++++++---
> 1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/dma/sh/rz-dmac.c b/drivers/dma/sh/rz-dmac.c
> index c0f1e77996bd..bb9ca19cf784 100644
> --- a/drivers/dma/sh/rz-dmac.c
> +++ b/drivers/dma/sh/rz-dmac.c
> @@ -697,7 +697,7 @@ static void rz_dmac_irq_handle_channel(struct rz_dmac_chan *channel)
> {
> struct dma_chan *chan = &channel->vc.chan;
> struct rz_dmac *dmac = to_rz_dmac(chan->device);
> - u32 chstat, chctrl;
> + u32 chstat;
>
> chstat = rz_dmac_ch_readl(channel, CHSTAT, 1);
> if (chstat & CHSTAT_ER) {
> @@ -709,8 +709,11 @@ static void rz_dmac_irq_handle_channel(struct rz_dmac_chan *channel)
> goto done;
> }
>
> - chctrl = rz_dmac_ch_readl(channel, CHCTRL, 1);
> - rz_dmac_ch_writel(channel, chctrl | CHCTRL_CLREND, CHCTRL, 1);
> + /*
> + * No need to lock. This just clears the END interrupt. Writing
> + * zeros to CHCTRL is just ignored by HW.
> + */
> + rz_dmac_ch_writel(channel, CHCTRL_CLREND, CHCTRL, 1);
> done:
> return;
> }
> --
> 2.43.0
>
next prev parent reply other threads:[~2026-02-25 16:21 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-20 13:33 [PATCH v8 0/8] dmaengine: sh: rz-dmac: Add tx_status and pause/resume support Claudiu
2026-01-20 13:33 ` [PATCH v8 1/8] dmaengine: sh: rz-dmac: Protect the driver specific lists Claudiu
2026-02-25 16:17 ` Frank Li
2026-01-20 13:33 ` [PATCH v8 2/8] dmaengine: sh: rz-dmac: Move CHCTRL updates under spinlock Claudiu
2026-02-25 16:19 ` Frank Li
2026-01-20 13:33 ` [PATCH v8 3/8] dmaengine: sh: rz-dmac: Drop read of CHCTRL register Claudiu
2026-02-25 16:20 ` Frank Li [this message]
2026-01-20 13:33 ` [PATCH v8 4/8] dmaengine: sh: rz-dmac: Drop goto instruction and label Claudiu
2026-02-25 16:23 ` Frank Li
2026-01-20 13:33 ` [PATCH v8 5/8] dmaengine: sh: rz-dmac: Drop unnecessary local_irq_save() call Claudiu
2026-02-25 16:23 ` Frank Li
2026-01-20 13:33 ` [PATCH v8 6/8] dmaengine: sh: rz-dmac: Add rz_dmac_invalidate_lmdesc() Claudiu
2026-02-25 16:26 ` Frank Li
2026-01-20 13:33 ` [PATCH v8 7/8] dmaengine: sh: rz-dmac: Add device_tx_status() callback Claudiu
2026-02-25 16:43 ` Frank Li
2026-03-02 13:49 ` Claudiu Beznea
2026-03-04 16:37 ` Frank Li
2026-01-20 13:33 ` [PATCH v8 8/8] dmaengine: sh: rz-dmac: Add device_{pause,resume}() callbacks Claudiu
2026-02-25 16:49 ` Frank Li
2026-03-02 13:50 ` Claudiu Beznea
2026-01-29 9:44 ` [PATCH v8 0/8] dmaengine: sh: rz-dmac: Add tx_status and pause/resume support Claudiu Beznea
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=aZ8haq7RLgmxsifK@lizhi-Precision-Tower-5810 \
--to=frank.li@nxp.com \
--cc=biju.das.jz@bp.renesas.com \
--cc=claudiu.beznea.uj@bp.renesas.com \
--cc=claudiu.beznea@tuxon.dev \
--cc=dmaengine@vger.kernel.org \
--cc=fabrizio.castro.jz@renesas.com \
--cc=geert+renesas@glider.be \
--cc=linux-kernel@vger.kernel.org \
--cc=prabhakar.mahadev-lad.rj@bp.renesas.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
all inboxes | Powered by JetHome®