From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4FFD0CDB474 for ; Mon, 16 Oct 2023 11:11:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=qLhMJgDSQoREWrm1DoAXy0dgn4X6ExG6H9+RAhEY0LM=; b=0jVwl6YjxmEaRm sWBNko+zo7lD4X2XrUe9yNI+4bogjL9x9KdEUI6b8/kQRtCogwk1t2zTqKs3ni8+RgQ+3c401TiFK iS5dZmqRPTUBIbeY2C/t7T4mHKp86wFtD3/5GZOPGYm+u6Qn53kKvu307MXk3/QH6PfMXs5gYRJTO I40U2vrvrmxbOxP7tRCzCnJWqTyoHFmNJBDwRnCsgzHgN+efRK47SAAoojNUxcqHXUnfi1t2Rwf0G 4K6/ghH8eOeboPTa+TixXyf/6I41jBJaBevCjn3CBvgUz2OMD7l+5gUHcKDtZ5rQCuqJJLjD2laty d6tjgbOIlWyK9i3dUtOQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qsLV6-009Rbb-21; Mon, 16 Oct 2023 11:11:08 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qsLV3-009Ram-2G for linux-arm-kernel@lists.infradead.org; Mon, 16 Oct 2023 11:11:07 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by ams.source.kernel.org (Postfix) with ESMTP id 2A7A2B811D6; Mon, 16 Oct 2023 11:11:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 128F2C433C8; Mon, 16 Oct 2023 11:11:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697454663; bh=lVB3Zy9EHqhxD+7XTnrniBL/mRSy6WczNg24vNkvBcc=; h=Date:From:To:Subject:References:In-Reply-To:From; b=NgcyglY9QC5upCi7f7lr2wW18jKwF0fCzlqrPjMUJXth7LhMKOWBUU9klax5RYlZu Yt5uPzLb3XZjPlSCsLcF+ZfQn1Ve4oEMf6DDAqcO9U4L7wxvnEGZArpA7qy6TPn2mv M4I5XAQXmz/8+NuMYzxjQZdBFEjn6tp+L85sJ42ucrDGLgP+Ii/wA5HNUbuy47WKhv R9wIqRRGDK917H0Ai7C9WpNiv1L4Vr7TohZ9DEEwPWVLQKDpbh5tqznz+mq4DMwlGh 9DNONA/aDFkS2K5L7BsbOjNpWqHJfXMj+WyIC4lXEC8qCDNlRjAzdO4PxCOfYR0L9z CDQPX97RLrGXg== Date: Mon, 16 Oct 2023 16:41:00 +0530 From: Vinod Koul To: Amelie Delaunay , Maxime Coquelin , Alexandre Torgue , M'boumba Cedric Madianga , Pierre-Yves MORDRET , stable@vger.kernel.org, dmaengine@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] dmaengine: stm32-mdma: correct desc prep when channel running Message-ID: References: <20231009082450.452877-1-amelie.delaunay@foss.st.com> <20231009090213.GA1547647@gnbcxd0016.gnb.st.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20231009090213.GA1547647@gnbcxd0016.gnb.st.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231016_041106_028915_6FD5DD3A X-CRM114-Status: GOOD ( 19.20 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 09-10-23, 11:02, Alain Volmat wrote: > Hi Am=E9lie, > = > thanks a lot. > = > Tested-by: Alain Volmat Please **do ** not ** top post! > = > Regards, > Alain > = > On Mon, Oct 09, 2023 at 10:24:50AM +0200, Amelie Delaunay wrote: > > From: Alain Volmat > > = > > In case of the prep descriptor while the channel is already running, the > > CCR register value stored into the channel could already have its EN bit > > set. This would lead to a bad transfer since, at start transfer time, > > enabling the channel while other registers aren't yet properly set. > > To avoid this, ensure to mask the CCR_EN bit when storing the ccr value > > into the mdma channel structure. > > = > > Fixes: a4ffb13c8946 ("dmaengine: Add STM32 MDMA driver") > > Signed-off-by: Alain Volmat > > Signed-off-by: Amelie Delaunay > > Cc: stable@vger.kernel.org > > --- > > drivers/dma/stm32-mdma.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > = > > diff --git a/drivers/dma/stm32-mdma.c b/drivers/dma/stm32-mdma.c > > index bae08b3f55c7..f414efdbd809 100644 > > --- a/drivers/dma/stm32-mdma.c > > +++ b/drivers/dma/stm32-mdma.c > > @@ -489,7 +489,7 @@ static int stm32_mdma_set_xfer_param(struct stm32_m= dma_chan *chan, > > src_maxburst =3D chan->dma_config.src_maxburst; > > dst_maxburst =3D chan->dma_config.dst_maxburst; > > = > > - ccr =3D stm32_mdma_read(dmadev, STM32_MDMA_CCR(chan->id)); > > + ccr =3D stm32_mdma_read(dmadev, STM32_MDMA_CCR(chan->id)) & ~STM32_MD= MA_CCR_EN; > > ctcr =3D stm32_mdma_read(dmadev, STM32_MDMA_CTCR(chan->id)); > > ctbr =3D stm32_mdma_read(dmadev, STM32_MDMA_CTBR(chan->id)); > > = > > @@ -965,7 +965,7 @@ stm32_mdma_prep_dma_memcpy(struct dma_chan *c, dma_= addr_t dest, dma_addr_t src, > > if (!desc) > > return NULL; > > = > > - ccr =3D stm32_mdma_read(dmadev, STM32_MDMA_CCR(chan->id)); > > + ccr =3D stm32_mdma_read(dmadev, STM32_MDMA_CCR(chan->id)) & ~STM32_MD= MA_CCR_EN; > > ctcr =3D stm32_mdma_read(dmadev, STM32_MDMA_CTCR(chan->id)); > > ctbr =3D stm32_mdma_read(dmadev, STM32_MDMA_CTBR(chan->id)); > > cbndtr =3D stm32_mdma_read(dmadev, STM32_MDMA_CBNDTR(chan->id)); > > -- = > > 2.25.1 > > = -- = ~Vinod _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel