From nobody Thu Apr 9 19:00:50 2026 Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4ADD9285CA7 for ; Fri, 6 Mar 2026 12:41:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772800903; cv=none; b=sK27POQUxZztwcAWPjB/L7puLAhSCy5cEVPvBqH1VCDmlVPHND7fSZ/Wlh4JXIGhaeqepq3iSCKkq2wxeBI5TKd/3dGPaE/1KK1lzndO7UzbXt1IpS0nzHVYOZw5uCJg9M25rnna7pDEciBFETST/Dq3MgAUYtpbFyb9WwVYF4Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772800903; c=relaxed/simple; bh=SjCE/QHioNwLTDQuUYwPk6oerv0xCCcUmYIaEF9w9K0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=SkY5B3j2zYbi7rUtJpMCShYMOtm5eM7Jc18ulmz9+Zn3XXm/pmBk4Ap3kxMSwB6dacUFMmEXmhAIWM3UiV2xDom4OwUVchVrFHlvpGivRjfGJz6DukFWH5gMsl2HDK1D1LjT7WUFrtP4Eqx5bKCi8hmcxOC1beK0vmOhQRAfo1Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev; spf=pass smtp.mailfrom=tuxon.dev; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b=MgDLNuim; arc=none smtp.client-ip=209.85.128.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tuxon.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b="MgDLNuim" Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-4833115090dso94661135e9.3 for ; Fri, 06 Mar 2026 04:41:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1772800901; x=1773405701; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=TdAKvTV1z72NR5PYnaT/8EadbSxsVoneWRjGufMFMis=; b=MgDLNuimauUMfytoXW1D4QnlFlhMwqrZSRTqyZw2oz4V82C57sIw6NAYamBJLRsSoh xLoHA1KcyiEwUXP1i48pHbwODCQtr4KRwTCLo7c3DuJXmHGmc9UAlNK4Btfn842dFVg/ oLpz4eOCqtCRTr1d/3QARBajXQbseg6ejsdzx7rarleZE3lNPzzLzk/ZMEAwNrEgNO5N uwrepxiCgQc7STIbRfHpjfM7yi76IAdaiyyqJtiWgesMDY3n2A/AS17yGKwo6tuTCXLT wtynLGHcsKDcQbx65kznAu6LU5MrlP9NhNMt7cbu4UFZzSlL9Vea105hNBWUrJrEUOA0 rxdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772800901; x=1773405701; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=TdAKvTV1z72NR5PYnaT/8EadbSxsVoneWRjGufMFMis=; b=FDx9v/vTKtSq/Baoll/J/6WI+xNuqtz4dJCf/vS62O7KERfeWEoczk4sbW9VjdAN/1 Xu1Cw4pGUxnQudQC7pMLIP+ke7JTik3OEpCGt8Wt9t25o6a7IbLg+1DWxoufPgvl5GH6 yxnriMw2JZ3R5XWKYeeVo6EZGVnVzTPj/fRud0RbNPWVJxlg90ghHeFndTrlm6AJ9ZNR AcR20XpFfyNwJIXmCbEmloG29/5FKR296KKwShuDCKA5hOgLDik4CuyX+9wH81b7xg3B Tgc1mFuYWwM+saQFAm169fCkpJ7KAHc9g+R/8gTb28G0zaTTSdD9IIpZNj55olAloYQi 5yqg== X-Forwarded-Encrypted: i=1; AJvYcCU45QIv9xkYOy0VhiKJRRMhVBFpJcbFAWopDaSGfpBnZW2oVifI1me729sVpzjpQ1TKLAiCyR/v12JnmuU=@vger.kernel.org X-Gm-Message-State: AOJu0YwFyuJ21PLsCn6iFHi43zOP5/QZYtxt4b1H7LpNg+jAb4ZTtKyW f2OIE7BPK+bH/mPFLewpfTUiZMBEsLQji8y4CtIlQcG8ftDW29wFJIDm5T+UIia/JYs= X-Gm-Gg: ATEYQzxDV8IiWgh7S865FEeMpkasPAIMqQb8TXB672PKAhzyk4KW2hgZjvH8u6Us0FU r90PS9OdMU+5tUyDdLHoJMfK5Yv3MzBUXXmoMScOIjl1mzrCVpyR7h/MVNvIt4c2EZ7Dcz/NoQf jnb0LbKr3g0pmwAYbtFG2jrK2v28IGorAMknN6i3hSqdOwLCkcMnYCHN/Pc7/EONM2PmQ4VzgIO rb+P6HhIQtVHmus7UjrpwtD8ez/qbjDP+k/vacbORIEcfJaFoFXABbqZP7Wi3VZfnQihI9RJJDz cy1ptLEemZi24aEGrUJNtsjKEtqrOFJ7qtpcd6NJVhKpNd9IkwaHv5HjO0wJNwogu0ukz5BLGJX jIbVcrUAB2h5m1DeoX5hVTPMK/FFPlbT3XulPZP7+aG6UKrUeJVSr6+z87ZlAZfZ+j8W83glqoT mHXNma1hrw1kwhJ1UJ+XjZhxyC38s/2KH8tK2C2TwYQe2bd1idm9S/ X-Received: by 2002:a05:600c:3acf:b0:483:b505:9db4 with SMTP id 5b1f17b1804b1-48526978d8fmr30254655e9.31.1772800900661; Fri, 06 Mar 2026 04:41:40 -0800 (PST) Received: from claudiu-X670E-Pro-RS.. ([82.78.167.134]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-485276b0c38sm38150505e9.9.2026.03.06.04.41.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Mar 2026 04:41:40 -0800 (PST) From: Claudiu X-Google-Original-From: Claudiu To: vkoul@kernel.org, Frank.Li@kernel.org, biju.das.jz@bp.renesas.com, geert+renesas@glider.be, fabrizio.castro.jz@renesas.com, prabhakar.mahadev-lad.rj@bp.renesas.com Cc: claudiu.beznea@tuxon.dev, dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, Claudiu Beznea , Frank Li Subject: [PATCH v9 3/8] dmaengine: sh: rz-dmac: Drop read of CHCTRL register Date: Fri, 6 Mar 2026 14:41:28 +0200 Message-ID: <20260306124133.2304687-4-claudiu.beznea.uj@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260306124133.2304687-1-claudiu.beznea.uj@bp.renesas.com> References: <20260306124133.2304687-1-claudiu.beznea.uj@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Claudiu Beznea 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 Reviewed-by: Frank Li Signed-off-by: Claudiu Beznea --- Changes in v9: - collected tags 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 f30bdf69c740..2895d10aa2c8 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_c= han *channel) { struct dma_chan *chan =3D &channel->vc.chan; struct rz_dmac *dmac =3D to_rz_dmac(chan->device); - u32 chstat, chctrl; + u32 chstat; =20 chstat =3D 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; } =20 - chctrl =3D 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; } --=20 2.43.0