From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A7DA22E3397 for ; Mon, 30 Mar 2026 09:46:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774864007; cv=none; b=lTd9ouysFh7hLHmEpBpADAE3PpioLibqQ5hcaOUQxBcQ+1fd5XMNYYSz6bVJEmIwLqktLkL+uIopYcnW8Q3qpIn7tj+ifKQ5BSCE2qNT6u87DOEhwqJHux7WsCwZRnMFPluIr+b2cxW56JYHPWL91yk6Ha26XH0EAE+o0zsXIRc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774864007; c=relaxed/simple; bh=lzRkNtnXIFhGYEikyS2K+6FK2FnThI2n1Zadk1t2kwc=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=fT/nc5wrSwlM7IzXvoRSdIFJrfC2GHv4/dDSk4AuS5Anh0qE8HFBfGf4EnuoKYqUTGhYekjUc3WW5DYpN4ioOytu+NV0Vj4gE2/AeUG7nU6qI/s5HHKQChEPuDOPlXP+0/tQ4/C4QsdW9PFq28czgDESvP3cDy1jPhaVwFaWC9c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=GyPG75TA; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="GyPG75TA" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 14CC6C4CEF7; Mon, 30 Mar 2026 09:46:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1774864007; bh=lzRkNtnXIFhGYEikyS2K+6FK2FnThI2n1Zadk1t2kwc=; h=Subject:To:Cc:From:Date:From; b=GyPG75TAKFwA1s66hckxUmPkQq9wxEn0p6codNHnCC8Q85zrM2TOqnw0C5iqyFy6T XQt1PDAN1VGbW7sKqwrnhGF5FWbZJnbvBvqh8JibV5G/I4guZ+ZPORj3Y/4LMReGgt 2z17b8JCglq2KZZlbdwmsePg/4mecyZgvufhHaW8= Subject: FAILED: patch "[PATCH] dmaengine: sh: rz-dmac: Move CHCTRL updates under spinlock" failed to apply to 5.15-stable tree To: claudiu.beznea@tuxon.dev,Frank.Li@nxp.com,biju.das.jz@bp.renesas.com,claudiu.beznea.uj@bp.renesas.com,vkoul@kernel.org Cc: From: Date: Mon, 30 Mar 2026 11:46:44 +0200 Message-ID: <2026033044-applause-erased-d411@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit The patch below does not apply to the 5.15-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.15.y git checkout FETCH_HEAD git cherry-pick -x 89a8567d84bde88cb7cdbbac2ab2299c4f991490 # git commit -s git send-email --to '' --in-reply-to '2026033044-applause-erased-d411@gregkh' --subject-prefix 'PATCH 5.15.y' HEAD^.. Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 89a8567d84bde88cb7cdbbac2ab2299c4f991490 Mon Sep 17 00:00:00 2001 From: Claudiu Beznea Date: Mon, 16 Mar 2026 15:32:46 +0200 Subject: [PATCH] dmaengine: sh: rz-dmac: Move CHCTRL updates under spinlock Both rz_dmac_disable_hw() and rz_dmac_irq_handle_channel() update the CHCTRL register. To avoid concurrency issues when configuring functionalities exposed by this registers, take the virtual channel lock. All other CHCTRL updates were already protected by the same lock. Previously, rz_dmac_disable_hw() disabled and re-enabled local IRQs, before accessing CHCTRL registers but this does not ensure race-free access. Remove the local IRQ disable/enable code as well. Fixes: 5000d37042a6 ("dmaengine: sh: Add DMAC driver for RZ/G2L SoC") Cc: stable@vger.kernel.org Reviewed-by: Biju Das Reviewed-by: Frank Li Signed-off-by: Claudiu Beznea Link: https://patch.msgid.link/20260316133252.240348-3-claudiu.beznea.uj@bp.renesas.com Signed-off-by: Vinod Koul diff --git a/drivers/dma/sh/rz-dmac.c b/drivers/dma/sh/rz-dmac.c index 089e1ab29159..f30bdf69c740 100644 --- a/drivers/dma/sh/rz-dmac.c +++ b/drivers/dma/sh/rz-dmac.c @@ -297,13 +297,10 @@ static void rz_dmac_disable_hw(struct rz_dmac_chan *channel) { struct dma_chan *chan = &channel->vc.chan; struct rz_dmac *dmac = to_rz_dmac(chan->device); - unsigned long flags; dev_dbg(dmac->dev, "%s channel %d\n", __func__, channel->index); - local_irq_save(flags); rz_dmac_ch_writel(channel, CHCTRL_DEFAULT, CHCTRL, 1); - local_irq_restore(flags); } static void rz_dmac_set_dmars_register(struct rz_dmac *dmac, int nr, u32 dmars) @@ -568,8 +565,8 @@ static int rz_dmac_terminate_all(struct dma_chan *chan) unsigned int i; LIST_HEAD(head); - rz_dmac_disable_hw(channel); spin_lock_irqsave(&channel->vc.lock, flags); + rz_dmac_disable_hw(channel); for (i = 0; i < DMAC_NR_LMDESC; i++) lmdesc[i].header = 0; @@ -706,7 +703,9 @@ static void rz_dmac_irq_handle_channel(struct rz_dmac_chan *channel) if (chstat & CHSTAT_ER) { dev_err(dmac->dev, "DMAC err CHSTAT_%d = %08X\n", channel->index, chstat); - rz_dmac_ch_writel(channel, CHCTRL_DEFAULT, CHCTRL, 1); + + scoped_guard(spinlock_irqsave, &channel->vc.lock) + rz_dmac_ch_writel(channel, CHCTRL_DEFAULT, CHCTRL, 1); goto done; }