Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1531892ybh; Mon, 13 Jul 2020 23:41:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz4Legi7T7HRIK6/X1WaUfryvUkQtLSfGoRsVT05sAaZ0gsMPZ/kKPuLP/sGJ9tihq3ckAu X-Received: by 2002:a05:6402:3099:: with SMTP id de25mr3042940edb.228.1594708884297; Mon, 13 Jul 2020 23:41:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594708884; cv=none; d=google.com; s=arc-20160816; b=Mq/EEGbOBh/HL0BFCPlMz98uJkfY3SwVBV+GM5Gfu+9zeGn1ESRe4p8/axss+AUVqi Ni4F7C1346EzvzGAoYceAt7tHIjXz+4+Tpfci7Aorxr4iZVMdUCfvZBfTrnMgHfx8BNT KAXgvkq4yQFquN30EHwzHyzKTzvC5v6swTtM1wSnKjZ1kyeDsR7Fbymc0vfO2+h0JU8z 28JJNWK9mwj/tc6M/lPETFhySxoO/jQuK11TS1rJfs4VWxyA/dXcVAdPcWHIve5bm0We cg4pxkn5YgmSd8SDIDOHPix7wMnM8rfFEFh0IgI3aXH784FFmY5/9c8gLKJViIDUVgyL 2fcQ== 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:message-id:subject:cc:to:from:date :dkim-signature; bh=3sMJpleDMUCObTGMrid6dKp0vFVBqeRTLhIz5qD9PCk=; b=Ssq2+W37pFs9FJCuwy1306GTh+yVfxMkS6hXBEN/oJY0c9Di674zm1X1qySefqb69X UQhuFlsBkrD68jkWmyaDd+L3zpSogcBta2B2buRfKOPbkIuqNv0NNSBtq3hSYzMUKDyD xqFlRobTvrsmuKgGPdKuv2qRYOAWIAkNgyN5vBeY3BkgBHiz/ws2N2OA08ASOMfHFrGi RVuC3x3dHOP6s5g30mjGOwT2uv3I3L53DrU3tK6k1z6Jh6woH7sAey/bXCS/xmFelPll vylx7FINadmrrcztDVEq5EiH8yk5m+hgNwhQCYSiOT5L744LtNlWQFQQV/3CBV87IbjU 4B7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=QAGH2SsO; 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 gh12si151408ejb.580.2020.07.13.23.41.01; Mon, 13 Jul 2020 23:41:24 -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=@kernel.org header.s=default header.b=QAGH2SsO; 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 S1726963AbgGNGgv (ORCPT + 99 others); Tue, 14 Jul 2020 02:36:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:36060 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726944AbgGNGgu (ORCPT ); Tue, 14 Jul 2020 02:36:50 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id CD88C221F0; Tue, 14 Jul 2020 06:36:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1594708610; bh=mR/muK3gdKl9gsxO9Ci2KinZJohaF23cu0yq+FvLps0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=QAGH2SsOp/wFpBaV7D0dkvxmQA+0u7tS7NYE4A6jWdYh/p13Ht338I1SFAboXcqe/ vsGSGVN91qmcBV/hiOuKpBuuPpSxD6A6fWLT48kOED/mMN8oH2vlDKJGU3K2SI6Sud KgcBhiqEujq56Cg1AjdhZvAhqXkEegdVLpA1Bs5A= Date: Tue, 14 Jul 2020 08:36:48 +0200 From: Greg Kroah-Hartman To: Daniel Vetter Cc: Jason Gunthorpe , Oded Gabbay , Linux Kernel Mailing List , SW_Drivers@habana.ai, Ofir Bitton Subject: Re: [PATCH 1/3] habanalabs: implement dma-fence mechanism Message-ID: <20200714063648.GC662760@kroah.com> References: <20200713155424.24721-1-oded.gabbay@gmail.com> <20200713155752.GC267581@kroah.com> <20200713190357.GC25301@ziepe.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 13, 2020 at 09:08:55PM +0200, Daniel Vetter wrote: > On Mon, Jul 13, 2020 at 9:03 PM Jason Gunthorpe wrote: > > > > On Mon, Jul 13, 2020 at 08:34:12PM +0200, Daniel Vetter wrote: > > > On Mon, Jul 13, 2020 at 5:57 PM Greg Kroah-Hartman > > > wrote: > > > > > > > > On Mon, Jul 13, 2020 at 06:54:22PM +0300, Oded Gabbay wrote: > > > > > From: Ofir Bitton > > > > > > > > > > Instead of using standard dma-fence mechanism designed for GPU's, we > > > > > introduce our own implementation based on the former one. This > > > > > implementation is much more sparse than the original, contains only > > > > > mandatory functionality required by the driver. > > > > > > > > Sad you can't use the in-kernel code for this, I really don't understand > > > > what's wrong with using it as-is. > > > > > > > > Daniel, why do we need/want duplicate code floating around in the tree > > > > like this? > > > > > > The rules around dma-fence are ridiculously strict, and it only makes > > > sense to inflict that upon you if you actually want to participate in > > > the cross driver uapi built up around dma-buf and dma-fence. > > > > > > I've recently started some lockdep annotations to better enforce these > > > rules (and document them), and it's finding tons of subtle bugs even > > > in drivers/gpu (and I only just started with annotating drivers: > > > > > > https://lore.kernel.org/dri-devel/20200707201229.472834-1-daniel.vetter@ffwll.ch/ > > > > > > You really don't want to deal with this if you don't have to. If > > > drivers/gpu folks (who created this) aren't good enough to understand > > > it, maybe it's not a good idea to sprinkle this all over the tree. And > > > fundamentally all this is is a slightly fancier struct completion. Use > > > that one instead, or a wait_queue. > > > > > > I discussed this a bit with Oded, and he thinks it's easier to > > > copypaste and simplify, but given that all other drivers seem to get > > > by perfectly well with completion or wait_queue, I'm not sure that's a > > > solid case. > > > > > > Also adding Jason Gunthorpe, who very much suggested this should be > > > limited to dma-buf/gpu related usage only. > > > > Without all the cross-driver stuff dma_fence is just a > > completion. Using dma_fence to get a completion is big abuse of what > > it is intended for. > > > > I think the only problem with this patch is that it keeps too much of > > the dma_fence stuff around. From what I could tell it really just > > wants to add a kref and completion to struct hl_cs_compl and delete > > everything to do with dma_fence. > > Yeah, that's what I recommended doing too. error flag might be needed > too I think, but that's it. Ok, so this should be made much simpler and not use this copy/paste code at all. I can accept that :) Ofir, care to redo this? thanks, greg k-h