linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ofir Bitton <obitton@habana.ai>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Jason Gunthorpe <jgg@ziepe.ca>,
	Oded Gabbay <oded.gabbay@gmail.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	SW_Drivers <SW_Drivers@habana.ai>
Subject: RE: [PATCH 1/3] habanalabs: implement dma-fence mechanism
Date: Tue, 14 Jul 2020 12:07:29 +0000	[thread overview]
Message-ID: <VI1PR0202MB32774769723B6CE154865086BC610@VI1PR0202MB3277.eurprd02.prod.outlook.com> (raw)
In-Reply-To: <20200714063648.GC662760@kroah.com>

Sure,
I will send a new patch using completion instead of dma-fence

Thanks,
Ofir

-----Original Message-----
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> 
Sent: Tuesday, July 14, 2020 09:37
To: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Jason Gunthorpe <jgg@ziepe.ca>; Oded Gabbay <oded.gabbay@gmail.com>; Linux Kernel Mailing List <linux-kernel@vger.kernel.org>; SW_Drivers <SW_Drivers@habana.ai>; Ofir Bitton <obitton@habana.ai>
Subject: Re: [PATCH 1/3] habanalabs: implement dma-fence mechanism

On Mon, Jul 13, 2020 at 09:08:55PM +0200, Daniel Vetter wrote:
> On Mon, Jul 13, 2020 at 9:03 PM Jason Gunthorpe <jgg@ziepe.ca> 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 
> > > <gregkh@linuxfoundation.org> wrote:
> > > >
> > > > On Mon, Jul 13, 2020 at 06:54:22PM +0300, Oded Gabbay wrote:
> > > > > From: Ofir Bitton <obitton@habana.ai>
> > > > >
> > > > > 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.v
> > > etter@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

      reply	other threads:[~2020-07-14 12:07 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-13 15:54 [PATCH 1/3] habanalabs: implement dma-fence mechanism Oded Gabbay
2020-07-13 15:54 ` [PATCH 2/3] habanalabs: create common folder Oded Gabbay
2020-07-15 10:56   ` Omer Shpigelman
2020-07-13 15:54 ` [PATCH 3/3] habanalabs: update hl_boot_if.h from firmware Oded Gabbay
2020-07-15 10:58   ` Omer Shpigelman
2020-07-13 15:57 ` [PATCH 1/3] habanalabs: implement dma-fence mechanism Greg Kroah-Hartman
2020-07-13 18:34   ` Daniel Vetter
2020-07-13 19:03     ` Jason Gunthorpe
2020-07-13 19:08       ` Daniel Vetter
2020-07-14  6:36         ` Greg Kroah-Hartman
2020-07-14 12:07           ` Ofir Bitton [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=VI1PR0202MB32774769723B6CE154865086BC610@VI1PR0202MB3277.eurprd02.prod.outlook.com \
    --to=obitton@habana.ai \
    --cc=SW_Drivers@habana.ai \
    --cc=daniel.vetter@ffwll.ch \
    --cc=gregkh@linuxfoundation.org \
    --cc=jgg@ziepe.ca \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oded.gabbay@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).