Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp283567rdb; Fri, 6 Oct 2023 03:31:53 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH79O/boxmaG21muKREL6ylbYiIaSohU2G6zhDiUh6cvyMyaWRGPmgN3omVcmags9YVM55B X-Received: by 2002:a05:6a20:12c1:b0:154:e7e6:85bd with SMTP id v1-20020a056a2012c100b00154e7e685bdmr8850030pzg.20.1696588313137; Fri, 06 Oct 2023 03:31:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696588313; cv=none; d=google.com; s=arc-20160816; b=qHe9eY3ZI1XGtpI8RkAq/hPn5CFtiPtoVwOZ95KP+Oc8jiisnoEzx2b3G5bBLIMqyR +uoE1+Vpc1fw/WEQ5V/evm7rbQ2BKcWZgdCN7ykSoPpWsY405dJfP9y49IF6vM4hDRTw 79dyh7/aRqQkzJWEmLlNNPO/KJFPhi9s5E8Inz0uPyIyr4nsdgBMp3ZnZlwElxedFCEo hiBmPVjNmMZjm5+iXm6ceipw5jwMTODdJPQNSqqplN3+YVK97Bo8yL1Qw2cIlkw2/vvi KALWMoPmJedXwbu6f9LbovEqbOg9T1wx4kcA0LEfqqZ3ocL6gDrR5xQ041l+qRiXdpZ6 eXHA== 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=HHU9ScR2RksM3uAG8Lsypd80KG2HtQ9TFPUA2QTwCEo=; fh=7hDfOZAxF1M2Qe6dczC1n29jX7CG0KcwYGfPGxdLfL4=; b=pTO3txU5kqRUBcpYthn95Enr6ODYmImdQXoI1TrQAtlC6Z/TZETt0GwjWfD1rXtjSX ln877CpkQlbLLgnIbcVixrKmslf9sWEk+gZCCsPPd8viQm1Z7roG/j9bP2WwKXLSHPJv zkw3jynryzyHTpYeWRgO1xKy7u4iHBjO33WP+mcdmqD1z4BWJ2PvjHl3bEi5gZiQSDDz vm3L+KFaoCMif0GiKD8dyuREwUHegj2DquezYAag5r5F1j256wjssogWWx8LkGY9bW3O EiJ1RYeB7I6klOCQkSeAYZcvB7f5w/S14xe98+Fd/tbjCxVGtrsrbGSJjO1TCfX8FWgm n+UQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dtvkELud; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id y187-20020a638ac4000000b0058988971b64si1485582pgd.266.2023.10.06.03.31.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Oct 2023 03:31:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dtvkELud; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (Postfix) with ESMTP id B674D8076C97; Fri, 6 Oct 2023 03:30:36 -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 S231723AbjJFKaX (ORCPT + 99 others); Fri, 6 Oct 2023 06:30:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45816 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231532AbjJFKaV (ORCPT ); Fri, 6 Oct 2023 06:30:21 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DAEC783; Fri, 6 Oct 2023 03:30:18 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F1287C433C7; Fri, 6 Oct 2023 10:30:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696588218; bh=+mvqaTG4RUdvegWzAzQB4Km4EgJ3oHRf9PT0mYVLsRQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=dtvkELudcMaOFfelR/3Ox3pum0NvWYQp26iwod064iJ4LtzK46ucZRC1v1NdHxoPP h8UbymfRUuLWVkfnDCpvGPXsD2k0dcL8ANcR951bsdiKUGzIN+nNgci8mTkHNu8XZo TyWSloZk71IEsC88JwZBTtFKuU88e3z+pKFw38oGOylqBoY5KH5nbLPQRgkD7lHlLi 3f8msQO4QXgJHBsgwNGsMB+KGaxau8Nl9P9iPqz7AjWp3Ql0NnmVm1NlxGeAn2KV7r qIqkbiySckJv3eyTfJnTYGnHH2CR5N0hpfOcOJKsEqFXeuVdkWDTDeMcOV7cTWIZBG DH99zA3gEvRmA== Date: Fri, 6 Oct 2023 16:00:14 +0530 From: Vinod Koul To: Kelvin.Cao@microchip.com Cc: dmaengine@vger.kernel.org, George.Ge@microchip.com, christophe.jaillet@wanadoo.fr, hch@infradead.org, linux-kernel@vger.kernel.org, logang@deltatee.com Subject: Re: [PATCH v6 1/1] dmaengine: switchtec-dma: Introduce Switchtec DMA engine PCI driver Message-ID: References: <20230728200327.96496-1-kelvin.cao@microchip.com> <20230728200327.96496-2-kelvin.cao@microchip.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: 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 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]); Fri, 06 Oct 2023 03:30:37 -0700 (PDT) X-Spam-Level: ** On 05-10-23, 18:35, Kelvin.Cao@microchip.com wrote: > > > > +static struct dma_async_tx_descriptor * > > > > +switchtec_dma_prep_wimm_data(struct dma_chan *c, dma_addr_t > > > > dma_dst, u64 data, > > > > +????????????????????????? unsigned long flags) > > > > > > can you please explain what this wimm data refers to... > > > > > > I think adding imm callback was a mistake, we need a better > > > justification for another user for this, who programs this, what > > > gets > > > programmed here > > > > Sure. I think it's an alternative method to prep_mem and would be > > more > > convenient to use when the write is 8-byte and the data to be moved > > is > > not in a DMA mapped memory location. For example, we write to a > > doorbell register with the value from a local variable which is not > > associated with a DMA address to notify the receiver to consume the > > data, after confirming that the previously initiated DMA transactions > > of the data have completed. I agree that the use scenario would be > > very > > limited. Can you please explain more about this 'value' where is it derived from? Who programs it and how... > > > > +???? /* set sq/cq */ > > > > +???? writel(lower_32_bits(swdma_chan->dma_addr_sq), &chan_fw- > > > > > sq_base_lo); > > > > +???? writel(upper_32_bits(swdma_chan->dma_addr_sq), &chan_fw- > > > > > sq_base_hi); > > > > +???? writel(lower_32_bits(swdma_chan->dma_addr_cq), &chan_fw- > > > > > cq_base_lo); > > > > +???? writel(upper_32_bits(swdma_chan->dma_addr_cq), &chan_fw- > > > > > cq_base_hi); > > > > + > > > > +???? writew(SWITCHTEC_DMA_SQ_SIZE, &swdma_chan->mmio_chan_fw- > > > > > sq_size); > > > > +???? writew(SWITCHTEC_DMA_CQ_SIZE, &swdma_chan->mmio_chan_fw- > > > > > cq_size); > > > > > > what is write happening in the descriptor alloc callback, that does > > > not > > > sound correct to me > > > > All the queue descriptors of a channel are pre-allocated, so I think > > it's proper to convey the queue address/size to hardware at this > > point. > > After this initialization, we only need to assign cookie in submit > > and > > update queue head to hardware in issue_pending. Sorry that is not right, you can prepare multiple descriptors and then submit. Only at submit is the cookie assigned which is in order, so this should be moved to when we start the txn and not in this call -- ~Vinod