Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp4338214ybx; Mon, 4 Nov 2019 11:39:21 -0800 (PST) X-Google-Smtp-Source: APXvYqxzt69/8eC3NBxFrX4VbT5RE0LaWLuAFJOvAmNUs2UHR5btZc5fLkn3pj3HvVQcFg8cZnXc X-Received: by 2002:a05:6402:205c:: with SMTP id bc28mr14000528edb.124.1572896361589; Mon, 04 Nov 2019 11:39:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572896361; cv=none; d=google.com; s=arc-20160816; b=oOFc5R9GZtlXiqb6MzQC/xd41kooSrd8U4Y9zvP0vwcn4LSAEsHO5fWbBU6CBjQPxq j8toosnMn7A7QiG9Em43p6D3EHyEhjk+6RQMXupCher8eZlPN0YtbO5IwRmJQKAkeTh1 Ebuvc1Uo69UFYwVyXBC0AwjcjRQ9a0uMIKb8bt8dvwjp55wm6JMdmjf4vz7O+p+OVlLD BgrDJeq7asF5TP7Qdmt2mj26BsSir9yaw3C17SypBRctw9xvLjaqdNtGYyOO+eJN7oAR 10O4UAbeDiv5sJ5vr2lLTkhFiKx8pFdBuO7ji4bRjbztndjCF0WMdxro38TikIdsGppI lBEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=eXh+XyYjVt4Pkzk3hYB9YYJ9vT2OyZQipdsfPeD6n3s=; b=vHA+SwHElQpyzitwTGe5c7V+7olttXdB7eN1s4lqKSQF1bOfUnSHCqRgbzr+3cDDNN swFDIZK8/4tZ7AfUXIf9wqlAbfnEgowceSYLvrZR1YCQ2i1rlt6FQ4C1vwveSxRpkdGi 7cQAkQvJJumL6dOCq/xRH2VSw3cvB9aWPXqb+Py0AGkiI6+5RWueKEnENQ9VFgoyjl5g DVSztyr0ONJcnO7PUMBNlleJCHpieLTJj738LxgxRuQ/zJ+InM+wsZbidxmwAzbnKQcJ 9TjFXCg8FcnzaeRDflCjYZel5+8rz7U39c6ZtnoILj+Xn00LVXeyR293mzQm5463A0Zy S7mQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=H1lIoRWj; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b22si3653517ejv.159.2019.11.04.11.38.58; Mon, 04 Nov 2019 11:39:21 -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=@linaro.org header.s=google header.b=H1lIoRWj; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729509AbfKDTg0 (ORCPT + 99 others); Mon, 4 Nov 2019 14:36:26 -0500 Received: from mail-ot1-f65.google.com ([209.85.210.65]:45906 "EHLO mail-ot1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728268AbfKDTgZ (ORCPT ); Mon, 4 Nov 2019 14:36:25 -0500 Received: by mail-ot1-f65.google.com with SMTP id 77so11023527oti.12 for ; Mon, 04 Nov 2019 11:36:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=eXh+XyYjVt4Pkzk3hYB9YYJ9vT2OyZQipdsfPeD6n3s=; b=H1lIoRWjL4OYFkpqlyx8OmO6lY+KBz2M7Mz7iGNOYJa0J54H7QwoSEcuN/GSu+2AH0 dFTzflkEqNe4Rm8kNrdSE2dvUX/YYWqAw89dXD0sp6/NXQYXmKIaLgQQSYw3qeOqTixZ nVjY8fLdmXHWlXOO2x5K7YMNc6hbyXyzdBIGJvWb82qxFUpwtr0H6DjGH3wVsVGCsMJn BXcdZxNaLamch4iTtp5zelRitudQkMU1s5KITIfPtfTbulq9AyOfOxo84ro30uj5vvSp lIf0syfuOUxAlFdvPw2y1mdmxjmSgiQbKY2t/5DRtXsYywV5UNIe8IGJhNhbU/eCulSC qmoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=eXh+XyYjVt4Pkzk3hYB9YYJ9vT2OyZQipdsfPeD6n3s=; b=Yt3XFXXhbXUZmu0l0XYlB/nPQXqpZS+2LGgesxyGYTxf3nu/aTuwwS+yAmtZD+3LbB jb6pbT5tA19vJ1aeBLBnXDpit1QReB5yXHcb8Hzk1wCUggm0MTK3P9QaZtSbc2oT1FoV 7kdNT4qpar/5YqEj3FTQZrYIivJvZIWj8mYh/qH4JPzx0ZEwzY1MuseBSYpRt8DAo8XB yPpsY0pJEEuZdazX0GL2g0y44nhJxImUQNgLr/40dVK/ik+Li6KmYRuF3/9+G8Xib4bY N8JGPrSa1hTIC+WYB8vClqN7exQk4wAq7CL0ovpytwI2t1/g+tw7tEhTEjcc9JrJdgQZ OTvg== X-Gm-Message-State: APjAAAWc0pr5XqcTC/TKIxwkDNLDI2kY+jSjg1oWx/1VkzlZyBU2voE2 +S9JQSuFDSSabLzd5G+vfOlliAoZBMQr2SHfn5wtZg== X-Received: by 2002:a05:6830:ca:: with SMTP id x10mr18725811oto.221.1572896183903; Mon, 04 Nov 2019 11:36:23 -0800 (PST) MIME-Version: 1.0 References: <20191101214238.78015-1-john.stultz@linaro.org> <20191101214238.78015-3-john.stultz@linaro.org> <20191103161348.GB13344@google.com> In-Reply-To: From: John Stultz Date: Mon, 4 Nov 2019 11:36:12 -0800 Message-ID: Subject: Re: [PATCH v14 2/5] dma-buf: heaps: Add heap helpers To: Sandeep Patil Cc: lkml , Laura Abbott , Benjamin Gaignard , Sumit Semwal , Liam Mark , Pratik Patel , Brian Starkey , Vincent Donnefort , Sudipto Paul , Christoph Hellwig , Chenbo Feng , Hridya Valsaraju , Hillf Danton , Dave Airlie , dri-devel , sspatil+mutt@google.com, "Andrew F . Davis" , Alistair Strachan Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 4, 2019 at 11:34 AM John Stultz wrote: > > On Sun, Nov 3, 2019 at 8:13 AM wrote: > > On Fri, Nov 01, 2019 at 09:42:35PM +0000, John Stultz wrote: > > > Add generic helper dmabuf ops for dma heaps, so we can reduce > > > the amount of duplicative code for the exported dmabufs. > > > > > > This code is an evolution of the Android ION implementation, so > > > thanks to its original authors and maintainters: > > > Rebecca Schultz Zavin, Colin Cross, Laura Abbott, and others! > > > > > > Cc: Laura Abbott > > > Cc: Benjamin Gaignard > > > Cc: Sumit Semwal > > > Cc: Liam Mark > > > Cc: Pratik Patel > > > Cc: Brian Starkey > > > Cc: Vincent Donnefort > > > Cc: Sudipto Paul > > > Cc: Andrew F. Davis > > > Cc: Christoph Hellwig > > > Cc: Chenbo Feng > > > Cc: Alistair Strachan > > > Cc: Hridya Valsaraju > > > Cc: Sandeep Patil > > > Cc: Hillf Danton > > > Cc: Dave Airlie > > > Cc: dri-devel@lists.freedesktop.org > > > Reviewed-by: Benjamin Gaignard > > > Reviewed-by: Brian Starkey > > > Acked-by: Laura Abbott > > > Tested-by: Ayan Kumar Halder > > > Signed-off-by: John Stultz > > > > I have one question and a naming suggestin below (sorry). > > > > Acked-by: Sandeep Patil > > > > + > > > +static void dma_heap_buffer_vmap_put(struct heap_helper_buffer *buffer) > > > +{ > > > + if (!--buffer->vmap_cnt) { > > > > nit: just checking here cause I don't know the order in which vmap_get() and > > vmap_put() is expected to be called from dmabuf, the manual refcounting > > based map/unmap is ok? > > > > I know ion had this for a while and it worked fine over the years, but I > > don't know if anybody saw any issues with it. Sorry, I hit send before replying to this bit. I'll double check on this. thanks again for the review! -john