Received: by 10.223.176.5 with SMTP id f5csp1384642wra; Wed, 31 Jan 2018 05:45:45 -0800 (PST) X-Google-Smtp-Source: AH8x225BgykdR23D+28ErudSwiAz/bdTqmqGP/uiAfMOY+02JRCwwZqdQrWAnVnt7m1KjXYNmm6L X-Received: by 2002:a17:902:b406:: with SMTP id x6-v6mr19571993plr.150.1517406345169; Wed, 31 Jan 2018 05:45:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517406345; cv=none; d=google.com; s=arc-20160816; b=QkkAKPabLNANvwdRRB0IdBrW4TUcBLgsvz0eW2ICWAU7npVqE9Wwr8BNcTEoi/mhh0 SWX1DDrCe7WC1YAeRg7pWokTWERGXGwwukFzDCHh6+7QNv+Nz+0j2OANkP6iqTC1ighP guWyi2vOaAv4tG+NgGUtHRnxn6cPJvmRXZYJd/unwZkk5ySxZE5OZpmnju6bV12EB6uV 2yMoy3XCsuI2QbF2auzRwXkuNZ1bXK+kcD54YUiMYYZus5zbYbYyrVFanUUMwF7YdBlw /DqfHFItWOVcYaE5L139qXO1g0/dS7oa6hSVsxl38yGE4VKiE0OANQLS8dxgMscvFFZM 5Q6Q== 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-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=tCUcKk86Z5g89snNMl0fNZm8CPK5mpsXZ/h8F7dpXyo=; b=ueQ+BIJ8IMVXt+41n64UJttJYtdUSnUpYxT26FNHIMP5PuDIr925qsc39cMBAfKv3D qx0uGk80CWwnpuhAeffn4Do5JqBOYLk2SeF7G3Yz8qv6NnYGlyiE6k7Y2UqaRJb7jqYm 4TEAXk//eTrW9OUdxqc6xJlBQoIs9SOb8itAscqOeLK/vRimjmG6tLF3qnZJky2TsZtF DM0eblt0Gd2CJixE/a6p7ZrFJ5Iw9roz6d0m7SkIP7DUvod6t+LY/8WYMK1rQoxHwn7T +UhM231wpf/0Y0RjAI/YyrOZY7vGfS/AN0G0J3A4ot2BUIkYRWybB/h0E4h7gYAMXd9c 9m9w== 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 76si3785552pga.176.2018.01.31.05.45.30; Wed, 31 Jan 2018 05:45:45 -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 S1753113AbeAaNAv (ORCPT + 99 others); Wed, 31 Jan 2018 08:00:51 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:47728 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751408AbeAaNAu (ORCPT ); Wed, 31 Jan 2018 08:00:50 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 77E8FE16; Wed, 31 Jan 2018 13:00:49 +0000 (UTC) Date: Wed, 31 Jan 2018 14:00:47 +0100 From: Greg KH To: Alexey Skidanov Cc: devel@driverdev.osuosl.org, labbott@redhat.com, tkjos@android.com, rve@android.com, linux-kernel@vger.kernel.org, maco@android.com, sumit.semwal@linaro.org Subject: Re: [PATCH v3] staging: android: ion: Add implementation of dma_buf_vmap and dma_buf_vunmap Message-ID: <20180131130047.GA22917@kroah.com> References: <1517400222-2854-1-git-send-email-alexey.skidanov@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1517400222-2854-1-git-send-email-alexey.skidanov@intel.com> User-Agent: Mutt/1.9.3 (2018-01-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 31, 2018 at 02:03:42PM +0200, Alexey Skidanov wrote: > Any driver may access shared buffers, created by ion, using dma_buf_vmap and > dma_buf_vunmap dma-buf API that maps/unmaps previosuly allocated buffers into > the kernel virtual address space. The implementation of these API is missing in > the current ion implementation. > > Signed-off-by: Alexey Skidanov > --- No review from any other Intel developers? :( Anyway, what in-tree driver needs access to these functions? And are you sure that you don't need to do any "real" logic in the vmap/vunmap calls? That feels like there would be some reference counting problems here. > drivers/staging/android/ion/ion.c | 13 +++++++++++++ > 1 file changed, 13 insertions(+) > > diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c > index f480885..4f1dc7f 100644 > --- a/drivers/staging/android/ion/ion.c > +++ b/drivers/staging/android/ion/ion.c > @@ -327,6 +327,17 @@ static void ion_dma_buf_kunmap(struct dma_buf *dmabuf, unsigned long offset, > { > } > > +static void *ion_dma_buf_vmap(struct dma_buf *dmabuf) > +{ > + struct ion_buffer *buffer = dmabuf->priv; > + > + return buffer->vaddr; Just call ion_dma_buf_kmap(dmabuf, 0)? Again, please get this reviewed by someone else in Intel first. Don't ignore the resources you have, to do so would be foolish :) thanks, greg k-h