Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1083145ybh; Mon, 13 Jul 2020 08:58:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxqxr9q6vEZddiNWz6tA9v8OeBdMBUQvqGEfc3A+ZPAMjuDJtDMUT6ur3cqMGTwO9ZBfsd1 X-Received: by 2002:a17:906:a1c7:: with SMTP id bx7mr411466ejb.388.1594655906750; Mon, 13 Jul 2020 08:58:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594655906; cv=none; d=google.com; s=arc-20160816; b=LRP0AMfZJnnEosCENt0Xsy9G+TRFcuDgZFTcjjfcPnlYYGKSlAvWrmdhpsGJN0otWb B2A9HrmSGy/xK0tJUm/Tf7hS8k8bI/cxGoTrLmeunALE2GUeTy+PsEM/gJSa/gnhx2cm hr8eQAuAvwzCulldLNFhhdvVu6tEGm3vbKlW7piF6FyAyg5kYzhnWDnVvlOaO34xejTL X67BAavRFfLuN6Y6d2YU8diJ55fIJs7cM8kjmKJGJIQFCecbwtzwNnkwU+CTiRZgd4D5 etWi1fGCGND4yk15SQSxkvu52cI2uLOQ5mrtWtoP9xZ/NJ1zEy8q3kJJYQT1+6IH4QZP aSqg== 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=mOVJe2meeA4PdBJ9YVNsqp4g7vqcD5ylwpg67S/PY08=; b=EDvgCAV9r2Lbf0DFpaTXzltPWKRDGce4jKT101vQNyP6X4Z0ws7zIIyXSjk6mTsXDh laAL0WLF4ySgXO1zE/azWyV+aZc6rYMzkFWIHV805VX0/ZHIX/ILX8Z40c1L1ebkA+wt HZXD9Kw9V1iNdvHLzukL0toE3IFvfOPTgLhNowpmhNIhzQcdMwNUiIodMys3vP/E3l1N 1dmmsByQ1WhXAo/NnqCedrfLZNxjeH8U+pt+NPwNK2KNGJnLSFGIHlXUPGjsX40VJBgZ UEugCDUDKZRd3TPBsdM4zyDGToNQW+KCh/3MyB24h0Gf1riNBcujjT8VVPhpfU1L31i/ GoIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=EJ1fJ3vu; 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 z14si8863033eji.192.2020.07.13.08.58.02; Mon, 13 Jul 2020 08:58:26 -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=EJ1fJ3vu; 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 S1730092AbgGMP5x (ORCPT + 99 others); Mon, 13 Jul 2020 11:57:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:47406 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729027AbgGMP5x (ORCPT ); Mon, 13 Jul 2020 11:57:53 -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 D55FE2068F; Mon, 13 Jul 2020 15:57:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1594655872; bh=yaIr3W3gRNyeiwvDjKU5N+IKZQj4ZrZ+IUKbWI+E60o=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=EJ1fJ3vuXCvpwl6tcgdeYo4tlGvtfPRux44gveEKYvl3IWk4CHicfRtfCLpBRtoQU KoyR1iF6qU4nEtMY2hNBipSi2CGBHJ84s01SADiHpMRIIHJhNAa1M71YfuU33M2t3K RFSGyjA2mvNotQOghu16p04fvi5NhuyVGse6O7AA= Date: Mon, 13 Jul 2020 17:57:52 +0200 From: Greg Kroah-Hartman To: Oded Gabbay Cc: linux-kernel@vger.kernel.org, SW_Drivers@habana.ai, Ofir Bitton , Daniel Vetter Subject: Re: [PATCH 1/3] habanalabs: implement dma-fence mechanism Message-ID: <20200713155752.GC267581@kroah.com> References: <20200713155424.24721-1-oded.gabbay@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200713155424.24721-1-oded.gabbay@gmail.com> 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 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? Copying code leads to errors, here's some documentation ones: > --- /dev/null > +++ b/drivers/misc/habanalabs/hl_dma_fence.c > @@ -0,0 +1,338 @@ > +// SPDX-License-Identifier: GPL-2.0-only > +/* > + * Fence mechanism for dma-buf and to allow for asynchronous dma access Is that what this still does? > + * > + * Copyright (C) 2012 Canonical Ltd > + * Copyright (C) 2012 Texas Instruments > + * > + * Authors: > + * Rob Clark > + * Maarten Lankhorst > + * > + * The dma_fence module is a copy of dma-fence at drivers/dma-buf. "The hl_dma_fence" module... And is it a stand-alone module? Or just a single file? > + * This was done due to an explicit request by GPU developers who asked not > + * to use the dma-buf module because we aren't part of DRM subsystem. Why is dma-buf only for use for DRM? If it is, should the symbol namespace be set to that to catch users that want to use it for their own code? > + * This copy was stripped from all extra features that habanalabs driver > + * doesn't use, including the uapi interface dma-buf exposes. > + * In addition, we removed the callbacks because the only usage is from inside > + * habanalabs driver > + */ > + > +#include "hl_dma_fence.h" > +#include "habanalabs.h" > +#include > +#include > +#include > +#include > + > +/** > + * DOC: DMA fences overview > + * > + * DMA fences, represented by &struct hl_dma_fence, are the kernel internal > + * synchronization primitive for DMA operations like GPU rendering, video > + * encoding/decoding, or displaying buffers on a screen. I don't think this is correct anymore, right? :( > --- /dev/null > +++ b/drivers/misc/habanalabs/hl_dma_fence.h > @@ -0,0 +1,148 @@ > +/* SPDX-License-Identifier: GPL-2.0-only */ > +/* > + * Fence mechanism for dma-buf to allow for asynchronous dma access > + * > + * Copyright (C) 2012 Canonical Ltd > + * Copyright (C) 2012 Texas Instruments > + * > + * Authors: > + * Rob Clark > + * Maarten Lankhorst > + * > + * The dma_fence module is a copy of dma-fence at drivers/dma-buf. Same comments here for the .h file. thanks, greg k-h