Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp4173973ybx; Mon, 4 Nov 2019 08:59:38 -0800 (PST) X-Google-Smtp-Source: APXvYqzgDIe5SeXOGf5i8J6wkh2wZFyQxkeys7Cxjsghzxx0HNsRpQTbMGdG8oTxiqprMn2uvVki X-Received: by 2002:a50:9fc1:: with SMTP id c59mr31020078edf.305.1572886778395; Mon, 04 Nov 2019 08:59:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572886778; cv=none; d=google.com; s=arc-20160816; b=KnhYypAsnl3OyU5EYxvj2+6LMu2AvgrQvXJIIq69luuwJ3nEJP/TxBz2VL7cnL96gt P2hccG0I+VkS+iBArpLBmWjFwryyh3Flxb7pnY6DDA5jNBoKmEvJSr4Gv/Oo8w6FBA/Q DvhfXf73FcHnGVO4gxwqrEvnWRPhoeSxU87sVT9oeo80htkf7p7ATlWNOO9tUPPmqtM7 pMPKuffdiW3ylLWmbDbTH60vP7295ejNgrKhUIXnU3UUvpdrNbStrEHtpx2WVTPlsMfd VRLH8HtlGTSFbKJgYrIQngpcecWUGJ0ZXR9kj8R4Be0fwr1XsRf7Y7sM815QPCYtPAIn iIEg== 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=SGFVtZgIuY0pmc+VyfR5bHjFuWMXBLC+PFqq5aHuIEo=; b=mFU+pnZY3AH+8wYvMmlO2kk1arGfmmVYQTAHlXt+iU0iWUmj+cWlJwlLEblAFjE5Re OcerPsFyvZt1m1LyJxkxzqJIjsfl+Ap5U5M6temc3qmPxUyIMQinPhrlkf49OSybiHbd LEvhaLfKkcfcJJK7BofSRVbUAfH2ps8/2xCXVdMTwWZfB1iNOJM7vq//8A/O3x69AoUl 6yP6wUiG7iZ6PdNUNA/SY9qhvx3ELhul7v7ZY7SRbiXoC9XxTzFCPZ5VxHlA89zgxFpC fjnBx+xwMFA7d6u9gj4SbKXq7W9ORRTVRG81QRrtUiPsLnZjS+wBTXVfmNmIT4EcnjPN Vf3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=MxVs+IVX; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h37si7388784eda.249.2019.11.04.08.59.15; Mon, 04 Nov 2019 08:59: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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=MxVs+IVX; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728568AbfKDQ6d (ORCPT + 99 others); Mon, 4 Nov 2019 11:58:33 -0500 Received: from mail-lj1-f193.google.com ([209.85.208.193]:43488 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727861AbfKDQ6d (ORCPT ); Mon, 4 Nov 2019 11:58:33 -0500 Received: by mail-lj1-f193.google.com with SMTP id y23so7532018ljh.10 for ; Mon, 04 Nov 2019 08:58:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=SGFVtZgIuY0pmc+VyfR5bHjFuWMXBLC+PFqq5aHuIEo=; b=MxVs+IVXrO3laQhAsQiIIR5WTvzPZ/rDSAwIl8d3hD2isSoElvZb1eeIAUvCWShIGj AL4ZMlA0W548j6VmQp2kjBSfhpSGjPyht0wnnlh12bsw9+yQuPVnVJu2RUMBwMhMVy5g hf3tnhDhBsDGNej/dktnaLY/GEIKkwZDDnSwbI07qNU8QmHXmzL0m9QWkz5rihTll3OO dWrkOIV4xzOE4za+k3VjKwpvasbbbT2u9vjClU1SCfeqC6mEFeaOSPTEGV+OY7x81Kmm GQax7S04EG6zifGn7gE9BzmG99WYZsN0ZGnuxGgM8WhpeBE1fPVStd0rgl+YM8Y7CZGE vjpg== 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=SGFVtZgIuY0pmc+VyfR5bHjFuWMXBLC+PFqq5aHuIEo=; b=HJiF8Z1aBTzEEtM2Uil/g/jGXhaU5S7HbwHP+UYLU9/TNx8kLwR81xo9C8UhtthFXc BmIIfb249YvcRExKdim7qDyOeQ6bsbEs9ku6FQ4gNpSVPf3QgAMrdQCt8FmsNL2VSwyR 4gklBeLBfsgtSyPanAJyWKj5fDdgHNX0SRs9DRpA6PPAKsxcLUUka/Y2gxQmlwNhfiKi ELPm1qj82KCl44ltkBhfib2Ash3E0nWN4H/FTK8+ikdM33aokle/DOY0TA3JWZJmncoL lOhew5JJ0XKaxCgMQfEaN4Ph5J+X7vBV8x5XPRSF7DWnCWcNDtxLdqTlQofFGlOU0f0D 442Q== X-Gm-Message-State: APjAAAVlnCkAvwV42qhDRnIMXsaDXzMyrHJmley5K07FoigWGGnKelKT q5pBH4vq2npuSA52o3DiOSqlatMrL+mYBOuEkxw= X-Received: by 2002:a2e:7c12:: with SMTP id x18mr10417952ljc.130.1572886709180; Mon, 04 Nov 2019 08:58:29 -0800 (PST) MIME-Version: 1.0 References: <20191101214238.78015-1-john.stultz@linaro.org> <20191101214238.78015-2-john.stultz@linaro.org> <20191104102410.66wlyoln5ahlgkem@DESKTOP-E1NTVVP.localdomain> In-Reply-To: <20191104102410.66wlyoln5ahlgkem@DESKTOP-E1NTVVP.localdomain> From: Dave Airlie Date: Tue, 5 Nov 2019 02:58:17 +1000 Message-ID: Subject: Re: [PATCH v14 1/5] dma-buf: Add dma-buf heaps framework To: Brian Starkey Cc: John Stultz , lkml , "Andrew F. Davis" , Laura Abbott , Benjamin Gaignard , Sumit Semwal , Liam Mark , Pratik Patel , Vincent Donnefort , Sudipto Paul , Christoph Hellwig , Chenbo Feng , Alistair Strachan , Hridya Valsaraju , Sandeep Patil , Hillf Danton , "dri-devel@lists.freedesktop.org" , nd 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, 4 Nov 2019 at 20:24, Brian Starkey wrote: > > Hi John, > > On Fri, Nov 01, 2019 at 09:42:34PM +0000, John Stultz wrote: > > From: "Andrew F. Davis" > > > > This framework allows a unified userspace interface for dma-buf > > exporters, allowing userland to allocate specific types of memory > > for use in dma-buf sharing. > > > > Each heap is given its own device node, which a user can allocate > > a dma-buf fd from using the DMA_HEAP_IOC_ALLOC. > > > > Additionally should the interface grow in the future, we have a > > DMA_HEAP_IOC_GET_FEATURES ioctl which can return future feature > > flags. > > The userspace patch doesn't use this - and there's no indication of > what it's intended to allow in the future. I missed the discussion > about it, do you have a link? > > I thought the preferred approach was to add the new ioctl only when we > need it, and new userspace on old kernels will get "ENOSYS" to know > that the kernel doesn't support it. This works once, expand the interface 3 or 4 times with no features ioctl, and you start being hostile to userspace, which feature does ENOSYS mean isn't supported etc. Next userspace starts to rely on kernel version, but then someone backports a feature, down the rabbit hole we go. Be nice to userspace give them a features ioctl they can use to figure out in advance which of the 4 uapis the kernel supports. Dave.