Received: by 10.213.65.68 with SMTP id h4csp2580706imn; Mon, 2 Apr 2018 10:04:17 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/jSkln/udPkRv8Coo5FOYJ+H9OtGE9e0LcPVwGH15bzqNlxg4VZZcXL9cT/aXtOFM3399u X-Received: by 2002:a17:902:274a:: with SMTP id j10-v6mr10364557plg.28.1522688657469; Mon, 02 Apr 2018 10:04:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522688657; cv=none; d=google.com; s=arc-20160816; b=Y+RmrthZ+1PD5mGijpztxgX6b1hGI94R/Cvtcyp6fil2pdC9llelLH9jtXKDhkFJdm JyE0TovNgY0qDxEDuEOXnStgk68mMSNB4QclIbX2unbwHYOPcSqjjNn1rsyZy27O/i59 voMvHzd5p2g2K0qx6OTsow09YratnRzHNB7ZxYNDEa5wwO4ZUONed1qSuHgQn4SLe7i+ /XkOsizUzCvAVd+l5oDHVlr3ev98eP5pUWK6VwcNgjzfKJbNfGzmWhld51WS4nQ9hDl7 nz3XR+zHrk7CZc9W7hWyXw2G/E0FFf2bi26jCzBk6yZ8uVJFp+weBkGBLgsL1/cMNwK2 y8Ew== 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=GlQHd4w8ER7ZmYkr0hDFRue57OKLjPdwXI3HZWjpy/M=; b=Qjgme3TXrLqK1eRDgE3qNXawFMImaKLCxy2XnIt0q0iQNxLwBM0ZKIhK8o46n8w5YW IjuhNBRejsOJc2wWCbrHWFKl9NuYjNjJmK+UVb/evhHJqG1NlBcP67k4mi17H298+DxU ECMju2RbdDA/yxCpbjEYPNsgz/zdAkLnHaEFtgHjLio56p9sa3B5n+h/Bg+1MkoNYVoR PNr0XmV9fUQAcpAm98MUp39uxaetmhNMsfTwQJo/lv1IPeJ4VfnJNeIPbsTYqHOab4CH fog6HVqLHkAGZVqMhj5iVSYuA+rus4gYVYG5uxb9+i06ncgI4viBkxjBW5TIhZ90W5F3 uhVw== 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 c18si526462pfn.113.2018.04.02.10.04.03; Mon, 02 Apr 2018 10:04:17 -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 S1753224AbeDBRCW (ORCPT + 99 others); Mon, 2 Apr 2018 13:02:22 -0400 Received: from ale.deltatee.com ([207.54.116.67]:40390 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753139AbeDBRCT (ORCPT ); Mon, 2 Apr 2018 13:02:19 -0400 Received: from guinness.priv.deltatee.com ([172.16.1.162]) by ale.deltatee.com with esmtp (Exim 4.89) (envelope-from ) id 1f32qT-00058X-UJ; Mon, 02 Apr 2018 11:02:15 -0600 To: Jerome Glisse Cc: =?UTF-8?Q?Christian_K=c3=b6nig?= , Christoph Hellwig , Will Davis , Joerg Roedel , linaro-mm-sig@lists.linaro.org, amd-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-media@vger.kernel.org, Bjorn Helgaas References: <6a5c9a10-50fe-b03d-dfc1-791d62d79f8e@amd.com> <73578b4e-664b-141c-3e1f-e1fae1e4db07@amd.com> <1b08c13e-b4a2-08f2-6194-93e6c21b7965@deltatee.com> <70adc2cc-f7aa-d4b9-7d7a-71f3ae99f16c@gmail.com> <98ce6cfd-bcf3-811e-a0f1-757b60da467a@deltatee.com> <8d050848-8970-b8c4-a657-429fefd31769@amd.com> <20180330015854.GA3572@redhat.com> <0234bc5e-495e-0f68-fb0a-debb17a35761@deltatee.com> <20180330194519.GC3198@redhat.com> From: Logan Gunthorpe Message-ID: <31266710-f6bb-99ee-c73d-6e58afe5c38c@deltatee.com> Date: Mon, 2 Apr 2018 11:02:10 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20180330194519.GC3198@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 172.16.1.162 X-SA-Exim-Rcpt-To: bhelgaas@google.com, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, amd-gfx@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, joro@8bytes.org, wdavis@nvidia.com, hch@infradead.org, christian.koenig@amd.com, jglisse@redhat.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 30/03/18 01:45 PM, Jerome Glisse wrote: > Looking at upstream code it seems that the x86 bits never made it upstream > and thus what is now upstream is only for ARM. See [1] for x86 code. Dunno > what happen, i was convince it got merge. So yes current code is broken on > x86. ccing Joerg maybe he remembers what happened there. > > [1] https://lwn.net/Articles/646605/ That looks like a significant improvement over what's upstream. But it's three years old and looks to have been abandoned. I think I agree with Bjorn's comments in that if it's going to be a general P2P API it will need the device the resource belongs to in addition to the device that's initiating the DMA request. > Given it is currently only used by ARM folks it appear to at least work > for them (tm) :) Note that Christian is doing this in PCIE only context > and again dma_map_resource can easily figure that out if the address is > a PCIE or something else. Note that the exporter export the CPU bus > address. So again dma_map_resource has all the informations it will ever > need, if the peer to peer is fundamentaly un-doable it can return dma > error and it is up to the caller to handle this, just like GPU code do. > > Do you claim that dma_map_resource is missing any information ? Yes, that's what I said. All the existing ARM code appears to use it for platform devices only. I suspect platform P2P is relatively trivial to support on ARM. I think it's a big difference from using it for PCI P2P or general P2P on any bus. > I agree and understand that but for platform where such feature make sense > this will work. For me it is PowerPC and x86 and given PowerPC has CAPI > which has far more advance feature when it comes to peer to peer, i don't > see something more basic not working. On x86, Intel is a bit of lone wolf, > dunno if they gonna support this usecase pro-actively. AMD definitly will. Well PowerPC doesn't even support P2P between root ports. And I fail to see how CAPI applies unless/until we get this memory mapped into userspace and the mappings need to be dynamically managed. Seems like that's a long way away. Logan