From nobody Tue Feb 10 12:42:59 2026 Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) (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 597EF4BB0A6 for ; Thu, 8 Jan 2026 10:36:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767868600; cv=none; b=MLQwHdGZSSfq1rB45UgpZkx5fD8rziVpQ1xmZRoc77pLab2L1/oWKPhHxX2EbTsx7KXHHiuEC4xVmfsgYZjHTxftNDuZ9AXk2w8IiEcr9DaXQyCGoykfHLwGSLADXU0xc2yRbY6GaarrmNuVSdTGe28w6Mhhs6fTf6ME1HBgVDg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767868600; c=relaxed/simple; bh=HETVrG2xXKuP/JPJ6ag7HnrtvAYHmwaCMinWzd9CPyw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=naPXmhy9DVvshPIBftc6eUm/EuXPmBC3XQ//F52uXOTLBWwV4fzZN6zskli5D0ZZkDDKtq4vQn3uC+fomMRmFjAQIld0DSsh6Q6lcbPj/A0vDjpTq+/tnGqGzvBinpgknqSlXxv+jLheI2ICNFwbnehSOy5WaS0vQZOxP08ls6I= 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=rSz7bJTD; arc=none smtp.client-ip=209.85.221.45 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="rSz7bJTD" Received: by mail-wr1-f45.google.com with SMTP id ffacd0b85a97d-4327778df7fso1795860f8f.3 for ; Thu, 08 Jan 2026 02:36:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1767868586; x=1768473386; 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=ZBsL+5U9mBQbUpXgenVPfjce381EbAdS3YvmQ5cZZAE=; b=rSz7bJTDHxYiHge7Dky7s3miRn37Re71RiDqQLpmOA9l5498YzGQSenEgwqYzhMTkh St0CDCuE7cllfVYGsathm6hD05jto9xKTgRqR/MfqZ+0D9K/Q6Achl5N5323w6o11uaI rU2M8PZdM6eB2T/0Arm62wy93a72hwuvkIGEV4oN6aea5wFY6NIP5RRqdUj8RJ1b/014 UlT9nHQtHVguUTUsKzDTxHPI1abwmgmnIAlu5KUHv6AiACLSYgrESXymQoceJKlIhJC2 G6rjWJ0V0G8cOiQOzY4qhGytmGigvP3PR5x+8lMny3VBGJ74UyZlE5Gp9dw3yjWmMuiJ iunA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767868586; x=1768473386; 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=ZBsL+5U9mBQbUpXgenVPfjce381EbAdS3YvmQ5cZZAE=; b=qCt1+daEzn2jrWJ6cNVbcC5EbF7g2mTlG4PKKEH/IzJrpf7V//6cAwgQtVhK1hQqp3 JNQaiPwGRWJdWxFvAk/fij++mzSgyQwl2hqBTn5UmtJJDL5X1PY6Zu7cd5Fmw4sTn8m5 6e1CYG0CsVKm0H/wa42qjvUU848bLPiYPh8Yo0t8uVpxfaQf58KRNnJTICCutXaYaw8x fOjH3bSulgb+mescdUxlJG4dWkEh7BD0SwYd1/wRhWqyQn6DcKKPvxvjmKYd92le9yB9 MQuxYM6hLQoWNmH4/iGaI14p/av3d1T5aRwgLfiwXPRKdh4g7Wkr9G/+5kMya+Kig2zB JaGw== X-Forwarded-Encrypted: i=1; AJvYcCWN8Tg9lwP9IHzOWu7rRk3fLWXD/C4DVhmjpzXTb+en046e52bmx8hsAgptnvrunWgGY+m8ivqYJcHFuug=@vger.kernel.org X-Gm-Message-State: AOJu0Yzq3TFBHfV6HpmZ2Xg58J7uIeG8+wX87+A7w5LNAymmh8fOop6L x7ThyOT6n0Be4Sxcn0oNCajL72asPNVkGHZPFCOF6UOATS7ETue9wCuTi8w4vx3AcGs= X-Gm-Gg: AY/fxX5fyYqFN2bs9KIksztiq38zSu2Vf+98ws0bcqb9wY+vi3hkCRnKaKhlht0P85O WxYNXHjEu1y7klZqad0r6PJzlasfvILkokfKnWypwqU45Zmp6LU2fCVptIyRwNTmjWwTIRkFLqT X2dlrP1K8kfh8ZrOQzWkwwAE/ghfgmVKSzQmrt0Tt8A36JQSRuIoeEHUDNg6Bfo0qjizKyGUdpw R+bu8IkeRbzN4IUoE6WV88/OH/DlfymBdfOoRofyfDoCSoAP+9x09whoU83AiYGIGtIp1+5TDFu 6swsmu9KIUGs+9Z5RjQYraaTlEV9/RIwVYm6IH382qj+2lM65R0aZVHoPQPLk01v28LtXcOuPsQ KvEhZ1J2PDemloBw4QxyXYzlTnN/JXE6rChQYbDuet/i6AqF9Eq+yPAcrLELmN2WUcUIltQFhcy ugbvMSUMJf4wV5UgtCBrTFpI3Q6AR84XZ8ieE1THE= X-Google-Smtp-Source: AGHT+IFN6hOBhvkM+I+ctFJfN3aGqoA1MUMOHG5e0LucOvl5KGhtkxH/erS6N+bFoWDZhu8EOHkqFA== X-Received: by 2002:a05:6000:2913:b0:42f:b871:66b9 with SMTP id ffacd0b85a97d-432c3778dc8mr7189927f8f.56.1767868586329; Thu, 08 Jan 2026 02:36:26 -0800 (PST) Received: from claudiu-X670E-Pro-RS.. ([82.78.167.17]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-432bd5ee243sm15399033f8f.31.2026.01.08.02.36.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Jan 2026 02:36:25 -0800 (PST) From: Claudiu X-Google-Original-From: Claudiu To: vkoul@kernel.org, fabrizio.castro.jz@renesas.com, geert+renesas@glider.be, prabhakar.mahadev-lad.rj@bp.renesas.com, biju.das.jz@bp.renesas.com Cc: claudiu.beznea@tuxon.dev, dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v7 3/8] dmaengine: sh: rz-dmac: Drop read of CHCTRL register Date: Thu, 8 Jan 2026 12:36:15 +0200 Message-ID: <20260108103620.3482147-4-claudiu.beznea.uj@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260108103620.3482147-1-claudiu.beznea.uj@bp.renesas.com> References: <20260108103620.3482147-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 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 818d1ef6f0bf..43a772e4478c 100644 --- a/drivers/dma/sh/rz-dmac.c +++ b/drivers/dma/sh/rz-dmac.c @@ -698,7 +698,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) { @@ -710,8 +710,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