Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp2450584rdb; Tue, 12 Sep 2023 02:08:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFMwWmaSpDv8N8chq8sUfnTWPY24wVTtUdu/NFIJS+AZ5wUSCR0H+D8wJWCS9TI6D6Buyh0 X-Received: by 2002:a17:902:ea0c:b0:1c3:81b7:2385 with SMTP id s12-20020a170902ea0c00b001c381b72385mr3236862plg.11.1694509715203; Tue, 12 Sep 2023 02:08:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694509715; cv=none; d=google.com; s=arc-20160816; b=VYaqblRP46mdh5dXpNVY4Q1LadImYWrk/Bi4VCPOLegde8tVOZ33dmizk4Jx2vcaTG 2snO5HNCTqSZzJ8Dx6uoCT/vyosd4HJ9VbCkxYYpkNLc3MJmISYpsrM5Ua8hTsNT0jlW i+7YABJ+81cQXisLHr55+gDzCVKiDePjGoMjOypcrEzGL3GmAIxpYmSs1J4xv1cAzbup xHCzTycZJGioihs+n3eLp3CB//9mfRyAqM3bmpPIaHtH3sXnvx5/jMPILsoSvGIHADaB COhmjMJC4vDkqCOiQMw34D51RUzkLEm1k80hxJizvwDYYIc2oJLpRz7s1VtX/phsEKK8 u8uA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=16xgyBLOryMUfKHXzxqMoUfN46hheLieUlRWExzNh+s=; fh=h9e1PGarGMUhjJmsNa+Y1+tRVjk8NiCJfwe1fCGKRxE=; b=nL3jFkoRmbESR1bE91JO6pYHZx8IdGlfH4m0LWXpbwqMJ+jdrK2Q7aoh642VCoU9th MkgPd/rbXBUPq9GX6OhFQGbwIF0Q78GMR1aij2b/wGsHaPGflRkCIYOVa1t8X//z5sFD deNcOFJN+S3WF0w+ZjveCqDSwwc67EFs1izN3u1cpu66I3/JXCEdKEtCCBz1NbT1bVwz f2ZxP9YYNFTOhalwdHgKHyzGeD+T1SGQtO13hr+hjZpM0POsnP29U9p1mBFp7QyQauzV SwoJvlCWFDebmOvsgDHyo0ncKE91FsqTuWXzrezXqfrg9b9JUJU3rYmWONHWy3BBsLNf uivg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=D6DM6dgW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id kt15-20020a170903088f00b001bb993ef74bsi7439691plb.540.2023.09.12.02.08.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 02:08:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=D6DM6dgW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 9489780BD395; Tue, 12 Sep 2023 01:55:51 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233014AbjILIzu (ORCPT + 99 others); Tue, 12 Sep 2023 04:55:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50162 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232990AbjILIzt (ORCPT ); Tue, 12 Sep 2023 04:55:49 -0400 Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::223]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AD158E7F; Tue, 12 Sep 2023 01:55:44 -0700 (PDT) Received: by mail.gandi.net (Postfix) with ESMTPSA id 58C1960024; Tue, 12 Sep 2023 08:52:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1694508943; 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=16xgyBLOryMUfKHXzxqMoUfN46hheLieUlRWExzNh+s=; b=D6DM6dgWVj47C12ac+Wpi9x4d6OB5VYTkuiSx3fMY6uJ4YZuhmzUka/xR5/80F2rOgN3gx ynEe6wlyxInJf/euOO6eZ5VHEI05nYj1We1Oe9MrS1b0o9AlpMR6whww1OViqV9iANWkWQ 9pBZUWi5u+dwfluSSwLlCapumvtdFL1nkZ9apEkcY1WUpTMJYNSMxMR7ooyZqPQhV8EjFh Fvq0bcFQsh16CUIIQGU64NdYaeFveUn6LUA9GKksSckw2E/9/r3N29oR86poBwu0XyzVKP tUbnVAAtJVajlqQPD7fTBgJ291pe1dwKM+Nx+e0/B8ZdIOtj3sOU6OH5VnTBsw== Date: Tue, 12 Sep 2023 10:52:10 +0200 From: =?UTF-8?B?S8O2cnk=?= Maincent To: Serge Semin Cc: Cai Huoqing , Manivannan Sadhasivam , Vinod Koul , Gustavo Pimentel , dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, Thomas Petazzoni , Herve Codina Subject: Re: [PATCH 4/9] dmaengine: dw-edma: HDMA: Add memory barrier before starting the DMA transfer in remote setup Message-ID: <20230912105152.42cf1454@kmaincent-XPS-13-7390> In-Reply-To: References: <20230609081654.330857-1-kory.maincent@bootlin.com> <20230609081654.330857-5-kory.maincent@bootlin.com> <20230619170201.5hbgte2optjlbx55@mobilestation.baikal.int> <20230619203207.694bfac6@kmaincent-XPS-13-7390> <20230620153006.036ca3ba@kmaincent-XPS-13-7390> <20230621151948.36125997@kmaincent-XPS-13-7390> <20230622171203.6857b918@kmaincent-XPS-13-7390> Organization: bootlin X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-GND-Sasl: kory.maincent@bootlin.com 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 (agentk.vger.email [0.0.0.0]); Tue, 12 Sep 2023 01:55:51 -0700 (PDT) X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Hello Serge, I am back with an hardware design answer: > "Even though the PCIe itself respects the transactions ordering, the=20 > AXI bus does not have an end-to-end completion acknowledgement (it > terminates at the PCIe EP boundary with bus), and does not guaranteed > ordering if accessing different destinations on the Bus. So, an access to= LL > could be declared complete even though the transactions is still being > pipelined in the AXI Bus. (a dozen or so clocks, I can give an accurate > number if needed) >=20 > The access to DMA registers is done through BAR0 =E2=80=9Crolling=E2=80=9D > so the transaction does not actually go out on the AXI bus and > looped-back to PCIe DMA, rather it stays inside the PCIe EP. >=20 > For the above reasons, hypothetically, there=E2=80=99s a chance that even= if the DMA > LL is accessed before the DM DB from PCIe RC side, the DB could be updated > before the LL in local memory." On Thu, 22 Jun 2023 19:22:20 +0300 Serge Semin wrote: =20 > If we get assured that hardware with such problem exists (if you'll get > confirmation about the supposition 3. above) then we'll need to > activate your trick for that hardware only. Adding dummy reads for all > the remote eDMA setups doesn't look correct since it adds additional > delay to the execution path and especially seeing nobody has noticed > and reported such problem so far (for instance Gustavo didn't see the > problem on his device otherwise he would have fixed it). >=20 > So if assumption 3. is correct then I'd suggest the next > implementation: add a new dw_edma_chip_flags flag defined (a.k.a > DW_EDMA_SLOW_MEM), have it specified via the dw_edma_chip.flags field > in the Akida device probe() method and activate your trick only if > that flag is set. The flag you suggested is about slow memory write but as said above the iss= ue comes from the AXI bus and not the memory. I am wondering why you don't see this issue. If I understand well it should be present on all IP as the DMA register is internal to the IP and the LL memory is external through AXI bu= s. Did you stress your IP? On my side it appears with lots of operation using several (at least 3) thread through 2 DMA channels. K=C3=B6ry