Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4963896imu; Tue, 29 Jan 2019 10:25:17 -0800 (PST) X-Google-Smtp-Source: ALg8bN5mSF9Fa4uCclbJ9etn/aM1SY9EYd02yNcd/ad/aYHWN28d8w4YfzLI1ccaXnuo7DjOM+80 X-Received: by 2002:a17:902:e085:: with SMTP id cb5mr26719936plb.24.1548786317218; Tue, 29 Jan 2019 10:25:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548786317; cv=none; d=google.com; s=arc-20160816; b=IiU9WUA0MzdmsabFkD5+iwXXLGTwi0UBVlT3V9b9pGAFpwsQ+bIbHFx+31xOTPbT9/ eMS+8LK/JKApsfgKmqLbWWai8w5GZKDEIHPL1PcSsypokGGjeAFg3aPUx0buGTEHe8fO RCHveBmxJSfdBNMfGj401vqpH+Ksr8DckCIXOrXUQ/2uWPOjF6mcctVVGkzN5q1uNOfI RPBZyK9eVmaDjwSxb3lpMQxlHrCc9E2QctN9G8u0G7aLmPyy/zS09cAUTnczp0PyM8CS OYCfna/aR/d1OkPmXiOJU1UNX2kjfSfqcmLVTVd10gBAv4VAGGeh4i2rlI/dhp4x3zkH SgKg== 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; bh=824iHOQ6ZVTZGDGOFtGGbG4bABFEft3RPBzbH2O99Bw=; b=WtWMrjyTdUlHv1Z9yFNHWQLBv6/iM1Dm63jz6Et+b+KMkf9fcyS0s7TRbQZH6VFolt 7dkyHQSL8MavQlFXWyphi0DyP3FnVw0qvLtQw+3wYxDyQJHIb9s2zoNWd2hg8l9JgOsL /edA3d15dpbGiU8zriHMs66dUwzd90cPv/MPlUFPRfO9gZ4eeFxUAoiPLhYhR/E4Yf1K j4DI8h5KFrxyUx8ZpGPW/B/JqQF9ySa4jmm6GoBbQi0QYQwmt+am6sAPtZrVdQPGYVkA mVCE6ncOfSbR5zRhevOXL0Xj8Me7i6TjTatKNHycaFBz2qU/Xbh0dZwmiv2szRQgMLNc C9uw== 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 10si2910999pgl.30.2019.01.29.10.25.01; Tue, 29 Jan 2019 10:25:17 -0800 (PST) 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 S1728439AbfA2SYj (ORCPT + 99 others); Tue, 29 Jan 2019 13:24:39 -0500 Received: from ale.deltatee.com ([207.54.116.67]:58730 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726852AbfA2SYj (ORCPT ); Tue, 29 Jan 2019 13:24:39 -0500 Received: from guinness.priv.deltatee.com ([172.16.1.162]) by ale.deltatee.com with esmtp (Exim 4.89) (envelope-from ) id 1goY3S-000521-OA; Tue, 29 Jan 2019 11:24:15 -0700 To: jglisse@redhat.com, linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org, Greg Kroah-Hartman , "Rafael J . Wysocki" , Bjorn Helgaas , Christian Koenig , Felix Kuehling , Jason Gunthorpe , linux-pci@vger.kernel.org, dri-devel@lists.freedesktop.org, Christoph Hellwig , Marek Szyprowski , Robin Murphy , Joerg Roedel , iommu@lists.linux-foundation.org References: <20190129174728.6430-1-jglisse@redhat.com> <20190129174728.6430-2-jglisse@redhat.com> From: Logan Gunthorpe Message-ID: Date: Tue, 29 Jan 2019 11:24:09 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <20190129174728.6430-2-jglisse@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-CA Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 172.16.1.162 X-SA-Exim-Rcpt-To: iommu@lists.linux-foundation.org, jroedel@suse.de, robin.murphy@arm.com, m.szyprowski@samsung.com, hch@lst.de, dri-devel@lists.freedesktop.org, linux-pci@vger.kernel.org, jgg@mellanox.com, Felix.Kuehling@amd.com, christian.koenig@amd.com, bhelgaas@google.com, rafael@kernel.org, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, jglisse@redhat.com X-SA-Exim-Mail-From: logang@deltatee.com X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on ale.deltatee.com X-Spam-Level: X-Spam-Status: No, score=-8.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, GREYLIST_ISWHITE autolearn=ham autolearn_force=no version=3.4.2 Subject: Re: [RFC PATCH 1/5] pci/p2p: add a function to test peer to peer capability 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 2019-01-29 10:47 a.m., jglisse@redhat.com wrote: > +bool pci_test_p2p(struct device *devA, struct device *devB) > +{ > + struct pci_dev *pciA, *pciB; > + bool ret; > + int tmp; > + > + /* > + * For now we only support PCIE peer to peer but other inter-connect > + * can be added. > + */ > + pciA = find_parent_pci_dev(devA); > + pciB = find_parent_pci_dev(devB); > + if (pciA == NULL || pciB == NULL) { > + ret = false; > + goto out; > + } > + > + tmp = upstream_bridge_distance(pciA, pciB, NULL); > + ret = tmp < 0 ? false : true; > + > +out: > + pci_dev_put(pciB); > + pci_dev_put(pciA); > + return false; > +} > +EXPORT_SYMBOL_GPL(pci_test_p2p); This function only ever returns false.... Logan