Received: by 10.223.176.5 with SMTP id f5csp626110wra; Tue, 30 Jan 2018 16:49:38 -0800 (PST) X-Google-Smtp-Source: AH8x224CDRUSPuFnfwodhlPWButStuscvVQTmUgEcUsa9iJsTTt5CA+gCruhgzs7RZ1rNZ7ENTA1 X-Received: by 2002:a17:902:a9ca:: with SMTP id b10-v6mr11202965plr.223.1517359778187; Tue, 30 Jan 2018 16:49:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517359778; cv=none; d=google.com; s=arc-20160816; b=v6oatSR6iuWfx7d8oPf3pYs9Ao0o0akPcnPX7KLDtjjij4iNF+9xNG22/0HFzK3fh6 G0XuypVGGYJavfyhqlfqmmmNY95RE8SVwjTaz7trRcUwLSGtSOdqWeNUGojVsH0avblO u9qCC26FgKq8lFuJlludPcBn9boFrMbgBwFEOizmGuD7CbGsH4vMV8YyBK2ZjLnm6+7L Oeo5kIpVK2qPzFbWNBw6VscIZq7CJLU2ckHiqVfLd8okJiUqTIOe6kOxoNN8nY5H5Kfw 52G+ybM+n7O7S0vw6VekNyL4ACY+w6UOxnju6WSSdejEc2RV9S3wiZQ0nGNTYJrqJmDL Zwjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=To4CfQvIneuHVmr5v31WcX2BolhCjKXtnZLHvKS6tu8=; b=neFVrPPUq/Tf5jloY1LS4hP62iIPVYvm88u5Tnuak02m9JmONLWiop817qezkMVOgh JGOSRSeTw/5xoD6FFAoMAbqflq1Hqr1V7PmI9SKNF+AHezwNky/AmnNzOUYcRaHaRMes BvAyD4rmiZ38Z/vrlSUBG1bJj/sTCINfaMQbGZwx2POS/0jVxkokdOpWh4C45RFHDArA 1AGgQhnUfXdokUcjMmVvD8crKwO7kyywYZcGMoLhwsV3ylQJFwMlRqEj+O6317EoLukp aLoQzEMJWIAF+RJUThZ3NNE7pXbPPK8LrkLb1odvSPfdtYv68SiQM9fgVNekaXTWp1MD RdgQ== 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 k136si10153544pga.44.2018.01.30.16.49.07; Tue, 30 Jan 2018 16:49:38 -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 S932158AbeA3Xo6 (ORCPT + 99 others); Tue, 30 Jan 2018 18:44:58 -0500 Received: from mga07.intel.com ([134.134.136.100]:5721 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753751AbeA3Xo0 (ORCPT ); Tue, 30 Jan 2018 18:44:26 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 30 Jan 2018 15:44:26 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,436,1511856000"; d="scan'208";a="30749391" Received: from alexey-system-product-name.iil.intel.com (HELO [10.236.193.125]) ([10.236.193.125]) by orsmga002.jf.intel.com with ESMTP; 30 Jan 2018 15:44:19 -0800 Subject: Re: [PATCH v2] staging: android: ion: Add implementation of dma_buf_vmap and dma_buf_vunmap To: Greg KH Cc: devel@driverdev.osuosl.org, labbott@redhat.com, linux-kernel@vger.kernel.org References: <1517344753-29021-1-git-send-email-alexey.skidanov@intel.com> <20180130221501.GA6717@kroah.com> From: alexey Message-ID: Date: Wed, 31 Jan 2018 01:44:47 +0200 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: <20180130221501.GA6717@kroah.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/31/2018 12:15 AM, Greg KH wrote: > On Tue, Jan 30, 2018 at 10:39:13PM +0200, Alexey Skidanov wrote: >> dma_buf_vmap and dma_buf_vunmap allow drivers to access buffers, created by ion. > But why would anyone ever want to do that? What is wrong with the > existing interfaces that drivers use to access buffers created by ion? Any driver, sharing the buffers, created by ion, through dma-buf, may get back the sgtable describing the buffer for device DMA  and may call dma_buf_vmap to get back the kernel virtual address of the buffer to get access to it. Currently, the second option is missing. Actually, the buffer already mapped by ion implementation. > What code uses this new interface? This is not the new interface. this is the missing implementation of the last two ops: struct dma_buf_ops {   int (* attach) (struct dma_buf *, struct device *, struct dma_buf_attachment *);   void (* detach) (struct dma_buf *, struct dma_buf_attachment *);   struct sg_table * (* map_dma_buf) (struct dma_buf_attachment *, enum dma_data_direction);   void (* unmap_dma_buf) (struct dma_buf_attachment *,struct sg_table *, enum dma_data_direction);   void (* release) (struct dma_buf *);   int (* begin_cpu_access) (struct dma_buf *, enum dma_data_direction);   int (* end_cpu_access) (struct dma_buf *, enum dma_data_direction);   void *(* map_atomic) (struct dma_buf *, unsigned long);   void (* unmap_atomic) (struct dma_buf *, unsigned long, void *);   void *(* map) (struct dma_buf *, unsigned long);   void (* unmap) (struct dma_buf *, unsigned long, void *);   int (* mmap) (struct dma_buf *, struct vm_area_struct *vma);   void *(* vmap) (struct dma_buf *);   void (* vunmap) (struct dma_buf *, void *vaddr); }; > > We need a bit more information please. > > thanks, > > greg k-h Thanks, Alexey