Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp758127ybk; Wed, 20 May 2020 11:12:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzzRstFwy/tvdxuQF5YQcrFCwEkyaDV1LQ8IyDIC0uWRWdkVWIpq2qc35QM8r2CC5B+8P6U X-Received: by 2002:a17:906:6043:: with SMTP id p3mr279562ejj.29.1589998336158; Wed, 20 May 2020 11:12:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589998336; cv=none; d=google.com; s=arc-20160816; b=ADX6gDW4wymIkluLtxbGraoAmW/RxV3BPObpKRvKzV6gcBwyOIehiSCk8CA17gcisc x0e3G+zeXcAx2X117gRmkdC54nW8kZd+KidSDStsufeIbVKKrzgt342RID74jr7DYL6z fyqaUp4ZdLa68AuZ1RJvE4vT0nQBvdXw6DryFQ4vWXrtXhoBOjz3W/0QuYzLniFMsYwv m1Yh4cP2v7xgA7IlgPZJ419K9lFinuqx1Fw7um7ycHWqDL6rp0FLh0PRsHjvwW+Poa35 6324AKJqNnXpBzQ7sQjCw4h+8F0tc16nbTQAC4oZ1vvhqKcC3p4a3mN893PCztqxL3WY r9Ww== 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=tx9re6lXGFdfxVUAVwva8EahuEz3Z+j2jfuKERIypGA=; b=epJLRc8pNMQ6uv2RqKtM65E0xaiAg3+49EXBFWNI82goSRpJ9j3BGqKpr+e1vn8L1z 4A7dReKY6ERiS8qp9+i4jLOqEZypjEOFKE/ZdjinM4h0OHSrxGYmC8kuOLOkNkeUe0i/ G46OLZ+nGlOZLzge0uhD9rYnAr7J02tMsOcAd6TAdQTo6p6Hazbw6RUwr7ZYiHsGHoo6 FoTtRHCgFUtlZ0T5C8owY1fmV+HOD6c0GH0h1slfypxi04odr+4kAowXfG0LzAk73VQA IgnKS4fYxiPe7dnJjIcuuHYdYR+OzVJAG4bLGTAgOgc8/q+j1GhZfIudpuoqUiEqjmKy 3lSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="dZP/+Ezy"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id k5si1989777edx.416.2020.05.20.11.11.52; Wed, 20 May 2020 11:12:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="dZP/+Ezy"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1726850AbgETSKN (ORCPT + 99 others); Wed, 20 May 2020 14:10:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34436 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726548AbgETSKN (ORCPT ); Wed, 20 May 2020 14:10:13 -0400 Received: from mail-ot1-x343.google.com (mail-ot1-x343.google.com [IPv6:2607:f8b0:4864:20::343]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 03FA7C061A0E; Wed, 20 May 2020 11:10:13 -0700 (PDT) Received: by mail-ot1-x343.google.com with SMTP id d26so3252293otc.7; Wed, 20 May 2020 11:10:12 -0700 (PDT) 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=tx9re6lXGFdfxVUAVwva8EahuEz3Z+j2jfuKERIypGA=; b=dZP/+Ezyao2q+g8UeMH7UCWOKPM2rUJz762yFGC8HBceR93568dZwtO5olvMji49Kw hEFJyjeG4dsi9+JmPSTjCeXXKuiqj0hGeAE1EhgcsbqTtFzlb2YXv/Kpftg/fF1kcRi3 rEYiIiO6n0Hjllej82qDcasPEHahE1iPUkKzmdTzhZsddaMzMVqJp/jUsszHB4I9K4wM TnqWaN21p2xUge4/Ie4sNg6PVHtDFnBcO1bVtsdn30YyGe2g5q1Ph5HD0mi3FNrqcHct iwweP+6OfIZsahDggQGT/c92eZhpe1SDn/glDgk9w2BziuLYJPYzqcV2oh2ADOUoUSdZ Izvg== 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=tx9re6lXGFdfxVUAVwva8EahuEz3Z+j2jfuKERIypGA=; b=eiTJO2PYyn3Pzzp0NLVMs55dIZfXo91XE/yfmQ6b7GZAJwkDnQQWNb0TMRhFSmpFqd bEshR7i2yq7dcrFs1drWdhXY1ztLbGCiv8iT95PON2RplrZMbSKj4k3xZBnl6IJfKgeG aRNjYzQE43DC4XdGA0RPdSkCbBHi1WiS+B26NV9EqhKI1hCNXAzYlpkalgyJHMYDiX6h l4pFtUf1mcJj2vOwx2X1/2+afAu0qVSRFoLl3WN8GWMulMorPxwm74wbAdAfgpj8SS81 nrUt9W7ZaMOrXx7/bJKh4AyVpc1Snea2Brq1JOA3xLzJdtdA7ilVqumrNoH+CX2x3vbA r4Jw== X-Gm-Message-State: AOAM532/7dLpqQNMOJPxzFhr4Ov/PMdSdXIGkXvMv5HfaQ/6lq6u1R5J 5vVVqwLtf72yol/h1hrmVBqG2aEXcNFox/GrgoY= X-Received: by 2002:a4a:88e4:: with SMTP id q33mr4005168ooh.27.1589998212250; Wed, 20 May 2020 11:10:12 -0700 (PDT) MIME-Version: 1.0 References: <20200511091142.208787-1-daniel.vetter@ffwll.ch> <20200511091142.208787-3-daniel.vetter@ffwll.ch> <20200520180456.GC206103@phenom.ffwll.local> In-Reply-To: <20200520180456.GC206103@phenom.ffwll.local> From: Oded Gabbay Date: Wed, 20 May 2020 21:09:42 +0300 Message-ID: Subject: Re: [Intel-gfx] [PATCH 3/3] misc/habalabs: don't set default fence_ops->wait To: Oded Gabbay , Dave Airlie , Greg Kroah-Hartman , Intel Graphics Development , LKML , DRI Development , "moderated list:DMA BUFFER SHARING FRAMEWORK" , Olof Johansson , Daniel Vetter , Sumit Semwal , Linux Media Mailing List Cc: Daniel Vetter 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 Wed, May 20, 2020 at 9:05 PM Daniel Vetter wrote: > > On Thu, May 14, 2020 at 02:38:38PM +0300, Oded Gabbay wrote: > > On Tue, May 12, 2020 at 9:12 AM Daniel Vetter wrote: > > > > > > On Tue, May 12, 2020 at 4:14 AM Dave Airlie wrote: > > > > > > > > On Mon, 11 May 2020 at 19:37, Oded Gabbay wrote: > > > > > > > > > > On Mon, May 11, 2020 at 12:11 PM Daniel Vetter wrote: > > > > > > > > > > > > It's the default. > > > > > Thanks for catching that. > > > > > > > > > > > > > > > > > Also so much for "we're not going to tell the graphics people how to > > > > > > review their code", dma_fence is a pretty core piece of gpu driver > > > > > > infrastructure. And it's very much uapi relevant, including piles of > > > > > > corresponding userspace protocols and libraries for how to pass these > > > > > > around. > > > > > > > > > > > > Would be great if habanalabs would not use this (from a quick look > > > > > > it's not needed at all), since open source the userspace and playing > > > > > > by the usual rules isn't on the table. If that's not possible (because > > > > > > it's actually using the uapi part of dma_fence to interact with gpu > > > > > > drivers) then we have exactly what everyone promised we'd want to > > > > > > avoid. > > > > > > > > > > We don't use the uapi parts, we currently only using the fencing and > > > > > signaling ability of this module inside our kernel code. But maybe I > > > > > didn't understand what you request. You want us *not* to use this > > > > > well-written piece of kernel code because it is only used by graphics > > > > > drivers ? > > > > > I'm sorry but I don't get this argument, if this is indeed what you meant. > > > > > > > > We would rather drivers using a feature that has requirements on > > > > correct userspace implementations of the feature have a userspace that > > > > is open source and auditable. > > > > > > > > Fencing is tricky, cross-device fencing is really tricky, and having > > > > the ability for a closed userspace component to mess up other people's > > > > drivers, think i915 shared with closed habana userspace and shared > > > > fences, decreases ability to debug things. > > > > > > > > Ideally we wouldn't offer users known untested/broken scenarios, so > > > > yes we'd prefer that drivers that intend to expose a userspace fencing > > > > api around dma-fence would adhere to the rules of the gpu drivers. > > > > > > > > I'm not say you have to drop using dma-fence, but if you move towards > > > > cross-device stuff I believe other drivers would be correct in > > > > refusing to interact with fences from here. > > > > > > The flip side is if you only used dma-fence.c "because it's there", > > > and not because it comes with an uapi attached and a cross-driver > > > kernel internal contract for how to interact with gpu drivers, then > > > there's really not much point in using it. It's a custom-rolled > > > wait_queue/event thing, that's all. Without the gpu uapi and gpu > > > cross-driver contract it would be much cleaner to just use wait_queue > > > directly, and that's a construct all kernel developers understand, not > > > just gpu folks. From a quick look at least habanalabs doesn't use any > > > of these uapi/cross-driver/gpu bits. > > > -Daniel > > > > Hi Daniel, > > I want to say explicitly that we don't use the dma-buf uapi parts, nor > > we intend to use them to communicate with any GPU device. We only use > > it as simple completion mechanism as it was convenient to use. > > I do understand I can exchange that mechanism with a simpler one, and > > I will add an internal task to do it (albeit not in a very high > > priority) and upstream it, its just that it is part of our data path > > so we need to thoroughly validate it first. > > Sounds good. > > Wrt merging this patch here, can you include that in one of your next > pulls? Or should I toss it entirely, waiting for you to remove dma_fence > outright? I'll include it in the next pull. Thanks, Oded > > Thanks, Daniel > -- > Daniel Vetter > Software Engineer, Intel Corporation > http://blog.ffwll.ch