From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754191AbeC1Prz (ORCPT ); Wed, 28 Mar 2018 11:47:55 -0400 Received: from ale.deltatee.com ([207.54.116.67]:39382 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753816AbeC1Prx (ORCPT ); Wed, 28 Mar 2018 11:47:53 -0400 To: christian.koenig@amd.com, Christoph Hellwig Cc: linaro-mm-sig@lists.linaro.org, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, linux-kernel@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> From: Logan Gunthorpe Message-ID: Date: Wed, 28 Mar 2018 09:47:48 -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: <613a6c91-7e72-5589-77e6-587ec973d553@gmail.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-kernel@vger.kernel.org, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-media@vger.kernel.org, linaro-mm-sig@lists.linaro.org, hch@infradead.org, christian.koenig@amd.com X-SA-Exim-Mail-From: logang@deltatee.com 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 List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 28/03/18 09:07 AM, Christian König wrote: > Am 28.03.2018 um 14:38 schrieb Christoph Hellwig: >> On Sun, Mar 25, 2018 at 12:59:54PM +0200, Christian König wrote: >>> From: "wdavis@nvidia.com" >>> >>> Add an interface to find the first device which is upstream of both >>> devices. >> Please work with Logan and base this on top of the outstanding peer >> to peer patchset. > > Can you point me to that? The last code I could find about that was from > 2015. The latest posted series is here: https://lkml.org/lkml/2018/3/12/830 However, we've made some significant changes to the area that's similar to what you are doing. You can find lasted un-posted here: https://github.com/sbates130272/linux-p2pmem/tree/pci-p2p-v4-pre2 Specifically this function would be of interest to you: https://github.com/sbates130272/linux-p2pmem/blob/0e9468ae2a5a5198513dd12990151e09105f0351/drivers/pci/p2pdma.c#L239 However, the difference between what we are doing is that we are interested in the distance through the common upstream device and you appear to be finding the actual common device. Thanks, Logan