From patchwork Wed Oct 11 14:16:57 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: 151447 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp573235vqb; Wed, 11 Oct 2023 07:17:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFYMHyXC4xaCrIi3y48RqIGziZ4Z336hTlhYrq/mRW3Xm6gYUJZvOX5EBC5PFPOutLME5+X X-Received: by 2002:a17:902:dac8:b0:1bf:1a9e:85f7 with SMTP id q8-20020a170902dac800b001bf1a9e85f7mr24377884plx.1.1697033856759; Wed, 11 Oct 2023 07:17:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697033856; cv=none; d=google.com; s=arc-20160816; b=oGGR1OKG95ikDcsrFLUauB9kPEKUi/yP6f4mczSu70QtT3dj3lHc4tFMLix6DMOfIX hs1W64ZZVSF5CWHWKjfKN4os3qr1c3tEr5pQFi6Zc8jTrnNIeIdfRsx/oyP8/Ct64ThS BNwJb2pFD+2NVLWfj7Yw8CfK4zVpmneCm4v3JcgFN1tNIUrmUGC1eccmkJRirxZ1DSE1 UQ6JB3CIE4mz3s69fB55P3yQy3aGxUSxJmzjBLXVoF+YyT38ytB4nG2hpn4x5I6KDZnV mrOeAhYzouTZ63ezcidV12owHQzLrPjhwoz4RLIcuIXmgL2Y9xZir4aR5Hq7//6MFTeX nDbw== 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=aMwAca7ZnAnSD8CU1CO5CoeUBYV5Kn1hwp1G3dnAI9TvlSdpWSKPUUd/FCgKbedvZE sxT9XSusz8HXUJrcTgZdOlMi3NzNOdTluZi4v4I0E+JjE941hiPoRsdKk28EOBrAIWYF ieXSsgdQI4wVmZay+8Te2RG2Qp7YZtY73EmxRJIWVWdLOKdN+oTqYq3N7Er8P/hG0QH1 891Ek/xNHpc5a/xzGdDEBLfddDK1xrk3dV9HHAhKHjUAFD63qtZqDtAtEuMEsSACYv22 +ZWT/CNl4ikZpeT2Sk70I36Au4RY0A5tfjv+YhBZbkzctG7Yt+dh5lh9Rf+CjbCG7yen KhtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=omBzhJGi; 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 p8-20020a170902e74800b001c9b1c1006asi4673578plf.212.2023.10.11.07.17.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 07:17:36 -0700 (PDT) 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=omBzhJGi; 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 239FB8133CB5; Wed, 11 Oct 2023 07:17:32 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346876AbjJKORY (ORCPT + 18 others); Wed, 11 Oct 2023 10:17:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38298 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235057AbjJKORV (ORCPT ); Wed, 11 Oct 2023 10:17:21 -0400 Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::223]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 25004B6; Wed, 11 Oct 2023 07:17:18 -0700 (PDT) Received: by mail.gandi.net (Postfix) with ESMTPSA id 7ED2B60009; Wed, 11 Oct 2023 14:17:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1697033837; 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=omBzhJGiXMkoyMhghh9lOAaUVjCKnPJko9Xe2tYr5QUQn9gEm89glW5nCgV4M4Kf+fjdAj 2MNQ+dVZPr1bBF+EEFw6qK0tW0Zq+S/WgvqpQlwYQ6qZb3IQA9q8GWLe8LELreHjG2Xvs8 LAimgtDlpvBLQz5/RR71tue0F+t+GvuHWQsrklIzBFIKBmK8XP8MCLNCik8+1hRpK6otYR nQrgmYusvkf596qSU9q0Y/lojUUpvcnKjYY7tVABab2KE/ris8OvlHhOjbyI3UHhJtyywT ZAyHI2N5oDVxBacZ+Rscc2nk/Occo0q7lq4lRFK7TXJ/+VmLmG68ZYyG/rCJbA== From: Kory Maincent Date: Wed, 11 Oct 2023 16:16:57 +0200 Subject: [PATCH v4 1/6] dmaengine: dw-edma: Fix the ch_count hdma callback MIME-Version: 1.0 Message-Id: <20231011-b4-feature_hdma_mainline-v4-1-43d417b93138@bootlin.com> References: <20231011-b4-feature_hdma_mainline-v4-0-43d417b93138@bootlin.com> In-Reply-To: <20231011-b4-feature_hdma_mainline-v4-0-43d417b93138@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.3 X-GND-Sasl: kory.maincent@bootlin.com X-Spam-Status: No, score=2.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no 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]); Wed, 11 Oct 2023 07:17:32 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779468973391279952 X-GMAIL-MSGID: 1779468973391279952 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 Wed Oct 11 14:16:58 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: 151445 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp573182vqb; Wed, 11 Oct 2023 07:17:33 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEhrNo0yTbhmaYAwJ9XopsBzKHD2MvvJCr8BzkNU4ed02MqniDeq3DHjgeNO/yU6BkMaZ66 X-Received: by 2002:a05:6a00:2e92:b0:692:b3d4:e6c3 with SMTP id fd18-20020a056a002e9200b00692b3d4e6c3mr23137529pfb.0.1697033853242; Wed, 11 Oct 2023 07:17:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697033853; cv=none; d=google.com; s=arc-20160816; b=kjak+a54exKIpb2RAwC4ondIGKttB1qX+nfauFBVyV4KrI4fiE/qUiCxaMjoQjKink /kKGEYkFaRlbeN2tw3bewNyh4g2yyoS/PCkPo8oURGU6h1wqFgIe2Nf7OD6VwIAoV9H7 6CPPpOVvIgvvKYx9D94eR/emW2j7J8Hw/2Ut8594YlkJ1KQtMgG/qxQtn7fu9E7Ay8qJ ijFjBDu8GG+fZLM91sP0QK0rqCtu2HVKbQXC4fW3eU7vp0xdPq9CGvlKfpOI6EG6BKEW Aay3RdTQDdG1kxF0wHiJgS4jR4X3p5+OSR220gTCMrqD5K3RcxFTccjPoW6n4QB2jD80 vK6g== 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=9zfuTvre0UzAi4GpamYmN3E9uemUolgHrcnYVxe0/6o=; fh=6XphIdWxfa6Vpt4el4ltSz/1eFeqJAQ3KUirCeZaEUc=; b=O7YKx0GevPk+N/Kzt7ihULXoNd69tTIXrqexOPHEtpDSVXFLsX38NgBH8XOE0RIEZl 1nrm0ldgdih84PLOHI9vYlamS+3UnS/9EaF+YWqeRR7AoqZGIem/ucLfjihj6lf7b2SG 9+nvSIDrU+tU5tEjKSV9N73UszfYuz/J7IXsaNF7awKYnrapfY9l0BLkqES90YFDEyKK fCIJZyZQEAatNRwfMIwSYMg4gBnr8tPi9wxg/0WEpdRZ49LBsOChXFO6rlBNBnGkETom 94Rfi3nRQOcm3n0rGDuhVln0wCeLbpioVKT3kBY3oos255VfmXMhUbJk1/7rAwC8Ca8J MKJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=Mqe9aNxe; 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 fj34-20020a056a003a2200b00690a75a318asi11039341pfb.67.2023.10.11.07.17.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 07:17:33 -0700 (PDT) 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=Mqe9aNxe; 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 81C76801CA4C; Wed, 11 Oct 2023 07:17:32 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346919AbjJKOR1 (ORCPT + 18 others); Wed, 11 Oct 2023 10:17:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38322 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346001AbjJKORW (ORCPT ); Wed, 11 Oct 2023 10:17:22 -0400 Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 368D290; Wed, 11 Oct 2023 07:17:21 -0700 (PDT) Received: by mail.gandi.net (Postfix) with ESMTPSA id DF8D56000F; Wed, 11 Oct 2023 14:17:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1697033839; 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=9zfuTvre0UzAi4GpamYmN3E9uemUolgHrcnYVxe0/6o=; b=Mqe9aNxePFcxZ275FyR+52LUX8qW2w0VXYMWHkvJDU+BzcVtPojwNIQ1bRNjEmO2IMn7dm JzFxzUfe2f0sajzsDGJfdZsnkmzv9taGzqMIssyS+Eu6eqYEM4i+rbSPqKANjWJqQ2iOLp NBaPjzaLfCZbI/BozjI85vOVW1IQiCfuXQtkWjXjgm5F1jwTJd9n16hqZabNOQ66Dqsgnn QGC9XAhCyc+5uK3DXdcDKxCO32AJVcGY5dM1d0konOwWHLRbN6G8ZsWcPja+kR8ma01dLq LwtmL5hoIos2N3RT+sifbnYgnl8wBUYNe37ivNFgEBl2poosNS0jsd4g0RWQww== From: Kory Maincent Date: Wed, 11 Oct 2023 16:16:58 +0200 Subject: [PATCH v4 2/6] dmaengine: dw-edma: Fix wrong interrupt bit set MIME-Version: 1.0 Message-Id: <20231011-b4-feature_hdma_mainline-v4-2-43d417b93138@bootlin.com> References: <20231011-b4-feature_hdma_mainline-v4-0-43d417b93138@bootlin.com> In-Reply-To: <20231011-b4-feature_hdma_mainline-v4-0-43d417b93138@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 X-Mailer: b4 0.12.3 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, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,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 (snail.vger.email [0.0.0.0]); Wed, 11 Oct 2023 07:17:32 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779468969700856737 X-GMAIL-MSGID: 1779468969700856737 Fix "HDMA_V0_LOCAL_STOP_INT_EN" to "HDMA_V0_LOCAL_ABORT_INT_EN" as the STOP bit is already set in the same line. Fixes: e74c39573d35 ("dmaengine: dw-edma: Add support for native HDMA") Signed-off-by: Kory Maincent Reviewed-by: Serge Semin --- Changes in v3: - Split the patch in two to differ bug fix and simple harmless typo. --- 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 Wed Oct 11 14:16:59 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: 151446 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp573199vqb; Wed, 11 Oct 2023 07:17:34 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGllyc2foeOCCBNLOScUQ+CRbyVLg/3iI7F+MkhWhOF/gcpsH0SpCNQUa13Q505Jx/KmUUz X-Received: by 2002:a05:6a20:5484:b0:171:737:dfaf with SMTP id i4-20020a056a20548400b001710737dfafmr7271686pzk.5.1697033854161; Wed, 11 Oct 2023 07:17:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697033854; cv=none; d=google.com; s=arc-20160816; b=bwCFuVRiY8Qaj6X+j6vaH0qzKlv1kvuuqt25HAxMnWnuogsE3P6AiPQdEY51kH1k7m 2OBZeFePaMt/ZeIq+wyItucaJq7jza3Wasl836ei34l9WtVV0SswMqH9bTmlj/NGVxFh 02GTX3SYtOzLqww8pa+hCQnxsnNHsSwx6AfiS+6opsGKmS0kCoNcqBWG/YKMzwDC4I55 O5hzavLIuxyNUd18CKj9PS6zjxKGYx42/P0Kn3qGri6dQDFxRtI4d1NVqU4Kexi6OncU ulf9vEhMMCD2zzr7AToHYOQjmH9Da4ZMJbYcuE63018nFegoD0b1xCrWV1fbsAdOedWA VJ0g== 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=iPCuxXS6fiLAq+ZD6dKRSHgB+AgJYpeJ58Nq57Fi1fk=; fh=6XphIdWxfa6Vpt4el4ltSz/1eFeqJAQ3KUirCeZaEUc=; b=cW4+O+rwrTRPvma935tRWlHADxOkNsFnorYKx4BErBW5jl9yUrQJUbq1jAOQ1brvgq jrSM3StyvjFkUxNc6BN3S1u7UsmT1IeIsY0VLjzk516MiJWncF8Xt4fabmGAkZZc0FGz QkfVhMYct3Wf4608IAJbCAVPtVxu3dYeOZ5/n0T1QTAZlglD1OM7jpyZZZ1BYjDEUDAF kNkwheTVrDGI5fCXcPNglKFIIzvCYAnQoRr4pdzjLKSW7PNpaxrUx0XI6S/2THdkA7X6 mLjxgfggJwaCDRgEWqykEAwz+k/gn37ILzfIQT/h2Q7jq16P6I954ZSPi9wg2EJbb3xI F8TA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=f+kC763T; 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 206-20020a6302d7000000b00573ffd25b44si14499068pgc.182.2023.10.11.07.17.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 07:17:34 -0700 (PDT) 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=f+kC763T; 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 71ED780E73D5; Wed, 11 Oct 2023 07:17:33 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347005AbjJKOR3 (ORCPT + 18 others); Wed, 11 Oct 2023 10:17:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38360 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346917AbjJKORZ (ORCPT ); Wed, 11 Oct 2023 10:17:25 -0400 Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::223]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 26A1890; Wed, 11 Oct 2023 07:17:23 -0700 (PDT) Received: by mail.gandi.net (Postfix) with ESMTPSA id 076C560012; Wed, 11 Oct 2023 14:17:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1697033841; 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=iPCuxXS6fiLAq+ZD6dKRSHgB+AgJYpeJ58Nq57Fi1fk=; b=f+kC763Tg/uJAcc8VzLMLexCjIKy4jYEqYyAFvTR4kLZNE+Van87+yuEavqTXWDuFhZWq6 M7wI+uG+nYR8z6WSmoyEeGBTo01EAHZI1sXrw0YkDXCqUhEogn5M7PEs8NiSvwN2e+AnE1 0QOqSEU2Arg0pWGisTGCWXArvlmA45D0N3+ygN5vB8Y8otSMo8WjIfAOENsGeza+kclVxB TynkR3BKeG3jaAHFoFub/TL1Viczfz9dADnYXLSiJmohxTsEJKw2qFa+3g8JRmliSEI3Xh poudaqCFQbq/0oGyssIbfirw419yMDy2t1u+1sqw0CgdSNFw67eh7DMNczuJfA== From: Kory Maincent Date: Wed, 11 Oct 2023 16:16:59 +0200 Subject: [PATCH v4 3/6] dmaengine: dw-edma: Typo fix MIME-Version: 1.0 Message-Id: <20231011-b4-feature_hdma_mainline-v4-3-43d417b93138@bootlin.com> References: <20231011-b4-feature_hdma_mainline-v4-0-43d417b93138@bootlin.com> In-Reply-To: <20231011-b4-feature_hdma_mainline-v4-0-43d417b93138@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 X-Mailer: b4 0.12.3 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,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]); Wed, 11 Oct 2023 07:17:33 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779468970772475319 X-GMAIL-MSGID: 1779468970772475319 Fix "HDMA_V0_REMOTEL_STOP_INT_EN" typo error Fixes: e74c39573d35 ("dmaengine: dw-edma: Add support for native HDMA") Signed-off-by: Kory Maincent Reviewed-by: Serge Semin --- Changes in v3: - Split the patch in two to differ bug fix and simple harmless typo. --- 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 Wed Oct 11 14:17:00 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: 151448 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp573247vqb; Wed, 11 Oct 2023 07:17:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH/tG6IHtJxSuer3v8OokAa+TP31nTB5Ct9dgjFTBHKfYcrm9I+vflID4x8mYIDXokKif/S X-Received: by 2002:a17:90a:4ca4:b0:274:99ed:a80c with SMTP id k33-20020a17090a4ca400b0027499eda80cmr18898689pjh.3.1697033857623; Wed, 11 Oct 2023 07:17:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697033857; cv=none; d=google.com; s=arc-20160816; b=bBDVOuI8su/aMxTPHMmReVtYs3HXCL2hjyaPmMd4jUqPwzwqDlJ2iT379dDgyEgz/9 Na6QXcHXTMcDXlnd6o6SiHxrmeszR3YlXgiH5eDHJ18DzO2xsdAJoMro84UlTnHdtKs2 YPuEYmVfpgmF1SUU+h+OQK9mdiu0yoSfB4SR8lhjUqhdp4qy3MidChQue7tUpwseIqeh OA8aQYDpRUiHACuAS2f5ML8Yt9q364cCW42BYejSqUgniedp43hULMVH3WFaD6zEcMua RVTll92cpdWW1CbPhPwTSLA2CVnmLEfpuyXMrHHo3UPVPmKrf8yvuZS65oC0+j3PPfCn sFTg== 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=PTSzan4pHX1DgPduggXyAX54//gl+fpKE39kPPzrUlc+0aV7SxaUrOH1kSgbCHKyTN YfpzHrfJqp4fZBjvZCTe5k8I3348kEStEsbCc36xY/Uiha1illcHLrSqaeSmquxRqRFm 6gmB+kXwUMasHdywhTh3BGJnK8JGdNJLB8OSysxuQnWRiHJhE1BfhVqoDYm5HO9fhkBC 9PO0xc/lSq+9opGpQvVRZGJG5wm+cLlztbJgNFAA+MIYeHIeYKeLLT2e4egt8+MFerhD 9jfmki4vHezq3fDZQRdMV3bMqxy6e4XgEDb7lokBcmG3mb8KFs2YMa5ZEcopM6t4qBJu wMUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=K+0KsVZ3; 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 cl18-20020a17090af69200b0027d047d9070si1655348pjb.91.2023.10.11.07.17.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 07:17:37 -0700 (PDT) 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=K+0KsVZ3; 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 B2EA78101EC6; Wed, 11 Oct 2023 07:17:36 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347015AbjJKORd (ORCPT + 18 others); Wed, 11 Oct 2023 10:17:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53624 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346957AbjJKOR0 (ORCPT ); Wed, 11 Oct 2023 10:17:26 -0400 Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C011CA7; Wed, 11 Oct 2023 07:17:24 -0700 (PDT) Received: by mail.gandi.net (Postfix) with ESMTPSA id 1394760011; Wed, 11 Oct 2023 14:17:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1697033843; 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=K+0KsVZ3BA/vLUJOTXyrJHGjkf1S7uVlIMYETl+hN76MKKXIj56hJ4b86OYyMy0qpdpslE PDE85LtXseROAHen6+fxvcJv9zDcK4IgJE/jMt/63TqSVevtnu1+XHsZPNuEj+iep2eeHR fMcMQxZ3oRLkyEglQYXz2bHO3ei6uNowDnCrRovkko6gVFudnqXVAcOKenVbgJGa+zbLUr ChDJUwQGsReMCIHcz9g8o8AwU1vKPUAI1c86M2RW6yYCEvS02XoZLsniEEE9XnWwJviG0r tU/KiFu8ooSeCcgJohdRQIexK1ZwDHjeGCZts5o/cn1ERZ7vEQ3TXGpLw+R2rQ== From: Kory Maincent Date: Wed, 11 Oct 2023 16:17:00 +0200 Subject: [PATCH v4 4/6] dmaengine: dw-edma: Add HDMA remote interrupt configuration MIME-Version: 1.0 Message-Id: <20231011-b4-feature_hdma_mainline-v4-4-43d417b93138@bootlin.com> References: <20231011-b4-feature_hdma_mainline-v4-0-43d417b93138@bootlin.com> In-Reply-To: <20231011-b4-feature_hdma_mainline-v4-0-43d417b93138@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.3 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, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,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 (snail.vger.email [0.0.0.0]); Wed, 11 Oct 2023 07:17:36 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779468974481138172 X-GMAIL-MSGID: 1779468974481138172 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 Wed Oct 11 14:17:01 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: 151449 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp573354vqb; Wed, 11 Oct 2023 07:17:44 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGx1PgCIfZvCE1fE2e2NHYKj0tPE4fK9zykpPz/YBoCxiTOqqqa6n1V38aZ1/L1sLFHiq0Z X-Received: by 2002:a05:6359:203:b0:15b:73a6:3ce8 with SMTP id ej3-20020a056359020300b0015b73a63ce8mr18777283rwb.2.1697033864539; Wed, 11 Oct 2023 07:17:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697033864; cv=none; d=google.com; s=arc-20160816; b=iyFlJ0PlFu3SW3RqcOA5JlL64UF5nHR6rXc1fZtpf6og91qGG/DSGd8Wa+KxbbLPoU 0nlX4N0orovifEwWuq6LZhad+cjOAfwji5TNh7XPj58wWr/p/g/rkXX9ow4639ZwLTJG cULftpzQX2+UetOYVw/beGs293+bxX0PYB1q7moXoi8xOUr+FDrY9V313PrC7qDL58Po 4/4LEyPNxHFqWfDNJIyXWLxK9CAwgTRywKqpntq9yGcW3RnenPKUHcbVKrNKOgYi6LJI o6Ob6owUD30uER0F+TGYHuw4BX28BiF9GIxn9J4hoEsyz2cf9NlSu7BL+thKPWWSgHVM EJ3Q== 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=3Qhez83D04lqPrphmv+D5bpPc2p/1oEARmA8MsTrJgs=; fh=6XphIdWxfa6Vpt4el4ltSz/1eFeqJAQ3KUirCeZaEUc=; b=Zis10VjIYJQv0a4ZMsMe52noLBQ8fNyr1NrD2U93AYV401DBtD7ybcywIRWkimgdGx 7ryNaUXfA1KH3EJ2pSgU1DyY/x1eqqNPpRovRdo3OkriOTa/cyuuWXr2eAGdVaFRnMhc d81YoTOJyosg+wbX6eHK3Emk2B6MQy+Rs9nDEnzkaeyUmAKfQ0rFxmQucETn0bj8mcy3 Vkq7kQvUWPPMVHfE4dx1domoQdJU/nERQzpgjmCMgAcpA9/XvNEaR4C8m2yb69e0vl0+ nMKDyarKBsJVTw6OwwVHiqurcbCJ3ywy95SMU1OJ2C1f2iSTZJ77zBXUiIwsRhVrkG8g bGmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b="TLSILp/S"; 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 e26-20020a65679a000000b0057cbd803b30si14944538pgr.654.2023.10.11.07.17.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 07:17:44 -0700 (PDT) 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="TLSILp/S"; 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 D2D6F81D7713; Wed, 11 Oct 2023 07:17:43 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347038AbjJKORg (ORCPT + 18 others); Wed, 11 Oct 2023 10:17:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53668 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346995AbjJKOR2 (ORCPT ); Wed, 11 Oct 2023 10:17:28 -0400 Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 04B4F90; Wed, 11 Oct 2023 07:17:25 -0700 (PDT) Received: by mail.gandi.net (Postfix) with ESMTPSA id A40D060003; Wed, 11 Oct 2023 14:17:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1697033844; 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=3Qhez83D04lqPrphmv+D5bpPc2p/1oEARmA8MsTrJgs=; b=TLSILp/S+m49x09dkKN/DXLFhiGlb17OCnRUqqiliB+cuwF8NTK70vHgazrYAehPPvOXRs 0EzeYSJr10E+uTLR5CJKDeASLuvTlcKwK6JPWDrQDsMQL8wRvMFHchTV9QIxcbNk4tb+lw 8lAz97WK5UNTMOCTHEXLByP2DsYTirQU3wYfMr/jYYcaePzYQ9cQcuKVFmtDYMtxy/fnkV Pa27vTcy5GYGclOfQDRDW8AtAVd5EQSow0WrxATZLrYd0RuAHAT3H57BXzgpZCrjavOPGx cERGySqatkX730aLYOtlR2MQcXzNxIynJGcy6ZQ/9msY/8D2RxRnQoZC4RDWQg== From: Kory Maincent Date: Wed, 11 Oct 2023 16:17:01 +0200 Subject: [PATCH v4 5/6] dmaengine: dw-edma: HDMA: Add sync read before starting the DMA transfer in remote setup MIME-Version: 1.0 Message-Id: <20231011-b4-feature_hdma_mainline-v4-5-43d417b93138@bootlin.com> References: <20231011-b4-feature_hdma_mainline-v4-0-43d417b93138@bootlin.com> In-Reply-To: <20231011-b4-feature_hdma_mainline-v4-0-43d417b93138@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 X-Mailer: b4 0.12.3 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, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,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 (snail.vger.email [0.0.0.0]); Wed, 11 Oct 2023 07:17:43 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779468981602194150 X-GMAIL-MSGID: 1779468981602194150 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 Signed-off-by: Kory Maincent --- Changes in v2: - Move the sync read in a function. - Add commments Changes in v4: - Update git commit message. --- 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..13b6aec6a6de 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 internals + * 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 posted 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 Wed Oct 11 14:17:02 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: 151450 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp573461vqb; Wed, 11 Oct 2023 07:17:52 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGnWwvui4GHrquqIj0NGM91ol+d1mB+zKrm6L9cS/PqCFbTCrRprGwV0EXPIr5HcAQP07xz X-Received: by 2002:a05:6a00:288a:b0:690:2ab8:2d67 with SMTP id ch10-20020a056a00288a00b006902ab82d67mr23698576pfb.1.1697033872516; Wed, 11 Oct 2023 07:17:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697033872; cv=none; d=google.com; s=arc-20160816; b=zuax/IknA+rgZP95F4jz0bruYT6zdpGkzE/6Y46VyZMHyHeuN7/7Hc6oJCldLppmg3 97oE7PqPwl3UsuFh8HNz4KJSV4auuJikxVME1Q47yas1rpBpf3JqzIHh03lFXT+Q6ymK Tm3BdxXLSQVXlWU8ZlCn7NLvrbq0d8uTImurUhdy1VKk/EhHQV6Q5xNFYkF96HnHTG0Q coFFHoe8w4h6S4Pt9JK23uwEcHC6s553NcVZdEVG1FZY+Capd73pR+e1CRfTFEpeM6UQ 3X1wCTmyKUkKlqpPo+qJjMA1Vx/OZDFAGaT0qoaHxYrQvlJ5PmOPn2JQWzo775aSLbQR Sk7w== 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=Njx3NaGKWu808jS2rM/MlNFciYIn5u1xCeEnktSSeyc=; fh=6XphIdWxfa6Vpt4el4ltSz/1eFeqJAQ3KUirCeZaEUc=; b=iFwBF0kXmdNu6CXUBiw470QsGdaHIH1srVJNu9v/G7ksMWtzuO6QJvLsn01nxJiBks 1R1Zch2pPEkVzpdUo5c0a3mhD46SPw6AvkUZkCnNkQ0zSVJ3VZLsw0kY+SGZlOfuj6f0 s6C5Sz9IkO0862qWFGoN6ETedsJt5MwV1Fky1VHiJ55Mfv4kaYKyKWNaCy5SH/3cvujQ 4FEZHMnibDW6vnPND/kHqvcvhrKg/MjjSbRUGjaqfrhnu86HDNyoEzXidu5GOjHO06ub 9wDBDjO9ulqYkYXMl9jIIhzdTtnc29fzJ/SpPNw4b5ePYnv0KhheivHcFXPk0BElSoL2 Cr4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b="ipH6DD//"; 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 k5-20020aa788c5000000b0068bf645ac9bsi3863537pff.238.2023.10.11.07.17.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 07:17:52 -0700 (PDT) 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="ipH6DD//"; 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 CCF4D81D8097; Wed, 11 Oct 2023 07:17:51 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346995AbjJKORk (ORCPT + 18 others); Wed, 11 Oct 2023 10:17:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53698 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347018AbjJKORb (ORCPT ); Wed, 11 Oct 2023 10:17:31 -0400 Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::223]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 49E79A7; Wed, 11 Oct 2023 07:17:27 -0700 (PDT) Received: by mail.gandi.net (Postfix) with ESMTPSA id D720B60009; Wed, 11 Oct 2023 14:17:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1697033845; 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=Njx3NaGKWu808jS2rM/MlNFciYIn5u1xCeEnktSSeyc=; b=ipH6DD//FVdp9q8zrCoQzSezgKpRCLRy3Cb1+M9S6l4iFonYWRLtNptp5rFbl8s6T3AbAC yzpZrWiPuqYtpjw2+hwYvD2SA9XHV7Iq+Hyep7HXwBsyKmQf5AO5DFPoAFf6xjKVL5RYe7 5NSKEjuAmTcKmyeMyERE5z9TPf/O1J2iz3h2rvoxMcUbGYoCEVBDZUTHQEVo8tbg43Qmhd NIX7ne2Qapu0OyjzMyydb0bmoZpMlP7ij2lRT+salf/xDKQM67nts8HPF2OdbZMx/ngq80 GcRedwOEAQGUf3V03eZ4QtXQGi8QfHjIWt16a/yMAC/IB6ywBXOJhOQnvvHT/A== From: Kory Maincent Date: Wed, 11 Oct 2023 16:17:02 +0200 Subject: [PATCH v4 6/6] dmaengine: dw-edma: eDMA: Add sync read before starting the DMA transfer in remote setup MIME-Version: 1.0 Message-Id: <20231011-b4-feature_hdma_mainline-v4-6-43d417b93138@bootlin.com> References: <20231011-b4-feature_hdma_mainline-v4-0-43d417b93138@bootlin.com> In-Reply-To: <20231011-b4-feature_hdma_mainline-v4-0-43d417b93138@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 X-Mailer: b4 0.12.3 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,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]); Wed, 11 Oct 2023 07:17:51 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779468990266121318 X-GMAIL-MSGID: 1779468990266121318 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 Signed-off-by: Kory Maincent --- Changes in v2: - New patch Changes in v4: - Update git commit message. --- 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..6245b720fbfe 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 internals + * 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 posted 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));