From patchwork Fri Nov 17 10:03:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?K=C3=B6ry_Maincent?= X-Patchwork-Id: 166078 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9910:0:b0:403:3b70:6f57 with SMTP id i16csp419528vqn; Fri, 17 Nov 2023 02:04:27 -0800 (PST) X-Google-Smtp-Source: AGHT+IF8nm/ExZnvCX/F44oj4b2DeJJWOCwaUq9g7UqC1AlePZRW7NbHBKf7RFpvdikcDanC4gkO X-Received: by 2002:a17:90b:3850:b0:27d:12e1:94e0 with SMTP id nl16-20020a17090b385000b0027d12e194e0mr15355548pjb.36.1700215466829; Fri, 17 Nov 2023 02:04:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700215466; cv=none; d=google.com; s=arc-20160816; b=uxotyDYauZGxx+O1GSy2QZlpMtqjbEFMSzNDzPjvhc6XBtjjglaDVlKGbQPiOuqzor Fhq1rYN7le7jXx6LFBz0l9uBO5xTWra1tvu0z7GOF0T99KshJLXPBZ8nkQKU8VdBnBPc XchGKouDJ6yPek86xM4cl0JRdW8nWOHhg/3lhagDS9KW1hma1/3AaEn6J/Owo2jmo/m7 j52LLvCfaGM/YXvaqStJXgLR07g/tzAIOr4/egoxS8ryL+0BaYTHAut05Oj46FuA5FJo zMK+oskCkZRqjtPANQy1cfHvHZj3oM9poUMJVAHpvpG0xrbc2ob9bsi/7aJvy6vza2CO cl3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=MG/EpR8bVcQceln2f1UmgAvAjO7ip8LLXAJEWchyMuQ=; fh=Fko32OqwGgI5WpcqYpp5KigXgtelsKMiigtnZERCGL8=; b=0iBFxDrppTLNH3muAGodqMV/uwJYN8zilgaJHpx4Xe0vX5GlaCpTK/QKuKGEIsayJz pKMIIvBB5cO0LTJwD1+K1KKFtoVsiWVd4yQP4C5+i0qAsns6wBO1Kj4NIzzXV0mRJY9J kFGyim/reKODo7Zw07Ows7zp4nbTD6GZa/jJNeSQ1+wuCaPNzPGoj7mVQjL1ZGyJ43T/ G9rucor8yHz/FxjAymVF/hkR4EtRUxXS4skeKTrUqWT2aNke55Y8/gtJXYftFdIkcC+W qLUgONXL8HqNEDz4hx51hB3SBdQRy3q2XQHpXZzEK8y9dGLjUzA/kCw01aJ+oqvuxgrf rHoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=p3UZahcB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id h24-20020a17090ac39800b0027ce5205f94si1573978pjt.150.2023.11.17.02.04.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Nov 2023 02:04:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=p3UZahcB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 3007980BC502; Fri, 17 Nov 2023 02:04:25 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345827AbjKQKER (ORCPT + 30 others); Fri, 17 Nov 2023 05:04:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41822 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230383AbjKQKEM (ORCPT ); Fri, 17 Nov 2023 05:04:12 -0500 Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 188ECA9; Fri, 17 Nov 2023 02:04:07 -0800 (PST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 2DD6EFF81D; Fri, 17 Nov 2023 10:04:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1700215446; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MG/EpR8bVcQceln2f1UmgAvAjO7ip8LLXAJEWchyMuQ=; b=p3UZahcB5fPC27GIKBJabXO5yGHhpl+kOie0qlM7j1CpkzJyrQcOTgUyIeLo+dxwDCc8LJ wcIFqOwpqlsYXCZyC3le3j3IOn3+s3fBImDVtTnQ41iadU/8lxdtZZg4CnP8Mlg/8xvzIV gm9Ay9vzq98L1n6juEMCyLaOuGAe6XrCsCJ+b3llcTKwoyvmoeFRxxSQOZ/MoT8f3dtPVR 3zv1QPyoW0I/ySSr1IdJsaah5IkVDd5upVx/KnT7jijLnsi5M917oLCG8nefH7qc/R+JBt eWxxxA2FMtg4ejttruB5ZA8bpXRBqe4TgSxsKmm9N6PCNLxgQsvBQ11F6j7Ekw== From: Kory Maincent Date: Fri, 17 Nov 2023 11:03:49 +0100 Subject: [PATCH v6 1/6] dmaengine: dw-edma: Fix the ch_count hdma callback MIME-Version: 1.0 Message-Id: <20231117-b4-feature_hdma_mainline-v6-1-ebf7aa0e40d7@bootlin.com> References: <20231117-b4-feature_hdma_mainline-v6-0-ebf7aa0e40d7@bootlin.com> In-Reply-To: <20231117-b4-feature_hdma_mainline-v6-0-ebf7aa0e40d7@bootlin.com> To: Manivannan Sadhasivam , Gustavo Pimentel , Serge Semin , Vinod Koul , Cai Huoqing Cc: Thomas Petazzoni , dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, Herve Codina , Kory Maincent , Manivannan Sadhasivam X-Mailer: b4 0.12.4 X-GND-Sasl: kory.maincent@bootlin.com X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE,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 (snail.vger.email [0.0.0.0]); Fri, 17 Nov 2023 02:04:25 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782805133428019523 X-GMAIL-MSGID: 1782805133428019523 The current check of ch_en enabled to know the maximum number of available hardware channels is wrong as it check the number of ch_en register set but all of them are unset at probe. This register is set at the dw_hdma_v0_core_start function which is run lately before a DMA transfer. The HDMA IP have no way to know the number of hardware channels available like the eDMA IP, then let set it to maximum channels and let the platform set the right number of channels. Fixes: e74c39573d35 ("dmaengine: dw-edma: Add support for native HDMA") Acked-by: Manivannan Sadhasivam Reviewed-by: Serge Semin Signed-off-by: Kory Maincent --- See the following thread mail that talk about this issue: https://lore.kernel.org/lkml/20230607095832.6d6b1a73@kmaincent-XPS-13-7390/ Changes in v2: - Add comment Changes in v3: - Fix comment style. --- drivers/dma/dw-edma/dw-hdma-v0-core.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/drivers/dma/dw-edma/dw-hdma-v0-core.c b/drivers/dma/dw-edma/dw-hdma-v0-core.c index 00b735a0202a..1f4cb7db5475 100644 --- a/drivers/dma/dw-edma/dw-hdma-v0-core.c +++ b/drivers/dma/dw-edma/dw-hdma-v0-core.c @@ -65,18 +65,12 @@ static void dw_hdma_v0_core_off(struct dw_edma *dw) static u16 dw_hdma_v0_core_ch_count(struct dw_edma *dw, enum dw_edma_dir dir) { - u32 num_ch = 0; - int id; - - for (id = 0; id < HDMA_V0_MAX_NR_CH; id++) { - if (GET_CH_32(dw, id, dir, ch_en) & BIT(0)) - num_ch++; - } - - if (num_ch > HDMA_V0_MAX_NR_CH) - num_ch = HDMA_V0_MAX_NR_CH; - - return (u16)num_ch; + /* + * The HDMA IP have no way to know the number of hardware channels + * available, we set it to maximum channels and let the platform + * set the right number of channels. + */ + return HDMA_V0_MAX_NR_CH; } static enum dma_status dw_hdma_v0_core_ch_status(struct dw_edma_chan *chan) From patchwork Fri Nov 17 10:03:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?K=C3=B6ry_Maincent?= X-Patchwork-Id: 166077 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9910:0:b0:403:3b70:6f57 with SMTP id i16csp419453vqn; Fri, 17 Nov 2023 02:04:20 -0800 (PST) X-Google-Smtp-Source: AGHT+IHy1KCaGKSDNs/gtXykaUf1jK3Lyn6UDYAwq78jthBicNpHX3Gqjva+DIAdlpitGEjOxVQU X-Received: by 2002:a17:902:e88e:b0:1cc:5aef:f2c3 with SMTP id w14-20020a170902e88e00b001cc5aeff2c3mr6564290plg.22.1700215460050; Fri, 17 Nov 2023 02:04:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700215460; cv=none; d=google.com; s=arc-20160816; b=bDec+vptVgqEliST1n4BgK/B0QX/ywQySyEst7UOop2h5+nnizt5OgGHwdX3SeGfrI IJCC5RpYgUGzwkWVE7YW9zFka3MGyLvtWaAp4ObzyQ0KHFgQFPaN+dc4CXNSw+RMbae1 faemJed/Q4XYOfekAEEO0GkHuB4kSK2L+3l9W2skqZgYmXbcUkO4hwOUYMPUTZT0C8LM SxgwFXxPaRB7rYLcoTY/O7bwFQqSilldOy1P+c1chlIDIsHkbMl6VTtbryA3DpTTYGTS 9GOzyzsVmvLrNQBdaEeZgHK3XAH5JFbSEPaWmNqEeigHvhMlsca5ziC9ycotxK3fumWC M09Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=FAldIdFOcM6TSQgoc+utZ58ITzn88qsDQysRSDWf7aE=; fh=Fko32OqwGgI5WpcqYpp5KigXgtelsKMiigtnZERCGL8=; b=VOHsirKiYugIoaLGW0LJg5VaveHm016/3ge5fBFFbP6gWaZgqZecsi0/NNrHEn/DZ8 X/m+jSIPw3sCFpTduavH2TbDmkaA2AOyKFk5jT7m+mt/8UDYfomglp1aNkGsL6GWUCJs 73OHygL6FdNZi8uqsKHV4DHVdh4Y6bjK86Rkc5FmRIs+2bWzwq27B162RWJV0vZRtM4b m7ns2bRwhnSDnewss9WF5rYFQAGobgiAs8f5Twt9G5or1rQVuINE49g5QIw2vBJuidRk p2eviqIUS1YAiItRpcHiC9mgKI3dWov3oM5Ks3cdha5I6KMLHijQ8cas6CEnv+L10zfI aflQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=CWRbqMYk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id y8-20020a634b08000000b005c17124d9b9si1540978pga.74.2023.11.17.02.04.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Nov 2023 02:04:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=CWRbqMYk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 10B1380BC502; Fri, 17 Nov 2023 02:04:19 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345820AbjKQKEO (ORCPT + 30 others); Fri, 17 Nov 2023 05:04:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41838 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230105AbjKQKEM (ORCPT ); Fri, 17 Nov 2023 05:04:12 -0500 Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::229]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E3B6AD; Fri, 17 Nov 2023 02:04:08 -0800 (PST) Received: by mail.gandi.net (Postfix) with ESMTPSA id B02BFFF80F; Fri, 17 Nov 2023 10:04:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1700215447; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=FAldIdFOcM6TSQgoc+utZ58ITzn88qsDQysRSDWf7aE=; b=CWRbqMYkcicpcthfaTaZUOscd6Wt623MOsiQdZmUgWhnIc1T6SfQvhnfkr9w3z6sXRvzZg +jSHd2ucjSFwLUtWTWNGpsEnB4irS2FCwHUNlJP6teX085KkgGMNBUVjMvxFIR565ru+la /pdox0q4vBvNZsO9cPSteGHeJrfRWfEQEnVAhODfmwHcOo2ePeGqoeYYB7xoGCz4QHFiBK gCm8GgfaA4CSOPTPjURP8gquTjdy8KBee5gEgBO55CaMj5ckVon35OBdD8YGy4cgr0WlL5 7Smf8QWcZf/zm6gSKw07/HBe6OQ5Y0RoccMolikPqPVtcjPnnIgJbkIqnxK4bw== From: Kory Maincent Date: Fri, 17 Nov 2023 11:03:50 +0100 Subject: [PATCH v6 2/6] dmaengine: dw-edma: Fix wrong interrupt bit set for HDMA MIME-Version: 1.0 Message-Id: <20231117-b4-feature_hdma_mainline-v6-2-ebf7aa0e40d7@bootlin.com> References: <20231117-b4-feature_hdma_mainline-v6-0-ebf7aa0e40d7@bootlin.com> In-Reply-To: <20231117-b4-feature_hdma_mainline-v6-0-ebf7aa0e40d7@bootlin.com> To: Manivannan Sadhasivam , Gustavo Pimentel , Serge Semin , Vinod Koul , Cai Huoqing Cc: Thomas Petazzoni , dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, Herve Codina , Kory Maincent , Manivannan Sadhasivam X-Mailer: b4 0.12.4 X-GND-Sasl: kory.maincent@bootlin.com X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE,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 (snail.vger.email [0.0.0.0]); Fri, 17 Nov 2023 02:04:19 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782805126541395658 X-GMAIL-MSGID: 1782805126541395658 Instead of setting HDMA_V0_LOCAL_ABORT_INT_EN bit, HDMA_V0_LOCAL_STOP_INT_EN bit got set twice, due to which the abort interrupt is not getting generated for HDMA. Fix it by setting the correct interrupt enable bit. Fixes: e74c39573d35 ("dmaengine: dw-edma: Add support for native HDMA") Reviewed-by: Serge Semin Reviewed-by: Manivannan Sadhasivam Signed-off-by: Kory Maincent --- Changes in v3: - Split the patch in two to differ bug fix and simple harmless typo. Changes in v6: - Update commit message --- drivers/dma/dw-edma/dw-hdma-v0-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/dma/dw-edma/dw-hdma-v0-core.c b/drivers/dma/dw-edma/dw-hdma-v0-core.c index 1f4cb7db5475..108f9127aaaa 100644 --- a/drivers/dma/dw-edma/dw-hdma-v0-core.c +++ b/drivers/dma/dw-edma/dw-hdma-v0-core.c @@ -236,7 +236,7 @@ static void dw_hdma_v0_core_start(struct dw_edma_chunk *chunk, bool first) /* Interrupt enable&unmask - done, abort */ tmp = GET_CH_32(dw, chan->dir, chan->id, int_setup) | HDMA_V0_STOP_INT_MASK | HDMA_V0_ABORT_INT_MASK | - HDMA_V0_LOCAL_STOP_INT_EN | HDMA_V0_LOCAL_STOP_INT_EN; + HDMA_V0_LOCAL_STOP_INT_EN | HDMA_V0_LOCAL_ABORT_INT_EN; SET_CH_32(dw, chan->dir, chan->id, int_setup, tmp); /* Channel control */ SET_CH_32(dw, chan->dir, chan->id, control1, HDMA_V0_LINKLIST_EN); From patchwork Fri Nov 17 10:03:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?K=C3=B6ry_Maincent?= X-Patchwork-Id: 166081 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9910:0:b0:403:3b70:6f57 with SMTP id i16csp419733vqn; Fri, 17 Nov 2023 02:04:52 -0800 (PST) X-Google-Smtp-Source: AGHT+IGSlLcMBwqkFVj91zQXx97lN3TGNCW3VLcUnFBwloamdtEnhi76GqKrPz762/8V9CUGzAbl X-Received: by 2002:a05:6a21:3715:b0:187:703a:8658 with SMTP id yl21-20020a056a21371500b00187703a8658mr6016444pzb.59.1700215491953; Fri, 17 Nov 2023 02:04:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700215491; cv=none; d=google.com; s=arc-20160816; b=rJFifFK1sIUMMGbIFzJ9BOtUNJFVnt2oNciNOlE+szYa5JUQCZpjdxQcWJfwV71Mhn mKUlI8VJ5CrSh/WNfs2M9FAEUb99e+nfWMn9m/ZC1rqyqvchpMVolI+omjVX9I5xmq+0 n08krh0ucz5rtqGaqQgEazZJJ25MS4uAwu5TdI0RZ3jwkJMadlxWif4Vp9n+i7DIUIJq rgtemLUnYNA5GN8iNzNCucNK+G3EBWjNuPZwvk3iEx6cZ9aCO9sitRCrmlEii+BnObqJ XGpok8LvCTsXWL1lTGMwcxmJH1EBD7honzgqDWhsc/NBBjwdhykDeymRxCFyyuOPVtdo 2NMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=Cl2LjMo9y4kvfDVQJV3DM0tMK1TINYKcgigqy6Qohec=; fh=Fko32OqwGgI5WpcqYpp5KigXgtelsKMiigtnZERCGL8=; b=w9yIFGT1J38/x9nbcoInu0fWInm4VwJ/mRipbQyLODnlCn0ZjXzt8wLqp635srQntY CZgtrRyKBnk/Lk2TSG2PjogbalgVtS5CrM8DNxqVWHtHotQGD8kKW6ID7vknlgbDd19O yLDT5M0NRWcXDvEBpPUE9MU+Z09K7yKr/h0ZWKXbHe2UDPKV+rOpSHyzYY/gkWjo5+0r 6QQCis0WFuT4WZbieiOHLTh6yCRozQmqt5X4g99Y9i5U76YVB6pW4gmlIx3ddFY6n9RG dW96oaBG6WUZTmWVzWxj7qMJbI1H3nj9Wj0gulq/n5ahh9J7yc1RkLfWHIDvbhgKXXxY mxbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=RCp2V0P3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id h13-20020a170902eecd00b001ca485b8514si1444751plb.646.2023.11.17.02.04.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Nov 2023 02:04:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=RCp2V0P3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 006FE820D5CB; Fri, 17 Nov 2023 02:04:42 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345842AbjKQKEU (ORCPT + 30 others); Fri, 17 Nov 2023 05:04:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41854 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345719AbjKQKEM (ORCPT ); Fri, 17 Nov 2023 05:04:12 -0500 Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DE977B0; Fri, 17 Nov 2023 02:04:08 -0800 (PST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 38394FF803; Fri, 17 Nov 2023 10:04:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1700215447; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Cl2LjMo9y4kvfDVQJV3DM0tMK1TINYKcgigqy6Qohec=; b=RCp2V0P3x9CUu7RYAlP4bUyJuhoBpyrtZtFKsDlc+qoLE942p6cLWUPQpj0Chgvw/U84Rk N7BFXpYxvzqWwh8p/Q6B8sAAHG7VkO+hdA70ZLN+i6WUOijmQw//rFh7T1tA40OgU6c2yp n4PfRgReGy9U+lnkOtX0YvEXVQpgbVE4yXVSUQAgW/DEZsy67gcKNmNjqcUNpb0KKY7wCG LO2v+L22qVI1JLKTuG4sGiw1XEVIzYE4Xv8hubLcv2i72+7J+4Rw5agm+QKiN1PC7qajtw VSGllGb8VvGAThztu1xp1gUbCxsdRUe12HLKjszykKIxy8zoVweJDlcQfUprCg== From: Kory Maincent Date: Fri, 17 Nov 2023 11:03:51 +0100 Subject: [PATCH v6 3/6] dmaengine: dw-edma: HDMA_V0_REMOTEL_STOP_INT_EN typo fix MIME-Version: 1.0 Message-Id: <20231117-b4-feature_hdma_mainline-v6-3-ebf7aa0e40d7@bootlin.com> References: <20231117-b4-feature_hdma_mainline-v6-0-ebf7aa0e40d7@bootlin.com> In-Reply-To: <20231117-b4-feature_hdma_mainline-v6-0-ebf7aa0e40d7@bootlin.com> To: Manivannan Sadhasivam , Gustavo Pimentel , Serge Semin , Vinod Koul , Cai Huoqing Cc: Thomas Petazzoni , dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, Herve Codina , Kory Maincent , Manivannan Sadhasivam X-Mailer: b4 0.12.4 X-GND-Sasl: kory.maincent@bootlin.com X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email 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 (lipwig.vger.email [0.0.0.0]); Fri, 17 Nov 2023 02:04:43 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782805159773625142 X-GMAIL-MSGID: 1782805159773625142 Fix "HDMA_V0_REMOTEL_STOP_INT_EN" typo error Fixes: e74c39573d35 ("dmaengine: dw-edma: Add support for native HDMA") Reviewed-by: Serge Semin Reviewed-by: Manivannan Sadhasivam Signed-off-by: Kory Maincent --- Changes in v3: - Split the patch in two to differ bug fix and simple harmless typo. Changes in v6: - Mention the typo in the subject. --- drivers/dma/dw-edma/dw-hdma-v0-regs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/dma/dw-edma/dw-hdma-v0-regs.h b/drivers/dma/dw-edma/dw-hdma-v0-regs.h index a974abdf8aaf..eab5fd7177e5 100644 --- a/drivers/dma/dw-edma/dw-hdma-v0-regs.h +++ b/drivers/dma/dw-edma/dw-hdma-v0-regs.h @@ -15,7 +15,7 @@ #define HDMA_V0_LOCAL_ABORT_INT_EN BIT(6) #define HDMA_V0_REMOTE_ABORT_INT_EN BIT(5) #define HDMA_V0_LOCAL_STOP_INT_EN BIT(4) -#define HDMA_V0_REMOTEL_STOP_INT_EN BIT(3) +#define HDMA_V0_REMOTE_STOP_INT_EN BIT(3) #define HDMA_V0_ABORT_INT_MASK BIT(2) #define HDMA_V0_STOP_INT_MASK BIT(0) #define HDMA_V0_LINKLIST_EN BIT(0) From patchwork Fri Nov 17 10:03:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?K=C3=B6ry_Maincent?= X-Patchwork-Id: 166082 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9910:0:b0:403:3b70:6f57 with SMTP id i16csp419782vqn; Fri, 17 Nov 2023 02:04:56 -0800 (PST) X-Google-Smtp-Source: AGHT+IFXYLoZX0EOVFVfkRMCrCqfLa9i/581K86jw3NWpfAmiynx2ugObSfqDY4c5ufP9jRS+2E1 X-Received: by 2002:a05:6871:5289:b0:1d6:cbcd:80f8 with SMTP id hu9-20020a056871528900b001d6cbcd80f8mr25252697oac.54.1700215496548; Fri, 17 Nov 2023 02:04:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700215496; cv=none; d=google.com; s=arc-20160816; b=Qa6eHFW6hxt8Oc8j87+96QyAjeMwWX5+GUV5ReGbak3/CCfr77lXaBb6tQ+Rdtn3qL xHNOZ8cvweHoPwHQVF6bodXHcZaP985FyEGoricF5x0cZR/PJ/MEEOSj8trSEi1oWPJI 2DKR85yzBSIZTWNfLzIDR7lYgCLX7p8BScNvqMeqBeohaW/eLrMu9L4GEulGTSapKWNe n+UKRgWZJ7xN5T7MmfQcN3k3VgPZXig6E6II/IOmmibLL0z40Z6nMnM50VtixZ5TMuPk kAXBPV0jzad8xbjlC9hxHVKLKbuSx4BiRXeoHSal3sLraJti2GlY/FvdZ+HWN+iGEERe kfTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=svngh7gavoOsAoTd14KvI+aVm1JHod9n5Mvh72UXNZY=; fh=Fko32OqwGgI5WpcqYpp5KigXgtelsKMiigtnZERCGL8=; b=YSz74xr+F+SdPtma7TaeeN9rsSOGB6fdF+cX65adNWYsMUF9K/63s0Ar0/pu3wHiNj WVhw3adFB7jXiXAz83CvhiO34+Nz+XkI/EyMsRZ/HP9wQw58xK3/2H5KEER/7UDxDBub yxcrQbyMJ+/xjlpsSYK6rxsiaMwrc8cQhirgiQtwuXD1hpzqH59fP5uQmq4r6xKiH0Bg x4dMx7cORa5DERTtz0b94TG0g428d2eEqnUxuP2kDNc0J8Lma2gjNvpXcU1gvojscVfG Wr9rcX0ZFPhjRmJ5K9WZusb23EaOWYKyHYjn/9zR1YzQcc+mxGvEYDP8o6B0tZ+OkmF3 BZhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=QYHHyKIm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id p15-20020a056a000b4f00b0068e45c6ca3fsi1703124pfo.93.2023.11.17.02.04.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Nov 2023 02:04:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=QYHHyKIm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 0170681DD255; Fri, 17 Nov 2023 02:04:51 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235706AbjKQKEX (ORCPT + 30 others); Fri, 17 Nov 2023 05:04:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41860 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345796AbjKQKEN (ORCPT ); Fri, 17 Nov 2023 05:04:13 -0500 Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::229]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AB864C1; Fri, 17 Nov 2023 02:04:09 -0800 (PST) Received: by mail.gandi.net (Postfix) with ESMTPSA id BA377FF817; Fri, 17 Nov 2023 10:04:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1700215448; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=svngh7gavoOsAoTd14KvI+aVm1JHod9n5Mvh72UXNZY=; b=QYHHyKIme7eUxzobIVI12NLStklWJelYUHOZJ8AvmXXYvVElzTGwhkFIEekpHOSAcW+K18 l2G2pjqbTC+vUGDQq4caHJnddWHbObwbnmuLFdXz6OHmI5UQdklpT+f5Tam2dLWOW8kYqZ aygZ3O+Dh2MQLgPPzYeM3II+RhgcZsTqTiW7Gd5RkguZymAmsnmbw88V2uQDy1Nsu+B+Yr M5sifRmoU3s/BGjR6O0bBukYE5UNkg63Dh/xrTT5HSqVhwIG5d/kk4MH6BX71psxXwLM8n AeT5maXpNpy6RDf8b46r8dFUQyUMjm/QOYl+KuSWQRvIph3e3tZsuZljL0ziWw== From: Kory Maincent Date: Fri, 17 Nov 2023 11:03:52 +0100 Subject: [PATCH v6 4/6] dmaengine: dw-edma: Add HDMA remote interrupt configuration MIME-Version: 1.0 Message-Id: <20231117-b4-feature_hdma_mainline-v6-4-ebf7aa0e40d7@bootlin.com> References: <20231117-b4-feature_hdma_mainline-v6-0-ebf7aa0e40d7@bootlin.com> In-Reply-To: <20231117-b4-feature_hdma_mainline-v6-0-ebf7aa0e40d7@bootlin.com> To: Manivannan Sadhasivam , Gustavo Pimentel , Serge Semin , Vinod Koul , Cai Huoqing Cc: Thomas Petazzoni , dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, Herve Codina , Kory Maincent , Manivannan Sadhasivam X-Mailer: b4 0.12.4 X-GND-Sasl: kory.maincent@bootlin.com X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email 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 (agentk.vger.email [0.0.0.0]); Fri, 17 Nov 2023 02:04:51 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782805164280258659 X-GMAIL-MSGID: 1782805164280258659 Only the local interruption was configured, remote interrupt was left behind. This patch fix it by setting stop and abort remote interrupts when the DW_EDMA_CHIP_LOCAL flag is not set. Fixes: e74c39573d35 ("dmaengine: dw-edma: Add support for native HDMA") Signed-off-by: Kory Maincent Reviewed-by: Serge Semin Acked-by: Manivannan Sadhasivam --- drivers/dma/dw-edma/dw-hdma-v0-core.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/dma/dw-edma/dw-hdma-v0-core.c b/drivers/dma/dw-edma/dw-hdma-v0-core.c index 108f9127aaaa..04b0bcb6ded9 100644 --- a/drivers/dma/dw-edma/dw-hdma-v0-core.c +++ b/drivers/dma/dw-edma/dw-hdma-v0-core.c @@ -237,6 +237,8 @@ static void dw_hdma_v0_core_start(struct dw_edma_chunk *chunk, bool first) tmp = GET_CH_32(dw, chan->dir, chan->id, int_setup) | HDMA_V0_STOP_INT_MASK | HDMA_V0_ABORT_INT_MASK | HDMA_V0_LOCAL_STOP_INT_EN | HDMA_V0_LOCAL_ABORT_INT_EN; + if (!(dw->chip->flags & DW_EDMA_CHIP_LOCAL)) + tmp |= HDMA_V0_REMOTE_STOP_INT_EN | HDMA_V0_REMOTE_ABORT_INT_EN; SET_CH_32(dw, chan->dir, chan->id, int_setup, tmp); /* Channel control */ SET_CH_32(dw, chan->dir, chan->id, control1, HDMA_V0_LINKLIST_EN); From patchwork Fri Nov 17 10:03:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?K=C3=B6ry_Maincent?= X-Patchwork-Id: 166080 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9910:0:b0:403:3b70:6f57 with SMTP id i16csp419670vqn; Fri, 17 Nov 2023 02:04:43 -0800 (PST) X-Google-Smtp-Source: AGHT+IGGV7HUoKAB5OihgIo9ry0Rv34jq1w0oJ04QDeMus+l1LrzKdm3ytgIYKVCdPVo0C5uWyxe X-Received: by 2002:a17:90b:3902:b0:27c:ecec:8854 with SMTP id ob2-20020a17090b390200b0027cecec8854mr6431279pjb.7.1700215482835; Fri, 17 Nov 2023 02:04:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700215482; cv=none; d=google.com; s=arc-20160816; b=PTzgNPdiNc7DE80F9EcjI4lc23JpOiIkZzx8t90+jyUgCyN/fWSHNxM5kA0Y6pNPuk 5nEHEsP/tgcncVCpgMfHMETY1usNTTkAHmrbRHYbLzbJfBgBJ9Rv8Rs0OzSvvZIbRdd+ tg4xYxTlLrYkUQ2r9Ko/QzICF7ym6nN2ckPSzOM7bDAkrRRByUrKd5+XJMe9Hz1FVt0I 1fi9XBMf1pn3e1XupaMryeWmHdjnZlpYkhURxfacuVhoyj+RLH+DN5Ov2/KhZ0khvxY7 N9EjbPfy2SKAUXgQS5sGVmS1KuJD22r2+y8DL0jzncCzyZx3JSzilH70NIx9B+yXAYDg Xrbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=ppALPMc1pFTIFQzwRMW+tmzwmtQj10e6/dO7SG+F1wI=; fh=Fko32OqwGgI5WpcqYpp5KigXgtelsKMiigtnZERCGL8=; b=c/+wXk9l45ZK7WQm7NrSMHbgYqbTo8mqXwbRR926Wl7DqpK8NNKbotnisBGM9r8gbu VNUUJgTf+ihaPLc5/ApkqVmdROGLq+6RGpaMtcZhvquP/yzNreBqjfO163YhnhmBWPsp NMnw4rEvb6mXfz5LkaHKtXBdQDGTyaKAPmKLAGFxd16fEAKkwmRFpen8Awak2sJISWtz 2fnH8uHPuQJkIxvHiH8cr2Chp5OygIZCo/DrVMsCFIX7Sb6nM1L0CNzgo3Ik/0uhWKtz C8fcyZ0GLk9gpK0NkBPKu3sj6fwP3JvYs9u9a/IXev/80FaS6N150d8SkXaaLeJv/DTd Vdcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=Nk9QOBXX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id lr16-20020a17090b4b9000b0027b258f284esi4057673pjb.26.2023.11.17.02.04.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Nov 2023 02:04:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=Nk9QOBXX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 07AA78270DFA; Fri, 17 Nov 2023 02:04:42 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345901AbjKQKEa (ORCPT + 30 others); Fri, 17 Nov 2023 05:04:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41864 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345812AbjKQKEO (ORCPT ); Fri, 17 Nov 2023 05:04:14 -0500 Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 345C6C4; Fri, 17 Nov 2023 02:04:10 -0800 (PST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 61BA3FF81F; Fri, 17 Nov 2023 10:04:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1700215448; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ppALPMc1pFTIFQzwRMW+tmzwmtQj10e6/dO7SG+F1wI=; b=Nk9QOBXXkZe4llaGhdKMLdybPq2Ys+qCWgZHo0Pqu1T/I1N0M3dRksIcsoMHP7nr5dtfxf 6i/sa+juuDTM+sP6A8BzmOF5UvDxgis/3p0tNggqxlk6nvDiHiVJ66i3UxsbEGn8rNw8le 5QSFaLRjEDZpgXIBZRUlVjICboIiEyp7IA+8UjD841jsPLL6MpoTpOuoNIH34uBqZTRmFj l4xEwiaZ74ODB4KZez8YoSvsWpSBRdhOTYNxbFcYgl3vLOL+cLUrswuB+sEgOOBqptNK/y +R6DIe+sLhbC82Qkx6wZGL9NojMmTkyB1B8buzuZ85auJPJIEQsMJS//3YxCsA== From: Kory Maincent Date: Fri, 17 Nov 2023 11:03:53 +0100 Subject: [PATCH v6 5/6] dmaengine: dw-edma: HDMA: Add sync read before starting the DMA transfer in remote setup MIME-Version: 1.0 Message-Id: <20231117-b4-feature_hdma_mainline-v6-5-ebf7aa0e40d7@bootlin.com> References: <20231117-b4-feature_hdma_mainline-v6-0-ebf7aa0e40d7@bootlin.com> In-Reply-To: <20231117-b4-feature_hdma_mainline-v6-0-ebf7aa0e40d7@bootlin.com> To: Manivannan Sadhasivam , Gustavo Pimentel , Serge Semin , Vinod Koul , Cai Huoqing Cc: Thomas Petazzoni , dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, Herve Codina , Kory Maincent , Manivannan Sadhasivam X-Mailer: b4 0.12.4 X-GND-Sasl: kory.maincent@bootlin.com X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE,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 (snail.vger.email [0.0.0.0]); Fri, 17 Nov 2023 02:04:42 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782805149759328173 X-GMAIL-MSGID: 1782805149759328173 The Linked list element and pointer are not stored in the same memory as the HDMA controller register. If the doorbell register is toggled before the full write of the linked list a race condition error will occur. In remote setup we can only use a readl to the memory to assure the full write has occurred. Fixes: e74c39573d35 ("dmaengine: dw-edma: Add support for native HDMA") Reviewed-by: Serge Semin Reviewed-by: Manivannan Sadhasivam Signed-off-by: Kory Maincent --- Changes in v2: - Move the sync read in a function. - Add commments Changes in v4: - Update git commit message. Changes in v6: - Fix comment typos. --- drivers/dma/dw-edma/dw-hdma-v0-core.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/dma/dw-edma/dw-hdma-v0-core.c b/drivers/dma/dw-edma/dw-hdma-v0-core.c index 04b0bcb6ded9..10e8f0715114 100644 --- a/drivers/dma/dw-edma/dw-hdma-v0-core.c +++ b/drivers/dma/dw-edma/dw-hdma-v0-core.c @@ -222,6 +222,20 @@ static void dw_hdma_v0_core_write_chunk(struct dw_edma_chunk *chunk) dw_hdma_v0_write_ll_link(chunk, i, control, chunk->ll_region.paddr); } +static void dw_hdma_v0_sync_ll_data(struct dw_edma_chunk *chunk) +{ + /* + * In case of remote HDMA engine setup, the DW PCIe RP/EP internal + * configuration registers and application memory are normally accessed + * over different buses. Ensure LL-data reaches the memory before the + * doorbell register is toggled by issuing the dummy-read from the remote + * LL memory in a hope that the MRd TLP will return only after the + * last MWr TLP is completed + */ + if (!(chunk->chan->dw->chip->flags & DW_EDMA_CHIP_LOCAL)) + readl(chunk->ll_region.vaddr.io); +} + static void dw_hdma_v0_core_start(struct dw_edma_chunk *chunk, bool first) { struct dw_edma_chan *chan = chunk->chan; @@ -252,6 +266,9 @@ static void dw_hdma_v0_core_start(struct dw_edma_chunk *chunk, bool first) /* Set consumer cycle */ SET_CH_32(dw, chan->dir, chan->id, cycle_sync, HDMA_V0_CONSUMER_CYCLE_STAT | HDMA_V0_CONSUMER_CYCLE_BIT); + + dw_hdma_v0_sync_ll_data(chunk); + /* Doorbell */ SET_CH_32(dw, chan->dir, chan->id, doorbell, HDMA_V0_DOORBELL_START); } From patchwork Fri Nov 17 10:03:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?K=C3=B6ry_Maincent?= X-Patchwork-Id: 166079 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9910:0:b0:403:3b70:6f57 with SMTP id i16csp419614vqn; Fri, 17 Nov 2023 02:04:37 -0800 (PST) X-Google-Smtp-Source: AGHT+IHxcE689+u9Rp76EvFbc4wilGcAy4aP336UXpEInSAzBykRJh3Vfdas1OiVKMXKttZmICV6 X-Received: by 2002:a05:6a21:9183:b0:184:d9f4:c2b3 with SMTP id tp3-20020a056a21918300b00184d9f4c2b3mr23314579pzb.29.1700215477637; Fri, 17 Nov 2023 02:04:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700215477; cv=none; d=google.com; s=arc-20160816; b=fgO5dHLBxBfFYzUh3WC24fXR4L4fyEaVqCO/sV7KI4KVVbtdpuwWpOGcBYDbVs0HPs xmot2p4mDNzeRmRdmlxrxtbyBcLx9pPESsBBqA9eVm2LcywEU387BNLPdivPCJsSnAbc 9qG3RN8nzywA8IHc8a5Z3RCMCnDHyC6hF+8JPvCEcMMGvUQlkDwibCzilP5i8eOXoIx4 xpMO/zqSt2sHM4q+QH7YXCLp+LJP3dZM81YmCb98s8O2eZ2fTjUnfTCeNjgJ53vkh7Uu pAbpfy+CfCKl3MM25GMSvL4CVtq4H/tdxIe1msMAUaj0lbwUG+JyBwMtO4fNEmQNR/na 7cSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=NmKeLzmrWDgqwybx3yFMvQV6TVy/TJmLs+gOb6jsjkI=; fh=Fko32OqwGgI5WpcqYpp5KigXgtelsKMiigtnZERCGL8=; b=Sqp2EMlXHnRO2NivuclCKupl02ooqgc2pJM1U7znwlTKagyGZRh7qNOLraE3VVIfx1 qEt6v/t9Z2laWKALLE4YAZ0LSHmPpCQanhMWkKAJw3n/Ctf+HZP9s2TJkViW8+y5X61a 6rNTq0AqC8G8GqHSqGbX2o5erJJgkIwyton2gkBH2dVvwZZ5glJByKWkYgNiKIsd+YTp ZDpH9AQ8P8UpE789KJ2LAvk9tvbvL6uzIE9PtujOsRnY3rr4pm3vQVl1elBWMXLCPBXM xyTTULNlCCfuSD+ougTY48ioCzSbzR6K4kKA8ZCfWdS15HZFSbZpfUW51PXXVAF3lY0s +mcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=ifWxZU5M; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id n5-20020a170902d2c500b001cc407388a8si1600142plc.337.2023.11.17.02.04.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Nov 2023 02:04:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=ifWxZU5M; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id DAD868270DF1; Fri, 17 Nov 2023 02:04:36 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345881AbjKQKE1 (ORCPT + 30 others); Fri, 17 Nov 2023 05:04:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41878 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345810AbjKQKEO (ORCPT ); Fri, 17 Nov 2023 05:04:14 -0500 Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ACFC7C5; Fri, 17 Nov 2023 02:04:10 -0800 (PST) Received: by mail.gandi.net (Postfix) with ESMTPSA id F0408FF80E; Fri, 17 Nov 2023 10:04:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1700215449; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NmKeLzmrWDgqwybx3yFMvQV6TVy/TJmLs+gOb6jsjkI=; b=ifWxZU5MoSMJa1RExPWzueMckAhDz+/FP9AYay2y7oLb+Zalg5OPxS+uJSZ6G4PLL7tG27 7B6Ezqo8uZROfk4rgCJc6dbvYgIY0+mmsg5++iTo+2fcRvuDlLaiwaAPAf0dyV1+8PobEE skGRJZEe1YrNGNOeLk6h94G5RCnogZx93R8UT/syiH7T0M9ZLWcTVt+xB67YQ+n6/3r0tV IGok0iY52aiynYO0qUXH50zKQ3zI/Qe6E8pLLQT4iH9YOGT69DmSBzVZnc2wkvYBBxQHs/ 4/1BS0mmd0dfRSU8bMiJBmTHfAEEK2aqW2EIlzEH2dGTFVoTpf8JR8kZfqoNKg== From: Kory Maincent Date: Fri, 17 Nov 2023 11:03:54 +0100 Subject: [PATCH v6 6/6] dmaengine: dw-edma: eDMA: Add sync read before starting the DMA transfer in remote setup MIME-Version: 1.0 Message-Id: <20231117-b4-feature_hdma_mainline-v6-6-ebf7aa0e40d7@bootlin.com> References: <20231117-b4-feature_hdma_mainline-v6-0-ebf7aa0e40d7@bootlin.com> In-Reply-To: <20231117-b4-feature_hdma_mainline-v6-0-ebf7aa0e40d7@bootlin.com> To: Manivannan Sadhasivam , Gustavo Pimentel , Serge Semin , Vinod Koul , Cai Huoqing Cc: Thomas Petazzoni , dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, Herve Codina , Kory Maincent , Manivannan Sadhasivam X-Mailer: b4 0.12.4 X-GND-Sasl: kory.maincent@bootlin.com X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE,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 (snail.vger.email [0.0.0.0]); Fri, 17 Nov 2023 02:04:36 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782805144551405078 X-GMAIL-MSGID: 1782805144551405078 The Linked list element and pointer are not stored in the same memory as the eDMA controller register. If the doorbell register is toggled before the full write of the linked list a race condition error will occur. In remote setup we can only use a readl to the memory to assure the full write has occurred. Fixes: 7e4b8a4fbe2c ("dmaengine: Add Synopsys eDMA IP version 0 support") Reviewed-by: Serge Semin Reviewed-by: Manivannan Sadhasivam Signed-off-by: Kory Maincent --- Changes in v2: - New patch Changes in v4: - Update git commit message. Changes in v6: - Fix comment typos. --- drivers/dma/dw-edma/dw-edma-v0-core.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/dma/dw-edma/dw-edma-v0-core.c b/drivers/dma/dw-edma/dw-edma-v0-core.c index b38786f0ad79..b75fdaffad9a 100644 --- a/drivers/dma/dw-edma/dw-edma-v0-core.c +++ b/drivers/dma/dw-edma/dw-edma-v0-core.c @@ -346,6 +346,20 @@ static void dw_edma_v0_core_write_chunk(struct dw_edma_chunk *chunk) dw_edma_v0_write_ll_link(chunk, i, control, chunk->ll_region.paddr); } +static void dw_edma_v0_sync_ll_data(struct dw_edma_chunk *chunk) +{ + /* + * In case of remote eDMA engine setup, the DW PCIe RP/EP internal + * configuration registers and application memory are normally accessed + * over different buses. Ensure LL-data reaches the memory before the + * doorbell register is toggled by issuing the dummy-read from the remote + * LL memory in a hope that the MRd TLP will return only after the + * last MWr TLP is completed + */ + if (!(chunk->chan->dw->chip->flags & DW_EDMA_CHIP_LOCAL)) + readl(chunk->ll_region.vaddr.io); +} + static void dw_edma_v0_core_start(struct dw_edma_chunk *chunk, bool first) { struct dw_edma_chan *chan = chunk->chan; @@ -412,6 +426,9 @@ static void dw_edma_v0_core_start(struct dw_edma_chunk *chunk, bool first) SET_CH_32(dw, chan->dir, chan->id, llp.msb, upper_32_bits(chunk->ll_region.paddr)); } + + dw_edma_v0_sync_ll_data(chunk); + /* Doorbell */ SET_RW_32(dw, chan->dir, doorbell, FIELD_PREP(EDMA_V0_DOORBELL_CH_MASK, chan->id));