linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
To: Hans Verkuil <hverkuil@xs4all.nl>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Tony Battersby <tonyb@cybernetics.com>,
	Jiri Slaby <jirislaby@kernel.org>,
	linux-kernel@vger.kernel.org,
	Jari Ruusu <jariruusu@protonmail.com>,
	David Laight <David.Laight@aculab.com>,
	Christoph Biedl <linux-kernel.bfrz@manchmal.in-ulm.de>,
	linux-media@vger.kernel.org
Subject: Re: Kernel version numbers after 4.9.255 and 4.4.255
Date: Sat, 6 Feb 2021 12:18:39 +0100	[thread overview]
Message-ID: <20210206121604.4e9a10b9@coco.lan> (raw)
In-Reply-To: <8220e22e-380f-5b4e-fa69-5c6fcace8535@xs4all.nl>

Em Sat, 6 Feb 2021 11:18:15 +0100
Hans Verkuil <hverkuil@xs4all.nl> escreveu:

> >> Yes, driver "version" means nothing, so functionality is the correct way
> >> to handle this.
> >>
> >> Any chance you all can just drop the kernel version stuff and just
> >> report a static number that never goes up to allow people to use the
> >> correct api for new stuff?  Pick a "modern" number, like 5.10 and leave
> >> it there for forever.  
> > 
> > Good question. I like the idea of keeping it fixed, marking those fields
> > as DEPRECATED at the uAPI documentation.
> > 
> > However, at least the v4l2-compliance tool (used for V4L2 
> > development) currently requires it:
> > 
> > 	if (vcap.version >= 0x050900)  // Present from 5.9.0 onwards
> > 		node->might_support_cache_hints = true;
> > 
> > Not sure if uname would work there, or if we would need, to use some
> > Kconfig symbol to only return the real version on debug Kernels.
> > 
> > Hans,
> > 
> > What do you think?  
> 
> It could be replaced by uname, but if we fix the version number to something
> >= 5.9 (which we will no doubt do), then there is no need to change anything here.

Sure, but needing to check for a so recent Kernel version probably
means that we should have an extra capability somewhere to the
feature that it is enabled only if Kernel >= 5.9.
  
> But I was wondering if it wouldn't make sense to create a variant of
> LINUX_VERSION_CODE that ignored the sublevel and just always leaves that
> at 0. In practice, media API changes only happen at new kernel releases and
> not in the stable series (there might be rare exceptions to that, but I'm
> not aware of that).

I guess there were one or two exceptions of uAPI regressions that happened
after a new version that were fixed at stable sublevel 1 or 2.

> And while we are using capability flags a lot more these days to ensure
> userspace can discover what is and what is not available, we never did a full
> analysis of that and I feel a bit uncomfortable about fixing the version
> number.

We don't need a full analysis for past features. If the version gets
fixed on, let's say, 6.0.0, if caps.version >= 0x060000, everything
supported up to the present date will be there.

We'll just need to have an extra care of ensuring that every new
feature added upstream will have a way for userspace to check if
it is present.

> I see more usages of LINUX_VERSION_CODE in the kernel that look like they do
> something similar to what the media subsystem does, and that probably also
> do not need the SUBLEVEL.

Yeah, other subsystems seem to use it as well.

> A LINUX_MAJOR_MINOR_CODE define (or whatever you want to call it) would solve
> this problem for us.

There are ways to minimize this problem on future stable Kernels.

My main concern is if we should keep letting applications relying
on caps.version. By keeping 

	cap->version = LINUX_VERSION_CODE;

(or any variant of that), applications may simply rely on it,
instead of properly implementing a functionality probing code.

To be clear: my main concern here is not about media development
tools, like v4l2-compliance. It is about real applications that
could end breaking on backports that won't be properly
back-propagating cap->version.

Thanks,
Mauro

  reply	other threads:[~2021-02-06 11:19 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-04  5:59 Jari Ruusu
2021-02-04  6:20 ` Greg Kroah-Hartman
2021-02-04  7:26   ` Jiri Slaby
2021-02-04  8:51     ` Greg Kroah-Hartman
2021-02-04 11:00       ` Jiri Slaby
2021-02-04 16:28         ` David Laight
2021-02-04 16:48           ` Greg Kroah-Hartman
2021-02-04 20:19           ` Christoph Biedl
2021-02-05  6:52             ` Greg KH
2021-02-05 17:31         ` Tony Battersby
2021-02-05 18:11           ` Mauro Carvalho Chehab
2021-02-06  7:20             ` Greg Kroah-Hartman
2021-02-06  9:24               ` Mauro Carvalho Chehab
2021-02-06  9:29                 ` Greg Kroah-Hartman
2021-02-06  9:48                   ` Mauro Carvalho Chehab
2021-02-06 10:18                     ` Hans Verkuil
2021-02-06 11:18                       ` Mauro Carvalho Chehab [this message]
2021-02-06  7:22           ` Greg Kroah-Hartman
2021-02-05  9:06       ` Pavel Machek
2021-02-05  9:33         ` Greg Kroah-Hartman
2021-02-05 18:44           ` Pavel Machek
2021-02-06  7:23             ` Greg Kroah-Hartman

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=20210206121604.4e9a10b9@coco.lan \
    --to=mchehab+huawei@kernel.org \
    --cc=David.Laight@aculab.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hverkuil@xs4all.nl \
    --cc=jariruusu@protonmail.com \
    --cc=jirislaby@kernel.org \
    --cc=linux-kernel.bfrz@manchmal.in-ulm.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=tonyb@cybernetics.com \
    --subject='Re: Kernel version numbers after 4.9.255 and 4.4.255' \
    /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

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).