ksummit.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Christian Brauner <christian.brauner@ubuntu.com>,
	Josh Triplett <josh@joshtriplett.org>,
	Jonathan Corbet <corbet@lwn.net>,
	ksummit@lists.linux.dev
Subject: Re: [MAINTAINER SUMMIT] User-space requirements for accelerator drivers
Date: Tue, 14 Sep 2021 05:07:39 +0300	[thread overview]
Message-ID: <YUAD6+fel9roitEF@pendragon.ideasonboard.com> (raw)
In-Reply-To: <CAKMK7uFPxVosEvdwSOrfUvq7+W-dUo39ktEm2Yag_wvJ5YvZNg@mail.gmail.com>

Hi Daniel,

On Mon, Sep 13, 2021 at 03:57:25PM +0200, Daniel Vetter wrote:
> On Mon, Sep 13, 2021 at 3:50 PM Christian Brauner wrote:
> > On Fri, Sep 10, 2021 at 02:32:48PM -0700, Josh Triplett wrote:
> > > On Fri, Sep 10, 2021 at 03:00:58PM -0600, Jonathan Corbet wrote:
> > > > There has been a regular disagreement in recent years about whether
> > > > drivers for accelerators (such as for the Habana Gaudi device) should be
> > > > subject to the same requirements as GPU drivers when it comes to the
> > > > availability of a free implementation of the user-space side.  It flared
> > > > up again recently:
> > > >
> > > >    https://lwn.net/Articles/867168/
> > > >
> > > > Happily, the Habana situation in particular seems to be resolving
> > > > itself:
> > > >
> > > >    https://lwn.net/ml/linux-kernel/CAFCwf119s7iXk+qpwoVPnRtOGcxeuZb3rnihf6NWWoVT-4ODHA@mail.gmail.com/
> > > >
> > > > But even there it is clear that the fundamental question has not yet
> > > > been resolved.
> > > >
> > > > This seems like the sort of question that the maintainer summit exists
> > > > to address.  Specifically, we could discuss:
> > > >
> > > >  - Under which circumstances should the kernel community require the
> > > >    existence of freely licensed user-space code that exercises all
> > > >    functionalities of a proposed kernel driver or feature?
> > >
> > > I think it'd be reasonable to ask, as well: if we required this for
> > > *all* kernel functionality, such that we never add any userspace
> > > interface to the kernel unless there's *some* Open Source userspace that
> > > needs/wants it, what problems would that cause if any?
> > >
> > > It appears that in this case the kernel pushing back has influenced the
> > > release of Open Source userspace code. Having a kernel-wide policy here
> > > seems like it'll *help* people within many companies to push for such
> > > changes: "We're never going to be able to get our changes into the
> > > upstream kernel if there's no userspace to drive them."
> >
> > I can certainly see why that discussion is needed for features that deal
> > with hardware which requires an elaborate userspace component in order
> > to work.
> > But I'm not convinced this policy makes sense for all kernel features.
> > For example, when we introduce a new general api in kernel core it will
> > often be driven by requirements of other well-known open source
> > projects. If such projects state that they will add support for it once
> > a kernel supporting this feature is released that expression of their
> > intent is often sufficient. We usually don't make such projects jump
> > through the hoops of implementing the userspace side upfront to proof
> > that they would use it. Although to the credit of a few open source
> > projects that does also happen. But I'm hesitant to make this a general
> > rule.
> 
> I agree it's an orthogonal discussion, but I think we've also had our
> fair share of fully generic interface that turned out to miss the mark
> in real-world usage. This is why the generic kernel
> modesetting/display interface for drivers in drivers/gpu also needs
> fully open implementation. Not because we really need that for
> long-term maintainability - the interfaces are generally well-defined
> enough that testcases + docs are sufficient for that, but because in
> practices it just catches so many small gotchas that are otherwise
> overlooked in good generic uapi design.

I concur here. I've spent the past 3 years working on libcamera in
userspace after a decade of experience in the kernel side of V4L2. It
was an enlightening (and embarassing) moment to realize that some kernel
APIs that I had designed myself didn't stand the test of being used for
real. A test application written to test an API in the way the API was
designed will generally not be good at finding design flaws.

> But I do think we should keep this apart from the discussions for hw
> drivers, where 80+% of the driver that's absolutely needed to drive
> the hardware is in userspace.

-- 
Regards,

Laurent Pinchart

  reply	other threads:[~2021-09-14  2:08 UTC|newest]

