Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp754864ybk; Wed, 20 May 2020 11:07:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxrwE5+fbcNL4LRAc91snKJzTIbEOLb1YVDWDHmXM/RLpZhI7OqRC+amuDFxBBneoBbPeQP X-Received: by 2002:a17:906:6bc5:: with SMTP id t5mr221316ejs.459.1589998050886; Wed, 20 May 2020 11:07:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589998050; cv=none; d=google.com; s=arc-20160816; b=JxDg+fbwjcETdFnjtoazJQUvS4mhY1cg8ZcuGQSWjkVWVURPtPE32G9LMvCYUxOyub nwZCzlJ52orT6OjMY1ZX5xV42syv3XLV4dhc2LTJIhjBPmD6Y3QtnQCnJcNxE7J5EAjZ uNStzqt/NGjk8porbVFX68C7cACdQDq112yH2RRNtEPyIPwWS7uPUpbhK/p4e3x/THqy wL6lRT0ZEGyG2uZp8huoCr8V4SQPBK4dhX0jh0q2Ut+bHa4RdNrmlYVbUu3UFj+pBcGx TLS1paILb0NW9GQMmrQz0H02HBMzoBhQkjiW8SXIyLxfr7dMaJHxwQmiJkLYYcc6Efni SY8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:mail-followup-to:message-id:subject:cc:to :from:date:dkim-signature; bh=7VLWQjSGehoQQ10TIMLPZjQP7xmwIhJsBUGDoa1VrTI=; b=OvKueb3656en4shQk8SYjrpFgSkTZ6KRTpqwhUg9Q6VaHXjcgHq7TREsEMrA/3xIYV /MiMzeKlFkUDsE1ySp8UWBomnNjClySoUWBh2CgC7tn3wbrTimUMjuwmesaBA7l+P3ct Kl3RQBiv1c8XJZRC3LUEJKEKF5sWT4ZEyJuswPcuwLch/xrQI8oYy5MdPr6WTE6cKYuF V+PfNoLQyU12/J5+WmDKZm1H96n7MjxOHZNDr2wkdhSF2mJ4BNZYedcSWS0EogoFNT5P ZqOvQOjMPlMZdOt2/AGnIAxVEJjU9DRaFVlDQKSGzqr9XDHfaRCVOIb4xJNMeWvH9O3A iiBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b="Gkqd7eG/"; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gu17si2169434ejb.26.2020.05.20.11.07.04; Wed, 20 May 2020 11:07:30 -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=@ffwll.ch header.s=google header.b="Gkqd7eG/"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726775AbgETSFB (ORCPT + 99 others); Wed, 20 May 2020 14:05:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33628 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726560AbgETSFA (ORCPT ); Wed, 20 May 2020 14:05:00 -0400 Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9BD1CC061A0F for ; Wed, 20 May 2020 11:05:00 -0700 (PDT) Received: by mail-wr1-x443.google.com with SMTP id v12so4056210wrp.12 for ; Wed, 20 May 2020 11:05:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to; bh=7VLWQjSGehoQQ10TIMLPZjQP7xmwIhJsBUGDoa1VrTI=; b=Gkqd7eG/0dnXjHy1xG1j6m7TgceuOsXw1H/rc22l7IJlPhwJ2B6P2ljAHXrYzTRdar MIaXDobt3I0ohzfnM8+IrTc0qKhgEUwuY7/Fo9s2GXiixg4EmEP6C4/NiXdh9NUFhFJv EkITnRLky4apVZDMRRGPfnmoIfrxMMPEjnOeE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to; bh=7VLWQjSGehoQQ10TIMLPZjQP7xmwIhJsBUGDoa1VrTI=; b=FXxOqgDpLPx4Qs3zL6Dq9GzKSTTal1Uf68bHdBIJrDX7GQpGcc/2YKFPJyi+7BLMnf xUKPrCFfz3NiFPomRzvQFqTb3bSkrn15nIc/lTYjAq2nAK/4Xgc5CoMq2nYG2UYwicZN BxONTp/VuZI3Z9B80kztr/eNCpdGo+KSh3LSnNnod5L0RdTg4F465DNbTVv2eCaoOocg MfysRodoDh+aYuR59KmNDA2AsvRj0pecDLi7ttbt3zXdo+5aQn9SloH+YZEpGESOga3Z K5GhhLePWKkcDyuPUTcsUOS3kMEvPZXUgmv9ccBQlemiZIH8vAsgASdpVN0+7kzclDEu 0t1g== X-Gm-Message-State: AOAM531JkkDgDxsMS9bT+RLIQTJDJG0R4lAh8ycUL9LZ3q67fEoMOlCY vRrH7QpaiVGCrs7KjOdHalBTZPutXDM= X-Received: by 2002:adf:ec87:: with SMTP id z7mr5634315wrn.149.1589997899278; Wed, 20 May 2020 11:04:59 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id b12sm4040708wmj.0.2020.05.20.11.04.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 May 2020 11:04:58 -0700 (PDT) Date: Wed, 20 May 2020 20:04:56 +0200 From: Daniel Vetter To: Oded Gabbay Cc: Daniel Vetter , 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 Subject: Re: [Intel-gfx] [PATCH 3/3] misc/habalabs: don't set default fence_ops->wait Message-ID: <20200520180456.GC206103@phenom.ffwll.local> Mail-Followup-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 References: <20200511091142.208787-1-daniel.vetter@ffwll.ch> <20200511091142.208787-3-daniel.vetter@ffwll.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Operating-System: Linux phenom 5.6.0-1-amd64 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? Thanks, Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch