Received: by 10.213.65.68 with SMTP id h4csp793659imn; Wed, 28 Mar 2018 12:54:37 -0700 (PDT) X-Google-Smtp-Source: AIpwx49fscGokx6NhjhQgyAUfwZd70HQyS2dV+lKicTHnVnCdnSXWmqkVb6l8QZL4aMmAdeETybw X-Received: by 2002:a17:902:8c93:: with SMTP id t19-v6mr5090798plo.301.1522266877883; Wed, 28 Mar 2018 12:54:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522266877; cv=none; d=google.com; s=arc-20160816; b=VQH9lG+AosTHzZ4bUeYoVaeKb7oolX48TyqFj+zEEiYu0sbU2JP8aMOju+kK0C1jSp Pjtwb1b3nSmcOrjZJeVGpllgU317D5GIkgxu7+JEGvmTToO6QVlWcgi702n28JJdbTgR DVbIT/ohy0YKqzbIXkPTHbY9jg425N3Tc5FhWVXHeQDx6zrP3hKMXPa5TJGfkxqBnSX/ vM1i+eUYTgC94QwVsaWp3MOvxVHCrp0tsJ77XCfkCiIWAVNXCTEZze/2TFUpFh8Zhury 4T20PiUmtxU+6fnbNnyXOCAAdjNulnn/269MblMvTBuKTexjOsIOnhGHC6u+OX+W5tzr HHrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:subject:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:arc-authentication-results; bh=xQceCFpoCy0p5I2AGCxVTxXNwPHLHV0B0rvp5BrlFTc=; b=Vik4IIuUP2bwV3LkWZn1RPtCOjSg+09M8/zRTdJmsFfeU/kzo59LGjrCzaCcTx33Hw 4wcHn154TSDXPOQQvhsop5P3WEM7ljBbnjllq/jG8zdK5wURLYLD9aVgV+lsAwr8hMg8 ernNqqFtW6HxnnIEODvk5WvmLrNKPZpRRKpnhCjk3nHThx5ZYvU6P9XDwtqZ1X7h4emw l89vNS0YMdxXUt7PZGtCCgwck3VYiyH4+oEy0Vbz4jF66fvIwcMGyvO79CUSm42724TE wS7M9+T5XUwEO9zqWlGXMi3CkI0ufG/8RCTIfbF/YauAM4hnYXGtsp6lRZgW1+v7fOfr urVQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z3-v6si4080047pln.277.2018.03.28.12.54.23; Wed, 28 Mar 2018 12:54:37 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753353AbeC1Txb (ORCPT + 99 others); Wed, 28 Mar 2018 15:53:31 -0400 Received: from ale.deltatee.com ([207.54.116.67]:40952 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753225AbeC1Tx3 (ORCPT ); Wed, 28 Mar 2018 15:53:29 -0400 Received: from guinness.priv.deltatee.com ([172.16.1.162]) by ale.deltatee.com with esmtp (Exim 4.89) (envelope-from ) id 1f1H8S-0000q2-Bl; Wed, 28 Mar 2018 13:53:29 -0600 To: =?UTF-8?Q?Christian_K=c3=b6nig?= , Christoph Hellwig Cc: linaro-mm-sig@lists.linaro.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, amd-gfx@lists.freedesktop.org, linux-media@vger.kernel.org References: <20180325110000.2238-1-christian.koenig@amd.com> <20180325110000.2238-2-christian.koenig@amd.com> <20180328123830.GB25060@infradead.org> <613a6c91-7e72-5589-77e6-587ec973d553@gmail.com> <5498e9b5-8fe5-8999-a44e-f7dc483bc9ce@amd.com> <16c7bef8-5f03-9e89-1f50-b62fb139a36f@deltatee.com> <6a5c9a10-50fe-b03d-dfc1-791d62d79f8e@amd.com> <73578b4e-664b-141c-3e1f-e1fae1e4db07@amd.com> From: Logan Gunthorpe Message-ID: <1b08c13e-b4a2-08f2-6194-93e6c21b7965@deltatee.com> Date: Wed, 28 Mar 2018 13:53:25 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <73578b4e-664b-141c-3e1f-e1fae1e4db07@amd.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 172.16.1.162 X-SA-Exim-Rcpt-To: linux-media@vger.kernel.org, amd-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, hch@infradead.org, christian.koenig@amd.com X-SA-Exim-Mail-From: logang@deltatee.com X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on ale.deltatee.com X-Spam-Level: X-Spam-Status: No, score=-8.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, GREYLIST_ISWHITE,T_RP_MATCHES_RCVD autolearn=ham autolearn_force=no version=3.4.1 Subject: Re: [PATCH 2/8] PCI: Add pci_find_common_upstream_dev() X-SA-Exim-Version: 4.2.1 (built Tue, 02 Aug 2016 21:08:31 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 28/03/18 01:44 PM, Christian König wrote: > Well, isn't that exactly what dma_map_resource() is good for? As far as > I can see it makes sure IOMMU is aware of the access route and > translates a CPU address into a PCI Bus address. > I'm using that with the AMD IOMMU driver and at least there it works > perfectly fine. Yes, it would be nice, but no arch has implemented this yet. We are just lucky in the x86 case because that arch is simple and doesn't need to do anything for P2P (partially due to the Bus and CPU addresses being the same). But in the general case, you can't rely on it. >>> Yeah, but not for ours. See if you want to do real peer 2 peer you need >>> to keep both the operation as well as the direction into account. >> Not sure what you are saying here... I'm pretty sure we are doing "real" >> peer 2 peer... >> >>> For example when you can do writes between A and B that doesn't mean >>> that writes between B and A work. And reads are generally less likely to >>> work than writes. etc... >> If both devices are behind a switch then the PCI spec guarantees that A >> can both read and write B and vice versa. > > Sorry to say that, but I know a whole bunch of PCI devices which > horrible ignores that. Can you elaborate? As far as the device is concerned it shouldn't know whether a request comes from a peer or from the host. If it does do crazy stuff like that it's well out of spec. It's up to the switch (or root complex if good support exists) to route the request to the device and it's the root complex that tends to be what drops the load requests which causes the asymmetries. Logan