Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp2698394rdb; Wed, 4 Oct 2023 08:51:15 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFA0dhSNM3wZgopHDIgBrnanxN8/CSZeQNLfq65t/y2RX1Wu9ICyDLE8a3T5UomDnSVre4v X-Received: by 2002:a05:6a20:dd87:b0:15c:c381:f65e with SMTP id kw7-20020a056a20dd8700b0015cc381f65emr2289737pzb.34.1696434674692; Wed, 04 Oct 2023 08:51:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696434674; cv=none; d=google.com; s=arc-20160816; b=Vf7YYxTVKk/nPeoaG0woMuZMa5+I0fSPZJMqd6/Z3l58lcFfsM2xU+C4OvLGAxdzgb Koyl/PW8j8LZ1a3d5oDfGrBNAQbLB/+pykSGmRqZ9WXzT1bARqvd+5dFWGK8CpdxTyqw rcSbXBceiINinHAioSu7xqoW/Y8kkFZedYdvWFZRmo3yMRHY7jokVn13vDaBB46hg6pR MVNPNEPv4qtYSRu340Ur+wB4gCHSQChw79ntfUnLGtILoePsdNN+Sf1w3/ETTir9jvI+ ELLCmo3srY7IbO1uCJ6xVZG1PsWGkXSM1+40PMzw/Ildv9hZ06S85yiK5db4aRjMtHnb msnA== 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 Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id g18-20020a056a000b9200b00693378349ecsi4010766pfj.351.2023.10.04.08.51.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 08:51:14 -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 8DB0E80439A8; Wed, 4 Oct 2023 08:50:58 -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 S242974AbjJDPux (ORCPT + 99 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 ); 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 To: Vinod Koul , Maxime Coquelin , Alexandre Torgue , Amelie Delaunay CC: , , , , 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: 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:50:58 -0700 (PDT) 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 Cc: stable@vger.kernel.org --- drivers/dma/stm32-dma.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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, -- 2.25.1