Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3612352imu; Fri, 18 Jan 2019 13:34:32 -0800 (PST) X-Google-Smtp-Source: ALg8bN5g4AU3NHMVB/4551Q3NO7O+4yFNr2U5sLEuJj7joQhGAxi29fkpvb6mbeAoTHeqKquxlUP X-Received: by 2002:a17:902:f01:: with SMTP id 1mr20191450ply.143.1547847272829; Fri, 18 Jan 2019 13:34:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547847272; cv=none; d=google.com; s=arc-20160816; b=S1unnfs3Dj63Dt+eZHjQ7ZQEpnfJISS34JfQ3IGM7jEERefGf9+63s2n80cuCqyWrB 1cjFSEpO7E2q7CqHIz4TfVCe+S+x6Gc8LzbldPp28Ng44caTt1/D5kYSB59oqqe3/TEl tdL4mgNhIIhdqiprxVjWxH25cR2ktqQv05uJqQyTuqvTfDHwoGyS89Zw4s7IA6bYURrk CVIgfZtnaO8v9CUTVqQetoKx5Wma1SuSjEfQ6QDSbZO2uzSzV/ow4frrIuAu/JI4IN8J sBh7A5D/KjHyMtNRez3EUJd9R/XRRFe6XndrXHGkkyATE9BO1dGyN/PKz0Pf5Lzt/1jC ar5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date:dmarc-filter :dkim-signature:dkim-signature; bh=rIDS34jARa3VrWbDtrQOMHHHXloAI/BnT51s1nsJjjc=; b=aQ/frGjT/ZpfRyI8QKK3ykM0CKZF0M08UZ2VLQlGNNbQjhIzC0FweedXmpSD5uWi9l 6dVx6SbhLzAcUtk4DG7M6BE6ZDkfrQQm9Ds+T20loxtag/aX52n3e2cTLaVB7B7/vQtP NcIJdQOZpitCC44HWnPYq/rkkzWjuu+tKCx6i2fflFeAXH2RLadmjZqwjyVCSvk/gUEE a8eyn8k18CGrZxOcN8NnhWyNROInoo/SRNk35YXtz3vju8JsNaGdBdNhb9Qngi7pmTWk HEpI7l6eAX9pG7aNaQBi+3IhNF/G82ga4RqfwAVbcGlyZ5/wTD4vTB8r6yec5fxkuC6d ri7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=S79vV7vj; dkim=pass header.i=@codeaurora.org header.s=default header.b=gjAJ0fPR; 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 e129si5647587pgc.333.2019.01.18.13.34.14; Fri, 18 Jan 2019 13:34:32 -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; dkim=pass header.i=@codeaurora.org header.s=default header.b=S79vV7vj; dkim=pass header.i=@codeaurora.org header.s=default header.b=gjAJ0fPR; 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 S1729771AbfARVc4 (ORCPT + 99 others); Fri, 18 Jan 2019 16:32:56 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:41682 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729725AbfARVcz (ORCPT ); Fri, 18 Jan 2019 16:32:55 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id D56A1608CC; Fri, 18 Jan 2019 21:32:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1547847174; bh=UZnCKxb6ZrWfjM/OUHrLJO/tDBrmvJlyjcuWHnZsoOc=; h=Date:From:To:cc:Subject:In-Reply-To:References:From; b=S79vV7vjRtxwk6msAlVa+fgkPMGMFgyt8ndg8skSpm4343wyWRIzjZSPkjt9eCK7n fU/XG92vZp8UyEnFQ0LsCDpIsxeI/8NrnxsU+OMGgdqpbNY7u03zaq9nLSJQ3wOEmd 2cI/l8otK1FpFUBtXGCIIMIZYDORZ3rydj54BVeM= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_INVALID,DKIM_SIGNED autolearn=no autolearn_force=no version=3.4.0 Received: from lmark-linux.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: lmark@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 0EC6160851; Fri, 18 Jan 2019 21:32:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1547847173; bh=UZnCKxb6ZrWfjM/OUHrLJO/tDBrmvJlyjcuWHnZsoOc=; h=Date:From:To:cc:Subject:In-Reply-To:References:From; b=gjAJ0fPReXSrKzvpGaJbw8uZgOB+VLL8mt2O7Vn9G88+7n92P8YDot5oZIBXpobvF 0OL81JrA2psKIDYdvcN7tPi62JrOHpXimgkVQ9rsKPiIQCBtSKctLORjc+qyunFbVY L9aPec4RcWCK2FRxjD2lbDj0pO7R1lfdyCRh4BYw= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 0EC6160851 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=lmark@codeaurora.org Date: Fri, 18 Jan 2019 13:32:52 -0800 (PST) From: Liam Mark X-X-Sender: lmark@lmark-linux.qualcomm.com To: Laura Abbott cc: sumit.semwal@linaro.org, arve@android.com, tkjos@android.com, maco@android.com, joel@joelfernandes.org, christian@brauner.io, devel@driverdev.osuosl.org, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, linux-kernel@vger.kernel.org, afd@ti.com, john.stultz@linaro.org Subject: Re: [PATCH 3/4] dma-buf: add support for mapping with dma mapping attributes In-Reply-To: <9f654f36-08de-f5e8-c9b3-ff9b2954f0a6@redhat.com> Message-ID: References: <1547836667-13695-1-git-send-email-lmark@codeaurora.org> <1547836667-13695-4-git-send-email-lmark@codeaurora.org> <9f654f36-08de-f5e8-c9b3-ff9b2954f0a6@redhat.com> User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 18 Jan 2019, Laura Abbott wrote: > On 1/18/19 10:37 AM, Liam Mark wrote: > > Add support for configuring dma mapping attributes when mapping > > and unmapping memory through dma_buf_map_attachment and > > dma_buf_unmap_attachment. > > > > Signed-off-by: Liam Mark > > --- > > include/linux/dma-buf.h | 3 +++ > > 1 file changed, 3 insertions(+) > > > > diff --git a/include/linux/dma-buf.h b/include/linux/dma-buf.h > > index 58725f890b5b..59bf33e09e2d 100644 > > --- a/include/linux/dma-buf.h > > +++ b/include/linux/dma-buf.h > > @@ -308,6 +308,8 @@ struct dma_buf { > > * @dev: device attached to the buffer. > > * @node: list of dma_buf_attachment. > > * @priv: exporter specific attachment data. > > + * @dma_map_attrs: DMA mapping attributes to be used in > > + * dma_buf_map_attachment() and dma_buf_unmap_attachment(). > > * > > * This structure holds the attachment information between the dma_buf > > buffer > > * and its user device(s). The list contains one attachment struct per > > device > > @@ -323,6 +325,7 @@ struct dma_buf_attachment { > > struct device *dev; > > struct list_head node; > > void *priv; > > + unsigned long dma_map_attrs; > > }; > > /** > > > > Did you miss part of this patch? This only adds it to the structure but > doesn't > add it to any API. The same commment applies to the follow up patch, > I don't quite see how it's being used. > Were you asking for a cleaner DMA-buf API to set this field or were you asking for a change to an upstream client to make use of this field? I have clients set the dma_map_attrs field directly on their dma_buf_attachment struct before calling dma_buf_map_attachment (if they need this functionality). Of course this is all being used in Android for out of tree drivers, but I assume it is just as useful to everyone else who has cached ION buffers which aren't always accessed by the CPU. My understanding is that AOSP Android on Hikey 960 also is currently suffering from too many CMOs due to dma_map_attachemnt always applying CMOs, so this support should help them avoid it. > Thanks, > Laura > Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project