Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp198304rdg; Tue, 10 Oct 2023 07:57:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHXNC1N2Cao1odIFM/3iTcSOBQv6cDZcszNYeiwlnNDscBVTJ+CE4T/PIBb+PYUV5VxgN54 X-Received: by 2002:a17:902:8b8c:b0:1c0:aca0:8c44 with SMTP id ay12-20020a1709028b8c00b001c0aca08c44mr15871270plb.19.1696949875149; Tue, 10 Oct 2023 07:57:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696949875; cv=none; d=google.com; s=arc-20160816; b=RcMLBop62KukWIIOvNxmtU/zJXmk7HmxwFSuj1+ct9L4nOpH0hfcyYS/IXmcFYgEgA Ypi/bdjOiKHUoKDR3/hnxrcOp6M343/QcZyma1mM75H1QzMN9A1K/t5/Fs7kYHgeZNvU 4UA1oZPDIY6cjW2sI6kLChUtUB16OK2QkYe291adSrWM8COqac2n6W5KG3CsNAWDTux4 RcdnMbnFt/m2x7wW7PWw5WFJK2bxgD/kqtv91Tc7ZWt8ImjgkZ88bX634X/WL5hXzobz 3mhKCC0bDASgotndQwFZ6BiwJS3uCvBasB+TxdiWz0lEjP6yTiolItn7jyaFBOzj1nDj pUxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Lg5b/G71VrexBTFkCyKeJ0BGvbtl8ZKqiok5j4WYrFk=; fh=o95iTb4yF1AVdIW9Dios/WEGFPQILuieaqytdxi78EI=; b=Smb8/wMmgJrXlD/EcHd65At/KiNDG1QYo0FIE5jUwjhjykBE+jtRR42NDmWVjAUpSI RSblarc7AKmp+pGXz1dwdPZM4Mbx2FCj91lQfMMo5cshvvV/fWW4wuNyRABnMQpnP8xX j/uhTx5iz2h4CindpmMrP1gDO4j52XdoCJKtrJJyB3hllYzqEUYWR1ljQ2G/EXZ4jLyh 0zwkCanHR5xwXXAHr6gZqEbqPEPxSpSM1uRCery8pQs893m3kgt5P4fHU/rnXw3nqoFu nlPArOKziV1XEDHdT3nU2aNDjatFADO14vgd4IPp2h+0iH3aAwQdclqRs8rcveHkyoJM lT0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ilP8+33n; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id y16-20020a17090264d000b001c755810f80si11518972pli.28.2023.10.10.07.57.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 07:57:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ilP8+33n; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id CA586806E4F9; Tue, 10 Oct 2023 07:57:09 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233174AbjJJO4o (ORCPT + 99 others); Tue, 10 Oct 2023 10:56:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54444 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233254AbjJJO4m (ORCPT ); Tue, 10 Oct 2023 10:56:42 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 08D28AC; Tue, 10 Oct 2023 07:56:41 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DC3C0C433C8; Tue, 10 Oct 2023 14:56:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696949800; bh=+3BXBy0aMCLszRjGQbujRY/nkx9TtU/Q/8iVrbBGVuU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ilP8+33nlnl3IgKElEbRdW7vgMUTBv89xPPxdP7jVqV+exiWjycamTEGn91R+rmdM vaYoOXLsNYvL5mgMkz/oNpmmzCjEpPRCmA7xNKrqw/9XKCdo00WmXCnuuEvxybVcb/ vVrnEHNUicpv4tnTd3PvqKxm1vRpyTQ6ORWeeoQX/s1NzT/mp/aYc2kEW7/uICjPtK d6M87Vf36htjrjG+TJwBh0FOUCMltaAmdy/YHgV+mKZ4lpR1piYO3ru6JQev6jxFcE 3/bTmB+B33r++kUzP9iG38n3YP5/ORprbjUHiEFofpsDd1I/pz409povXV4DFbzzx5 fzMDBBKE2hKJg== Date: Tue, 10 Oct 2023 20:26:26 +0530 From: Manivannan Sadhasivam To: =?iso-8859-1?Q?K=F6ry?= Maincent Cc: Cai Huoqing , Manivannan Sadhasivam , Serge Semin , Vinod Koul , Gustavo Pimentel , dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, Thomas Petazzoni , Herve Codina Subject: Re: [PATCH v2 1/5] dmaengine: dw-edma: Fix the ch_count hdma callback Message-ID: <20231010145626.GK4884@thinkpad> References: <20231002131749.2977952-1-kory.maincent@bootlin.com> <20231002131749.2977952-2-kory.maincent@bootlin.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20231002131749.2977952-2-kory.maincent@bootlin.com> X-Spam-Status: No, score=2.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.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 (morse.vger.email [0.0.0.0]); Tue, 10 Oct 2023 07:57:09 -0700 (PDT) X-Spam-Level: ** On Mon, Oct 02, 2023 at 03:17:45PM +0200, Köry Maincent wrote: > From: Kory Maincent > > 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") > Signed-off-by: Kory Maincent One nitpick below. With that, Acked-by: Manivannan Sadhasivam > --- > > 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 > --- > drivers/dma/dw-edma/dw-hdma-v0-core.c | 17 +++++------------ > 1 file changed, 5 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..3e78d4fd3955 100644 > --- a/drivers/dma/dw-edma/dw-hdma-v0-core.c > +++ b/drivers/dma/dw-edma/dw-hdma-v0-core.c > @@ -65,18 +65,11 @@ 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 Please use below style for multi line comment: /* * ... */ - Mani > + * 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) > -- > 2.25.1 > -- மணிவண்ணன் சதாசிவம்