Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp716264rdg; Wed, 11 Oct 2023 03:41:17 -0700 (PDT) X-Google-Smtp-Source: AGHT+IENW4xtkGTbfr6GxmHWEIY4OexMM3IOR96JkAY5nH8W8a+/KBsC4yX3ymfx82dp+plnVxUG X-Received: by 2002:a17:902:ec90:b0:1c7:27a1:a9e5 with SMTP id x16-20020a170902ec9000b001c727a1a9e5mr28630351plg.33.1697020877309; Wed, 11 Oct 2023 03:41:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697020877; cv=none; d=google.com; s=arc-20160816; b=WQsoBc4iu3fXb/E0Sa2iFabVplNRrmrgkw8F9A8cONCmqCTbBTRvxyuJCefKPKf6SQ tIGYzqc5fo4U9NtHvuXfMIaSidVy3sD0Ros/erX6Uhyy66QlIibp5ZqYZ3+IDFNV/qlI Uhrf2W1jdvIY2bgU6z0dwaW07Tznl7kfwz0XpzI9TrnKT7UYgLqkmmA4fhRkGIYlNICp h1ic5IPDrmRvAJR1OEvLJ97x/xImO52xfPPIBtfiyTXPG3TtEGCNi9GzUiPuZOefGQnC Tz4qKxdFwNLFERtojt3mGUiwjb/DC2VM7XXIQe1fwA8AEkF7QYcdarmagYMXM2w6SgAx Xa5w== 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-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=MIwLub0INRRdgrIISIRMpvUCD9eeyw981wkAi0ZsffY=; fh=WbMeAF4pt9x7/VJ3BDcoK9XeQxKq0Jzt4CH8ntHYjf8=; b=UA9Ukvonpq+z18BAc5sTc3yycp1KctoWW+pa00pUz90jxYBMsf1l+0Z6pvULFDjhsO DeCDoQK0oWh7L2Hhfx8+h43We8GD+/trSMFbjoMMFBf2/yMXcKQ7BNROnAUEnupOWrOz Cyngxi85iK9OIwEs3bSJe0O5yGqFdU26rdk02QHEDSSNciC0PwBB9LjgtKq0I925WnPW PoWX7eP1bYu3nbnb6NjF4iRAeHzijen1w6WOYKIMjagwGlmVBw0wuUANdyNzY0SmZ/X7 SBmZcXck1+y9fPRvX6L6UnQkjz1HeW+144NlXhMuMBtfssMbJZCArwZ7wCsuGFxnV43O HsoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="b9JHr/l5"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id jj6-20020a170903048600b001c0ab540e67si14106626plb.213.2023.10.11.03.41.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 03:41:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="b9JHr/l5"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 28F6A8025805; Wed, 11 Oct 2023 03:41:13 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346014AbjJKKlD (ORCPT + 99 others); Wed, 11 Oct 2023 06:41:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52880 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346498AbjJKKk7 (ORCPT ); Wed, 11 Oct 2023 06:40:59 -0400 Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 816E4A7; Wed, 11 Oct 2023 03:40:56 -0700 (PDT) Received: by mail-lf1-x136.google.com with SMTP id 2adb3069b0e04-5031ccf004cso8105135e87.2; Wed, 11 Oct 2023 03:40:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697020855; x=1697625655; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=MIwLub0INRRdgrIISIRMpvUCD9eeyw981wkAi0ZsffY=; b=b9JHr/l5yZOWbtM0htenDtYya+erZmxpwEjq9V1g09/1HHvq82U9KNuUODldNxXU3Z PvWyZfjgmxsFtVsh0r7w5QZ0tbxhvQqi6AtrX9eJSBRkH+GMKZfn2rtL96oYnyOvaDSV POHUCkaJRdsrAZaOyCWZ2X5wWslHm0AyqI8IcMYLgrA3FiKR2lNQxRztgWz2aRdk5B1c unHVsEPX3SXm+9C6caOhUiQDIJuLIowikR3QpjgKjFgBrAZIh5ITwnpROuY2X/s7WjmX K8p/uHdZ+Mj2Z6P9YdEVr2qMDarHfAhjnCsy0jEJ1cKFgI/mHkcjw9adofhRrr9mK7o8 yKpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697020855; x=1697625655; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=MIwLub0INRRdgrIISIRMpvUCD9eeyw981wkAi0ZsffY=; b=Ex/k4MOqttxsdQ3gHYTa0t4Op4mxNi8aaKzcgac25AnobLE77svpAnClvSYNVa/6Rq V30Yyn0mQ2msjQ+7wIw8ieDrxpYvFnaBioYPJdaWh7ohOQnQCfDRlB7Ug8UpSYLHe+xS scw3cEKWDJp+Gydjsg6dsZtW2LLJaUZfblAtaqsyXLMc+exSjeVTv/PHzRnbo4vQefHK DDnS9NRxgnp2wdQqRCgMv58Av7V5y3J0trCAEpq3a/veb1RdVoI1e/1iYrSLSGAkwQAx ATIeA5o0R5wAaZ7XsCgJUJIgRI3JMAR6KuQuubt3EzImWoOF3IWkzaf9cS7dL0soT24N owuw== X-Gm-Message-State: AOJu0YxYpe5axx6+PmTWTDYYQB7ZpkR2EeYn9P6b2KkJK8NW01u91U7K HbGBFP4cAIUxyKbGtCEhrW4= X-Received: by 2002:ac2:5f08:0:b0:503:383c:996d with SMTP id 8-20020ac25f08000000b00503383c996dmr15544417lfq.12.1697020854490; Wed, 11 Oct 2023 03:40:54 -0700 (PDT) Received: from mobilestation ([178.176.56.174]) by smtp.gmail.com with ESMTPSA id p7-20020a19f007000000b004ff8631d6c0sm2190574lfc.278.2023.10.11.03.40.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 03:40:54 -0700 (PDT) Date: Wed, 11 Oct 2023 13:40:52 +0300 From: Serge Semin To: Kory Maincent , Cai Huoqing Cc: Manivannan Sadhasivam , Gustavo Pimentel , Vinod Koul , Thomas Petazzoni , dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, Herve Codina Subject: Re: [PATCH v3 1/6] dmaengine: dw-edma: Fix the ch_count hdma callback Message-ID: References: <20231011-b4-feature_hdma_mainline-v3-0-24ee0c979c6f@bootlin.com> <20231011-b4-feature_hdma_mainline-v3-1-24ee0c979c6f@bootlin.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231011-b4-feature_hdma_mainline-v3-1-24ee0c979c6f@bootlin.com> X-Spam-Status: No, score=3.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_SBL_CSS, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.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 (groat.vger.email [0.0.0.0]); Wed, 11 Oct 2023 03:41:13 -0700 (PDT) On Wed, Oct 11, 2023 at 10:11:40AM +0200, Kory Maincent wrote: > 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 > Acked-by: Manivannan Sadhasivam So no news from Cai... I guess we can accept it as is then. Reviewed-by: Serge Semin -Serge(y) > --- > > 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) > > -- > 2.25.1 >