Thread overview: 77+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-10 21:00 [MAINTAINER SUMMIT] User-space requirements for accelerator drivers Jonathan Corbet
2021-09-10 21:32 ` Josh Triplett
2021-09-13 13:50   ` Christian Brauner
2021-09-13 13:57     ` Daniel Vetter
2021-09-14  2:07       ` Laurent Pinchart [this message]
2021-09-14 14:40   ` Jani Nikula
2021-09-14 14:45     ` Geert Uytterhoeven
2021-09-14 14:59       ` Jani Nikula
2021-09-14 15:10         ` Geert Uytterhoeven
2021-09-10 21:51 ` James Bottomley
2021-09-10 21:59   ` Alexandre Belloni
2021-09-10 22:35     ` James Bottomley
2021-09-11 14:51       ` Jonathan Corbet
2021-09-11 15:24         ` James Bottomley
2021-09-11 21:52           ` Laurent Pinchart
2021-09-14 13:22             ` Johannes Berg
2021-09-11  0:08   ` Laurent Pinchart
2021-09-10 22:52 ` Mauro Carvalho Chehab
2021-09-10 23:45   ` Josh Triplett
2021-09-10 23:48     ` Dave Hansen
2021-09-11  0:13       ` Laurent Pinchart
2021-09-10 23:55     ` Thomas Gleixner
2021-09-11  0:20       ` Laurent Pinchart
2021-09-11 14:20         ` Steven Rostedt
2021-09-11 22:08           ` Laurent Pinchart
2021-09-11 22:42             ` Steven Rostedt
2021-09-11 23:10               ` Laurent Pinchart
2021-09-13 11:10               ` Mark Brown
2021-09-11 22:51           ` Mauro Carvalho Chehab
2021-09-11 23:22           ` Mauro Carvalho Chehab
2021-09-11 10:31       ` Leon Romanovsky
2021-09-11 11:41         ` Laurent Pinchart
2021-09-11 12:04           ` Leon Romanovsky
2021-09-11 22:04             ` Laurent Pinchart
2021-09-12  4:27               ` Leon Romanovsky
2021-09-12  7:26                 ` Greg KH
2021-09-12  8:29                   ` Leon Romanovsky
2021-09-12 13:25                     ` Greg KH
2021-09-12 14:15                       ` Leon Romanovsky
2021-09-12 14:34                         ` Greg KH
2021-09-12 16:41                           ` Laurent Pinchart
2021-09-12 20:35                           ` Dave Airlie
2021-09-12 20:41                           ` Dave Airlie
2021-09-12 20:49                             ` Daniel Vetter
2021-09-12 21:12                               ` Dave Airlie
2021-09-12 22:51                                 ` Linus Walleij
2021-09-12 23:15                                   ` Dave Airlie
2021-09-13 13:20                                   ` Arnd Bergmann
2021-09-13 13:54                                     ` Daniel Vetter
2021-09-13 22:04                                       ` Arnd Bergmann
2021-09-13 23:33                                         ` Dave Airlie
2021-09-14  9:08                                           ` Arnd Bergmann
2021-09-14  9:23                                             ` Daniel Vetter
2021-09-14 10:47                                               ` Laurent Pinchart
2021-09-14 12:58                                               ` Arnd Bergmann
2021-09-14 19:45                                                 ` Daniel Vetter
2021-09-14 15:43                                             ` Luck, Tony
2021-09-13 14:52                                     ` James Bottomley
2021-09-14 13:07                                     ` Linus Walleij
2021-09-13 14:03                           ` Mark Brown
2021-09-12 15:55                       ` Laurent Pinchart
2021-09-12 16:43                         ` James Bottomley
2021-09-12 16:58                           ` Laurent Pinchart
2021-09-12 17:08                             ` James Bottomley
2021-09-12 19:52                   ` Dave Airlie
2021-09-12  7:46                 ` Mauro Carvalho Chehab
2021-09-12  8:00                   ` Leon Romanovsky
2021-09-12 14:53                     ` Laurent Pinchart
2021-09-12 15:41                       ` Mauro Carvalho Chehab
2021-09-10 23:46   ` Laurent Pinchart
2021-09-11  0:38     ` Mauro Carvalho Chehab
2021-09-11  9:27       ` Laurent Pinchart
2021-09-11 22:33         ` Mauro Carvalho Chehab
2021-09-13 12:04         ` Mark Brown
2021-09-12 19:13 ` Dave Airlie
2021-09-12 19:48   ` Laurent Pinchart
2021-09-13  2:26     ` Dave Airlie

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=YUAD6+fel9roitEF@pendragon.ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=christian.brauner@ubuntu.com \
    --cc=corbet@lwn.net \
    --cc=daniel.vetter@ffwll.ch \
    --cc=josh@joshtriplett.org \
    --cc=ksummit@lists.linux.dev \
    /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).