From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8C5B8C282C7 for ; Tue, 29 Jan 2019 19:56:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 568E72084C for ; Tue, 29 Jan 2019 19:56:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729430AbfA2T46 (ORCPT ); Tue, 29 Jan 2019 14:56:58 -0500 Received: from mx1.redhat.com ([209.132.183.28]:37592 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726984AbfA2T45 (ORCPT ); Tue, 29 Jan 2019 14:56:57 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5E41A2DD2A; Tue, 29 Jan 2019 19:56:56 +0000 (UTC) Received: from redhat.com (ovpn-122-2.rdu2.redhat.com [10.10.122.2]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EE021600CC; Tue, 29 Jan 2019 19:56:53 +0000 (UTC) Date: Tue, 29 Jan 2019 14:56:52 -0500 From: Jerome Glisse To: Greg Kroah-Hartman Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Logan Gunthorpe , "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 Subject: Re: [RFC PATCH 2/5] drivers/base: add a function to test peer to peer capability Message-ID: <20190129195651.GK3176@redhat.com> References: <20190129174728.6430-1-jglisse@redhat.com> <20190129174728.6430-3-jglisse@redhat.com> <20190129194605.GC32069@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190129194605.GC32069@kroah.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Tue, 29 Jan 2019 19:56:57 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 29, 2019 at 08:46:05PM +0100, Greg Kroah-Hartman wrote: > On Tue, Jan 29, 2019 at 12:47:25PM -0500, jglisse@redhat.com wrote: > > From: Jérôme Glisse > > > > device_test_p2p() return true if two devices can peer to peer to > > each other. We add a generic function as different inter-connect > > can support peer to peer and we want to genericaly test this no > > matter what the inter-connect might be. However this version only > > support PCIE for now. > > There is no defintion of "peer to peer" in the driver/device model, so > why should this be in the driver core at all? > > Especially as you only do this for PCI, why not just keep it in the PCI > layer, that way you _know_ you are dealing with the right pointer types > and there is no need to mess around with the driver core at all. Ok i will drop the core device change. I wanted to allow other non PCI to join latter on (ie allow PCI device to export to non PCI device) but if that ever happen then we can update pci exporter at the same time we introduce non pci importer. Cheers, Jérôme