From nobody Tue Feb 10 06:57:25 2026 Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) (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 207D543636C for ; Tue, 20 Jan 2026 13:33:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768916028; cv=none; b=CyYwQWRe2COMz1brYb8zfIegiCmokRV6TbGTICIf1MdKYzxQ8GPynNjAySgMvaIqWJye0M0qUYQxDhMTGcq1MJAo5np5RFy+fjDkgGPQjAkbppRtbj3BoE/rbN/EBWef0noxotsVBvYN2dw2Pms7dhgQrdHZ9Lo/hNuxoxvsUxk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768916028; c=relaxed/simple; bh=W0PMYWluR4s+4ZGBLZytPjvzufu5cGFxS/9iOr9nc0Q=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=NLeX+sUrDz3GFhWR2vvKUHMpqxMjQjcjWZPX/bO5RG0aRG+uJ1a8FxPEbuAWnGHhMHGu6KITbav7/YTR3hDZw/KB+fbXaxNV7PhnNwx3GTuMmJQyY49t8vZ2XEEq0//RsZrmwDKbsELSuAvzvH+Zdz/+zR98UIwoQvYNRzrCRe4= 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=J8Y9GtX2; arc=none smtp.client-ip=209.85.128.48 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="J8Y9GtX2" Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-47edd9024b1so34002325e9.3 for ; Tue, 20 Jan 2026 05:33:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1768916024; x=1769520824; 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=VcUa3wgqVKrSdjpDcbTNWk0MXPErhZe+CUK2K28sdgM=; b=J8Y9GtX2BE1NxQK534ARSIktMOL6MgBuXAGg2HpKQin8UppVy6PtHukzsYoDM4JoA+ mHeRgz39cbDqocs5G3cDEAISYey62BKFqn4hE+4eXqo4IxJ8hThWubmSHHyWTMdl4TWT Kl3uFdsjIl97bHBmT2emmbgvhxUbDZGApZq5zzUpsWX/3G1IslNDNR8cHHeBwKqHfSiq nbyskSud+QGdQPNRBjG96hWA50pcedxsV/2xHNnkGBY/hXDTpEUT7YZaJYUi+RdaU1ay OcXRnvTct1/dJHDc/ep/Zdb4KqEQ6ge8QQOgPy7cedOtj//YQITiIqk933G6RjkHTV11 nJKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768916024; x=1769520824; 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=VcUa3wgqVKrSdjpDcbTNWk0MXPErhZe+CUK2K28sdgM=; b=jIoowePoZVnhkNiWndXHWiMV9G7Y6nikXmrgXi7sqmIkk7LiyS3RcRMFCMY3XlEWt0 +28W4/6jpBA7RayBj40oALn4nWs34ZxqYKetsp4Jwtxqxdi6SO8WMz2Q40kzcTA/Uddl F+niugvDg90t+fQKreZ5v1s6KhihHqGJ0rj76RlPly4ELNpT2JNzgp8g6YI/VOCreVNx zR2FpujGyjnAIEyloKMGkHx+UaQ4Ilx7UXI8pMuNCXEfn99f5LcXS8PAse+/D6LMxrZK 81Qe4o5nxRT6ExDPjsV937wP50lp6Xkj6vi8eqv0ufFO7cxxEzVNZs9Hr+b10sD7qSux nDVA== X-Forwarded-Encrypted: i=1; AJvYcCXt2sGAPMXBT7QqIZ5cclHaQH+XloYzhv0Z1PocjLyCkWBVN/0GHUNLmAZXLTSzwh85T4+xSJ0//RGxRSU=@vger.kernel.org X-Gm-Message-State: AOJu0YwDKzkzXJDJ8DLYIlGKg/9ior0qoCnIN47IRjhvk+IiZ8/aqBt9 alJcMYhlQQ8HOh1TVUVNrgZwUDcKQ7MEt5hc6x5ifAH01mCJvgoJtYUBebOcTWUa0zg= X-Gm-Gg: AZuq6aIrENQ8xFtUdZo8Tot/nrFP7Y40oBST8uPNTluy3e6M1+ZfzCw2Yz1CtzwyD7M 2UopJRc4MecJy7cZDgXKG5sxj2hAjtKDGGOpfrLI2yc9pbd8X5HKC/53f1qbcKpNpFE69TaMvfQ J1WtlZDjQuBJKP2Hn76gVDqZaaud69WCQLfIaW5eG1lkulmcJQvvNxAUnD8U0snlJe9+tgcczmS 6BkhGV9VaEAJR9nTNPlfvzsHUhm2siCUso04Suw8vyZSbo2mJm/EX590SZ1l7T/aKxY1fVOgIyd 7xmU/rwO1mTbJ81iAbpdicJdkiSu7iz6tIY2dty5/AUv+a/uhgzr5A9LjDRbAmxshVUEqextPrL whrpEu6mqObSJNWXgkIgyV5nXLp5R7H2eu7mEe0kg243jZe0KLadnQdqLvxjlOL/w+ZEechgqvu P4VrFLODq1R1j9Fg13ETUSsP/hqybu5CVI3Ba6sz0= X-Received: by 2002:adf:f983:0:b0:435:6c8d:d017 with SMTP id ffacd0b85a97d-4356c8dd0d7mr16960338f8f.32.1768916024434; Tue, 20 Jan 2026 05:33:44 -0800 (PST) Received: from claudiu-X670E-Pro-RS.. ([82.78.167.31]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4356996dad0sm29331439f8f.27.2026.01.20.05.33.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Jan 2026 05:33:43 -0800 (PST) From: Claudiu X-Google-Original-From: Claudiu To: 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 Cc: claudiu.beznea@tuxon.dev, dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, Claudiu Beznea Subject: [PATCH v8 3/8] dmaengine: sh: rz-dmac: Drop read of CHCTRL register Date: Tue, 20 Jan 2026 15:33:25 +0200 Message-ID: <20260120133330.3738850-4-claudiu.beznea.uj@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260120133330.3738850-1-claudiu.beznea.uj@bp.renesas.com> References: <20260120133330.3738850-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 Signed-off-by: Claudiu Beznea --- 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_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