Received: by 10.213.65.68 with SMTP id h4csp442240imn; Fri, 30 Mar 2018 08:26:38 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+4NIGirnzNdnjDFjBCySbmZ8OvFR9fLkI3I50KwCOfQxoXsOD0KIw8aR5COZXYKLC0yDmG X-Received: by 2002:a17:902:127:: with SMTP id 36-v6mr13405641plb.194.1522423598652; Fri, 30 Mar 2018 08:26:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522423598; cv=none; d=google.com; s=arc-20160816; b=zGJeCn8vp36Osjs9wGc8leZ2q9OwqTLStBwDWgNHWE3srR+XLqcaL0PBz6kq/CbSOR 1Isti761m8rV9y18sO11YZDuRW3CFgM+Nnqb7nQIgqGgN6slDyKfc26AQ9VTmWMIc/Rv aRY6zhgcLfOXTYZAFPKIzvzyUscIx/ksLsavA4jLPR2DjC5QE0uZzhbHXAgHl7ccBiDe 6vyE2Mpa62ogSNmQ6A19cbLbrT0kGqJos5S/Oh/o9YkiueNZPGLt3DU0MR0PM47JOQ1e BsSP7ZCr1YX2iRm09w3is2MTWfK3X1Aw7I3GS4lUbVU2x9fTmdFxWWwGYsZ1y8CkVOSI 0cXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date :arc-authentication-results; bh=N8wVky9YMo5jhpOyX/raVI7Bst0zucXYxTpHmHfYKtc=; b=xM4qxElXUa0HzYN/ObDVnjTbC83PON/D0fhu4Nnx6e5hmiPQmU8Gvat/v6qdn/qVli 1sZhKJk6cIFbMWtQHa827bMe+9bidIZJfmGh+Nni20nqq3ZipTZzI6Fr8u+8XX4MTYmv cZoFBQxpwwIP8E+VPW3YCG9UtUUOKAndYWVmIUCqm0XO29VBNdGynQqC2I9LXN9GCqBX P7EODJVd4mSMQAfJtDSwxWvU+2kGtBblL1A+UZmBfKP3i23ejK0+bQ/xJD2EVXCDeoR7 Jt2VrNNiqEdF9DX6BnXK/+24t2a1oMLI5/+QEkIrowcxAc9s+c/OWfQDiJYAHTLxPexq 3CuQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h1-v6si4410251plh.540.2018.03.30.08.26.24; Fri, 30 Mar 2018 08:26:38 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751907AbeC3PZS (ORCPT + 99 others); Fri, 30 Mar 2018 11:25:18 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:39778 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751216AbeC3PZR (ORCPT ); Fri, 30 Mar 2018 11:25:17 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7E04142F09CE; Fri, 30 Mar 2018 15:25:16 +0000 (UTC) Received: from redhat.com (ovpn-121-212.rdu2.redhat.com [10.10.121.212]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5373B215CDC6; Fri, 30 Mar 2018 15:25:15 +0000 (UTC) Date: Fri, 30 Mar 2018 11:25:13 -0400 From: Jerome Glisse To: Christoph Hellwig Cc: Logan Gunthorpe , Christian =?iso-8859-1?Q?K=F6nig?= , Will Davis , 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 Subject: Re: [PATCH 2/8] PCI: Add pci_find_common_upstream_dev() Message-ID: <20180330152513.GA3198@redhat.com> 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> <20180330063334.GA8634@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20180330063334.GA8634@infradead.org> User-Agent: Mutt/1.9.2 (2017-12-15) X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Fri, 30 Mar 2018 15:25:16 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Fri, 30 Mar 2018 15:25:16 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'jglisse@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 29, 2018 at 11:33:34PM -0700, Christoph Hellwig wrote: > On Thu, Mar 29, 2018 at 09:58:54PM -0400, Jerome Glisse wrote: > > dma_map_resource() is the right API (thought its current implementation > > is fill with x86 assumptions). So i would argue that arch can decide to > > implement it or simply return dma error address which trigger fallback > > path into the caller (at least for GPU drivers). SG variant can be added > > on top. > > It isn't in general. It doesn't integrate with scatterlists (see my > comment to page one), and it doesn't integrate with all the subsystems > that also need a kernel virtual address. IIRC SG variant was proposed at the time dma_map_resource() was added, dunno why they did not make it (again from memory i think it was because it grows the scatterlist struct size). My point is more than people that need SG variant should work on adding it. People who do not, should not be stop by the lack of it. There is something there upstream, it does not make sense to not use it. The dma-buf infrastructure is useful to many drivers. If you do not want to share the underlying logic of dma_map_resource() fine (ie not sharing code inside drivers/iommu/*). I thought it would be a good thing to share code ... Cheers, J?r?me