Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp754748rdg; Wed, 11 Oct 2023 04:52:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGBQzecGLEo1e+c8Gjkt10tOxzvqZ16WebFZl4m2reTwFRFBY3ghqJELLz9jnngIpjemb2D X-Received: by 2002:a17:903:2449:b0:1b6:a37a:65b7 with SMTP id l9-20020a170903244900b001b6a37a65b7mr28199812pls.23.1697025132871; Wed, 11 Oct 2023 04:52:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697025132; cv=none; d=google.com; s=arc-20160816; b=jtI8j/11BVV7DVwKqchSo/yYuepHZZHFNH2OxGpH0zsXmjeQqd6Uqqyp7HpLcgpO5w qmgd5CB8utXPQP+EyhTFCKQ3i8BbtV5PMvQpGkO8rY6vq7Z6Cpu8VUcHysteU4yQx2kP yMINO8M3eEQdcavBicYS3fCF5lJIfU82ieJNl9an/oZ7zXdG2lUXFxuunWXO4n1+/69Q 2Nk0opVSecjjEnR1AEgUtYmSNuWocQWfrHpS58Jz/m3YLS2wh8jaPnSAvk3eprVHLMDb gioyQS1IXJpnH2V0VTuH2iT69sN0upVnKgXPWG4BFt1Yimu19JfoiPRX2lq984TOEZTj vRSg== 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=Ivu5cKfLuYUDD8AR/RDUICigJ/w3hE8Bgd0rYINr2ko=; fh=0q+47BRUvoCZ4lHdE6xwD1MEuTOoHG14x/yR30UlRhs=; b=WL3eCx0aNAijdotSszkdiUGmlPO6h6KGUwzyy6zWbHdqxuq16RiU1tLlU/KIJJQjK6 FRmnS/32xooqLjIUnPBY7JNm1zGTJ69XqRtlmbsUXs12gKlLLCETgoDcf4k45ZTbzyAT waCHn+KR3B249CsHMR657FKTkUZp+y03xW51V6PiC2sMme8FvLXkZ8vEiOo02Ac++HC9 3Sl6kcVGbhimZo1KG4pmnYcRBAw+3nXnctgVuIEWIfkDnW2HCQNcQfebu0M+8ty8LIL+ CzpkzWdXEflsCyaPq2I04aF/UvN5ccs7ZqxMK6KVZYeT0g2adkfeDM5mn08GAtSY+f/T XhDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qgEbu6Bq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id y14-20020a17090322ce00b001c60c5bbff2si15274675plg.201.2023.10.11.04.52.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 04:52:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qgEbu6Bq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (Postfix) with ESMTP id 17EE080213A5; Wed, 11 Oct 2023 04:52:10 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231807AbjJKLvx (ORCPT + 99 others); Wed, 11 Oct 2023 07:51:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55936 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234829AbjJKLsz (ORCPT ); Wed, 11 Oct 2023 07:48:55 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F257CA9; Wed, 11 Oct 2023 04:48:53 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1DE7EC433C8; Wed, 11 Oct 2023 11:48:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697024933; bh=u9Bib1G26xubCLXuoKQJbbgiqRSPlByRzAQB8SaHLx8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=qgEbu6Bq9z3UKeqhLy0QAKw1dKpXyvqi+9uOAtjmlqemipeYtjlEItfPEOMrzvuT3 OZZLazIYlcv5TbWWw9783GNQ9q9wAE6p+IBpzwXzpPeYNbuL7SiWkMvZesL9ajtmv2 DSA13c+KAkJ4OzrSGP3PStTDv1jAAg/VP7UupPmJUsr6Zmut+AzNyU/H24KHp+OEmz /aoXU7viEam2Fmft5M/qEVLlUtpW49CGK+h33lBfBZ9qh5afKui/QK1+Fiui+MQIC+ R4d5sn5dk+CAU/oBsKPdGklyZXeZsv2qt2vH4B4BaIUTE4IXX9Tl79xdWdplCJYDE3 FP5NJR4xepdEA== Date: Wed, 11 Oct 2023 17:18:49 +0530 From: Vinod Koul To: Kelvin.Cao@microchip.com Cc: dmaengine@vger.kernel.org, George.Ge@microchip.com, linux-kernel@vger.kernel.org, logang@deltatee.com, christophe.jaillet@wanadoo.fr, hch@infradead.org 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> <1c677fbf37ac2783f864b523482d4e06d9188861.camel@microchip.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1c677fbf37ac2783f864b523482d4e06d9188861.camel@microchip.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 howler.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 (howler.vger.email [0.0.0.0]); Wed, 11 Oct 2023 04:52:10 -0700 (PDT) X-Spam-Level: ** On 10-10-23, 21:23, Kelvin.Cao@microchip.com wrote: > On Mon, 2023-10-09 at 11:08 +0530, Vinod Koul wrote: > > > u64 size_to_transfer; > > > > Why cant the client driver write to doorbell, is there anything which > > prevents us from doing so? > > I think the potential challenge here for the client driver to ring db > is that the client driver (host RC) is a different requester in the > PCIe hierarchy compared to DMA EP, in which case PCIe ordering need to > be considered. > > As PCIe ensures that reads don't pass writes, we can insert a read DMA > operation with DMA_PREP_FENSE flag in between the two DMA writes (one > for data transfer and one for notification) to ensure the ordering for > the same requester DMA EP. I'm not sure if the RC could ensure the same > ordering if the client driver issue MMIO write to db after the data DMA > and read DMA completion, so that the consumer is guaranteed the > transferred data is ready in memory when the db is triggered by the > client MMIO write. I guess it's still doable with MMIO write but just > some special consideration needed. Given that it is a single value, overhead of doing a new txn would be higher than a mmio write! I think that should be preferred -- ~Vinod