Message ID | 20231004155024.2609531-1-amelie.delaunay@foss.st.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp227957vqb; Wed, 4 Oct 2023 08:51:15 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH+5ZRdrJxBp5jYkB2H4/cfEoUzOcMwwjoR9XpcCCTesmm3tffTd6mqNAQu+Co0FbxcpQSL X-Received: by 2002:a17:903:120b:b0:1bf:2e5c:7367 with SMTP id l11-20020a170903120b00b001bf2e5c7367mr2969908plh.42.1696434675131; Wed, 04 Oct 2023 08:51:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696434675; cv=none; d=google.com; s=arc-20160816; b=ilwOjOA/eceKmhNbNyyo7LBRINXKcGzTFVlsKW7ydn5FT630Tv25eeyqYH7JwIBIBM 0ilc9OosrT4RJTLaCOdVmOhBlfbVn/rkq6MsdBP7Rdo5N3y4hRRskHT0YsyEoJGAgQ1z NwIMVJFOvs9l3of+/6tWYgbL1kqatHU43Q3BHykuO96huN6rzO/oUz4k4dQotVFHBiKX 38SWNRJGf06cIiMigU3kti//TiDfIe92e4/T/MzVT3IHQYr+iPMks/6RRa2A5BWv3oWD eLOWQmsOG9zFcMYn9VyzbVrcsGCMvSrEwz0VI5ZXrf11cM9iqn6E1jJm5Xw09E0WWPCq PL1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=lRZ6+TZOKkUcJ4/oh5Hwp1GtRYeC8Duvo8t9N5cheIQ=; fh=tF4xhXBgjqqXUOk3C4NmeKC9W6ZCzLqPfkWrF6AWLmY=; b=BKIuO8gCiq/C9/zJIGE8b9yPrQIw8L0Hi6aDJtEX8Sx3jOkPQZiMxAVsBwXXtmERc4 90rFgzIOl7vmjdU9pIQRvpZmUHMTPLJ6e4RpMR6mFjMfMJ9Iu4idJBsF3rZpzQCtDDmf GF4F4KOdgp+SRPDBwNly993hjC0oGYRJTpfXQMVuzCE3QHMeKqTcISPtTo2IDnfQCSZH Q2fBvkKwZSOh/ZF7V/g1er/xXgxY+rTPx1MdJGZUtuqy18ICe8Dcsj38oR0qs4thvUow uMpp4PyK1bSX+iTYK7O6FneZOvcPwBaqBeIAq4aw6TIwx2V81zSZqWND0qLj2Gp04vcD ujlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@foss.st.com header.s=selector1 header.b=P4uF5FhL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=foss.st.com Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id kj5-20020a17090306c500b001bb0ff2b354si3691495plb.425.2023.10.04.08.51.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 08:51:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@foss.st.com header.s=selector1 header.b=P4uF5FhL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=foss.st.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 6B13E802EAED; Wed, 4 Oct 2023 08:51:02 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242975AbjJDPux (ORCPT <rfc822;pusanteemu@gmail.com> + 18 others); Wed, 4 Oct 2023 11:50:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42492 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233661AbjJDPut (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 4 Oct 2023 11:50:49 -0400 Received: from mx07-00178001.pphosted.com (mx07-00178001.pphosted.com [185.132.182.106]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 46167A6; Wed, 4 Oct 2023 08:50:43 -0700 (PDT) Received: from pps.filterd (m0369458.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.17.1.22/8.17.1.22) with ESMTP id 394ABEsL026844; Wed, 4 Oct 2023 17:50:29 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h= from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding:content-type; s=selector1; bh=lRZ6+TZ OKkUcJ4/oh5Hwp1GtRYeC8Duvo8t9N5cheIQ=; b=P4uF5FhLgV/f1VC0L/NGThz HeGNmrO6bY1DEm6xbv3+EuofO6XLYTFWeXGhD1KtCarTYV45eRRZhuVqmrxj4G+1 BeYuKQDO/hLspRUHPEq/x0gFioKPX0aSQPFRFbMYXnUvAsicTEw5mj61ItxyfUlv 9BXFyMKwRx3yrVTTimUO6xD6JPqw0i0A5q8Y5qIFSD+RhyimQKi+lgoFSGx01BEu U4AyJiQiVYWIXpajvfdoheCNl04XmEf+SE2tdFNETTjPZw7FZvkOJnQCMBf8dwHE jBNlB/V6KB3wmGKhohe6CBIqy8NhzaUp6hE48SPthMtj84ngC8HjagYN0fDtPig= = Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com (PPS) with ESMTPS id 3tew80qfcd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 04 Oct 2023 17:50:29 +0200 (MEST) Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id DF481100053; Wed, 4 Oct 2023 17:50:28 +0200 (CEST) Received: from Webmail-eu.st.com (shfdag1node3.st.com [10.75.129.71]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id D7CFC26028D; Wed, 4 Oct 2023 17:50:28 +0200 (CEST) Received: from localhost (10.252.26.61) by SHFDAG1NODE3.st.com (10.75.129.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Wed, 4 Oct 2023 17:50:28 +0200 From: Amelie Delaunay <amelie.delaunay@foss.st.com> To: Vinod Koul <vkoul@kernel.org>, Maxime Coquelin <mcoquelin.stm32@gmail.com>, Alexandre Torgue <alexandre.torgue@foss.st.com>, Amelie Delaunay <amelie.delaunay@foss.st.com> CC: <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: [PATCH 1/2] dmaengine: stm32-dma: fix stm32_dma_prep_slave_sg in case of MDMA chaining Date: Wed, 4 Oct 2023 17:50:23 +0200 Message-ID: <20231004155024.2609531-1-amelie.delaunay@foss.st.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.252.26.61] X-ClientProxiedBy: EQNCAS1NODE4.st.com (10.75.129.82) To SHFDAG1NODE3.st.com (10.75.129.71) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-10-04_07,2023-10-02_01,2023-05-22_02 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 04 Oct 2023 08:51:02 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778840685822112196 X-GMAIL-MSGID: 1778840685822112196 |
Series |
[1/2] dmaengine: stm32-dma: fix stm32_dma_prep_slave_sg in case of MDMA chaining
|
|
Commit Message
Amelie Delaunay
Oct. 4, 2023, 3:50 p.m. UTC
Current Target (CT) have to be reset when starting an MDMA chaining use
case, as Double Buffer mode is activated. It ensures the DMA will start
processing the first memory target (pointed with SxM0AR).
Fixes: 723795173ce1 ("dmaengine: stm32-dma: add support to trigger STM32 MDMA")
Signed-off-by: Amelie Delaunay <amelie.delaunay@foss.st.com>
Cc: stable@vger.kernel.org
---
drivers/dma/stm32-dma.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
Comments
On Wed, 04 Oct 2023 17:50:23 +0200, Amelie Delaunay wrote: > Current Target (CT) have to be reset when starting an MDMA chaining use > case, as Double Buffer mode is activated. It ensures the DMA will start > processing the first memory target (pointed with SxM0AR). > > Applied, thanks! [1/2] dmaengine: stm32-dma: fix stm32_dma_prep_slave_sg in case of MDMA chaining commit: 2df467e908ce463cff1431ca1b00f650f7a514b4 [2/2] dmaengine: stm32-dma: fix residue in case of MDMA chaining commit: 67e13e89742c3b21ce177f612bf9ef32caae6047 Best regards,
diff --git a/drivers/dma/stm32-dma.c b/drivers/dma/stm32-dma.c index 5c36811aa134..7427acc82259 100644 --- a/drivers/dma/stm32-dma.c +++ b/drivers/dma/stm32-dma.c @@ -1113,8 +1113,10 @@ static struct dma_async_tx_descriptor *stm32_dma_prep_slave_sg( chan->chan_reg.dma_scr &= ~STM32_DMA_SCR_PFCTRL; /* Activate Double Buffer Mode if DMA triggers STM32 MDMA and more than 1 sg */ - if (chan->trig_mdma && sg_len > 1) + if (chan->trig_mdma && sg_len > 1) { chan->chan_reg.dma_scr |= STM32_DMA_SCR_DBM; + chan->chan_reg.dma_scr &= ~STM32_DMA_SCR_CT; + } for_each_sg(sgl, sg, sg_len, i) { ret = stm32_dma_set_xfer_param(chan, direction, &buswidth,