From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>,
ksummit@lists.linux.dev
Subject: Re: [MAINTAINER SUMMIT] Enforcing API deprecation
Date: Tue, 26 Aug 2025 23:02:48 +0200 [thread overview]
Message-ID: <20250826210248.GC5650@pendragon.ideasonboard.com> (raw)
In-Reply-To: <f8bb4fb296ab764b1973103f8944bb14004d9acd.camel@sipsolutions.net>
On Tue, Aug 26, 2025 at 10:24:42PM +0200, Johannes Berg wrote:
> On Tue, 2025-08-26 at 21:57 +0200, Bartosz Golaszewski wrote:
> > What we usually do is:
> > 1. Provide an alternative solution living in parallel to the old one.
> > 2. Mark the legacy interfaces as deprecated in their kerneldocs.
> > 3. Slowly convert users one by one until the relevant symbols are no
> > longer called anywhere in the kernel.
> > 4. Remove legacy interface.
> >
> > A problem occurs when during step #3 (which may take anywhere from
> > several releases to many years depending on how commonly given
> > interface is used), developers continue to introduce new calls to the
> > deprecated routines. This is not always easily caught, because quite
> > often patches using the API of a given subsystem will not be send to
> > this subsystem's maintainer (Example: while GPIO core code lives under
> > drivers/gpio/, there are lots of provider implementations and even
> > more consumers spread tree-wide. I cannot possibly catch every commit
> > I'm not explicitly Cc'ed on and eventually some will fly under the
> > radar. Also: this is not a good solution if I have to manually object
> > every time, this should be more or less automated).
>
> Once most things are converted, copy/paste will die automatically use
> the right things. Sure, you might think you're almost there and then a
> handful of new users are introduced, but you can actually remove the
> APIs in -next and then the new ones fail to build there, if you're that
> far along.
>
> I guess you have to ask yourself how much it matters?
>
> Is it a major hassle to keep supporting the old API? Then I guess the
> effort to support the old API outweighs the effort to convert it
> quickly, so do that?
>
> If the old API just calls the new API or something simple you basically
> keep the old API forever (I just looked at PCI MSI APIs which have said
> it's deprecated for almost a decade, and yet is still the most commonly
> used one ... I guess it didn't matter). If it doesn't matter then really
> all you did was introduce an _additional_ API that might let you solve
> whatever problem you were trying to solve that the old API didn't let
> you solve, but isn't needed for the vast majority of cases?
>
> More nagging etc. really won't change anything except stress maintainers
> out even more, make people ignore it, etc. Whoever cares can do the
> conversion, but if whoever maintains the API doesn't actually care about
> converting it, why should anyone else?
As Bartosz mentioned, some new users of those deprecated APIs may not
even know that they should use a different API. Adding warnings to
checkpatch could help raise awareness. I don't think that would stress
out maintainers, and while some authors may ignore it, it seems worth it
to me: it's low effort, not intrusive, and can help developers who
refactor code without much drawback.
--
Regards,
Laurent Pinchart
prev parent reply other threads:[~2025-08-26 21:03 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-26 19:57 Bartosz Golaszewski
2025-08-26 20:12 ` Linus Torvalds
2025-08-26 20:28 ` Jiri Kosina
2025-08-26 22:44 ` Linus Torvalds
2025-08-26 23:25 ` Al Viro
2025-08-27 15:07 ` Bartosz Golaszewski
2025-08-27 16:42 ` Rob Herring
2025-08-27 16:57 ` Linus Torvalds
2025-08-28 15:11 ` Bartosz Golaszewski
2025-09-03 13:19 ` Eric W. Biederman
2025-08-27 14:47 ` Bartosz Golaszewski
2025-08-27 14:58 ` Julia Lawall
2025-08-27 15:31 ` Bartosz Golaszewski
2025-08-29 9:00 ` Krzysztof Kozlowski
2025-08-26 20:24 ` Johannes Berg
2025-08-26 21:02 ` Laurent Pinchart [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=20250826210248.GC5650@pendragon.ideasonboard.com \
--to=laurent.pinchart@ideasonboard.com \
--cc=bartosz.golaszewski@linaro.org \
--cc=johannes@sipsolutions.net \
--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