Message ID | 20240129-b4-feature_hdma_mainline-v7-1-8e8c1acb7a46@bootlin.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-43072-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2087:b0:106:209c:c626 with SMTP id gs7csp683661dyb; Mon, 29 Jan 2024 08:33:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IGpJUNn9EG7F/mKrmGl4/tHFS8LVK5o9GfRFNuK68mhLo1U1p6vqQQcvDisyPAT42ImNLuY X-Received: by 2002:a17:903:1d2:b0:1d7:19ec:2e58 with SMTP id e18-20020a17090301d200b001d719ec2e58mr3470148plh.23.1706545989241; Mon, 29 Jan 2024 08:33:09 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706545989; cv=pass; d=google.com; s=arc-20160816; b=gCP3G/FEGmmJoaoVQYSjZSKmkYCRx4beyPwPIIy7hSbXQZPLWCOOwgY944HNV65X10 msQmy9/tPcQ8gtXT+XY7izH1w0NOeFIrZ/PY+JBVujr1ix10GOUch0APsydBUwoLMLnp /kxgtlykR4NSPFLGlcv1xf49pQoKhDmzHRL/63QkpWwb1tJooKUCNkTvEcOoiJCe1hui 4qqlhDId06eoZUoCACpm41GIyRxKUwrj0tFfzm0AEzfJU7eeuLKpazJrI3cHivxkekiM qks8rcRRoiXjTJAT8GTRHPUIm3N4zMxavWDx3FCqXDqERx9Pd+gX3c5jDUR72j4VQ4j/ oXqw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=MG/EpR8bVcQceln2f1UmgAvAjO7ip8LLXAJEWchyMuQ=; fh=oC1+pIJR2tZdBb9Uzp3yLjqrVYle+8srf2TBxoXLW2Q=; b=XbYgqLNJdkzvaERhY7Sp1/9nxbRm2ymZFp4CvKLV3a8oRy6djZ/fI845HncbKvlkXP gj8v72YDFsczZvwbwuouQaeD2C8WT+gMmXV7Z+z2Md/KHA2PoEAwg/VoC29waPMTzJwo TS2v1zHPP4+0YBQXSyyzUitPIr44dMe9tV2DPEn+z7C4f2GejDC+GM+H2+etGx4rtGB9 PYQcmMHq4J/jjYjAkHNQSlWKrSMAJt0IGke1T9oevhIwQe9+nwcCaxiTckxoAjpnVZYo 35/89k0SguneG3AGEudPxBiEvmrjn5QZv7rf/DJ1a5qzZ5sw/r7pg1nnKnJNg5oeAO2g Vdag== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=eaCrbU3p; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-43072-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-43072-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id l14-20020a170903120e00b001d768fd5927si5921884plh.314.2024.01.29.08.33.09 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 08:33:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-43072-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=eaCrbU3p; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-43072-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-43072-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 6A310289C7E for <ouuuleilei@gmail.com>; Mon, 29 Jan 2024 16:26:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CC622157040; Mon, 29 Jan 2024 16:26:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="eaCrbU3p" Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [217.70.183.196]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 038EB155A5D; Mon, 29 Jan 2024 16:26:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.196 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706545570; cv=none; b=LkUkhrYn0sl6iOfCs2syUkove7ZBLCQutOOmmT7l/kcMZjSJXRg4GiBgk2kSB9sYpTWIfVW2rufmuaDDq4naB8Q1ZzM7f/7+kFH0Mvy8POQeE/nABT4qYuNt/WcA9TnOV8N5vqHV7PNQuMFZOrFFqP2lMrAmq/BHdObIM3y+Y8A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706545570; c=relaxed/simple; bh=C4sO6yQ/bq+76ak3Oo81L+OU1zOyCbXoSaUNduyzz0w=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=UujnTPFLlWYYoaQagXbymBN33+nU7O7QmEQRfm5qIR5lVh+L4AiydmM79qcmSjp4EwJi+bBNv5PbOpShI8V9CVgKZB3SR8L7Uy0hF0T/2+Lbq5OBUdSk2InNI8J9/N5g9KYg91lLqNEYZ8WiyPYlze/5VJRmah5d1egjx2VAqvA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=eaCrbU3p; arc=none smtp.client-ip=217.70.183.196 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPSA id CE5D6E000B; Mon, 29 Jan 2024 16:26:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1706545566; 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=eaCrbU3p0Ll8pLp5KtMk2BFOFJrF8vRmqnxFUveVuzaMIo98Vc8yFYPvXEP45wVKgDA5t0 GMJpqeW+mAXtNOjM0kB5EgoMyKt25qIgy/iEVcZOubQT+xYj+ncWFTea7HVNNLsODqe4fQ ucA8h6kEvzxQXb5VP7SqmxaTAWO5qJCl3PecS/FQknYgIN7PZ/0irfiWYjhkYOBWMj/JDW hX3CF8BSjYDoWPGjyYNH7DU3nlx4kQl3rJF0GUArrJs/yVRXz+NJtlwBP+eTLbPrIS5Rys rwhH72vGdvY09mhERXcs3Z3b3y6wZ5ZoFeY49QkP9SlEvw1EfXVNiacg0VbhHQ== From: Kory Maincent <kory.maincent@bootlin.com> Date: Mon, 29 Jan 2024 17:25:57 +0100 Subject: [PATCH v7 1/6] dmaengine: dw-edma: Fix the ch_count hdma callback Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240129-b4-feature_hdma_mainline-v7-1-8e8c1acb7a46@bootlin.com> References: <20240129-b4-feature_hdma_mainline-v7-0-8e8c1acb7a46@bootlin.com> In-Reply-To: <20240129-b4-feature_hdma_mainline-v7-0-8e8c1acb7a46@bootlin.com> To: Manivannan Sadhasivam <mani@kernel.org>, Gustavo Pimentel <gustavo.pimentel@synopsys.com>, Serge Semin <fancer.lancer@gmail.com>, Vinod Koul <vkoul@kernel.org>, Cai Huoqing <cai.huoqing@linux.dev> Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>, dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, Herve Codina <herve.codina@bootlin.com>, Kory Maincent <kory.maincent@bootlin.com>, Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> X-Mailer: b4 0.12.4 X-GND-Sasl: kory.maincent@bootlin.com X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789443167455625689 X-GMAIL-MSGID: 1789443167455625689 |
Series |
Fix support of dw-edma HDMA NATIVE IP in remote setup
|
|
Commit Message
Köry Maincent
Jan. 29, 2024, 4:25 p.m. UTC
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 <manivannan.sadhasivam@linaro.org> Reviewed-by: Serge Semin <fancer.lancer@gmail.com> Signed-off-by: Kory Maincent <kory.maincent@bootlin.com> --- 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)