[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK8P3a1tPQm1Qj2KZu2jOM=TUP0dJgP4G9eKkWfv-PZEAWEhyA@mail.gmail.com>
Date: Tue, 20 Apr 2021 11:10:40 +0200
From: Arnd Bergmann <arnd@...nel.org>
To: Dominique MARTINET <dominique.martinet@...ark-techno.com>
Cc: Geert Uytterhoeven <geert@...ux-m68k.org>,
"Alice Guo (OSS)" <alice.guo@....nxp.com>,
gregkh <gregkh@...uxfoundation.org>,
Rafael Wysocki <rafael@...nel.org>,
Horia Geantă <horia.geanta@....com>,
aymen.sghaier@....com, Herbert Xu <herbert@...dor.apana.org.au>,
David Miller <davem@...emloft.net>,
Tony Lindgren <tony@...mide.com>,
Geert Uytterhoeven <geert+renesas@...der.be>,
Michael Turquette <mturquette@...libre.com>,
Stephen Boyd <sboyd@...nel.org>, Vinod Koul <vkoul@...nel.org>,
peter.ujfalusi@...il.com, Andrzej Hajda <a.hajda@...sung.com>,
Neil Armstrong <narmstrong@...libre.com>,
Robert Foss <robert.foss@...aro.org>,
David Airlie <airlied@...ux.ie>,
Daniel Vetter <daniel@...ll.ch>,
Kevin Hilman <khilman@...libre.com>, tomba@...nel.org,
jyri.sarha@....fi, Joerg Roedel <joro@...tes.org>,
Will Deacon <will@...nel.org>,
Mauro Carvalho Chehab <mchehab@...nel.org>,
Ulf Hansson <ulf.hansson@...aro.org>,
Adrian Hunter <adrian.hunter@...el.com>,
Kishon <kishon@...com>, Jakub Kicinski <kuba@...nel.org>,
Linus Walleij <linus.walleij@...aro.org>,
Roy Pledge <Roy.Pledge@....com>, Leo Li <leoyang.li@....com>,
Santosh Shilimkar <ssantosh@...nel.org>,
Matthias Brugger <matthias.bgg@...il.com>,
Eduardo Valentin <edubezval@...il.com>,
Keerthy <j-keerthy@...com>, Felipe Balbi <balbi@...nel.org>,
Tony Prisk <linux@...sktech.co.nz>,
Alan Stern <stern@...land.harvard.edu>,
Wim Van Sebroeck <wim@...ux-watchdog.org>,
Guenter Roeck <linux@...ck-us.net>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
"open list:HARDWARE RANDOM NUMBER GENERATOR CORE"
<linux-crypto@...r.kernel.org>,
linux-omap <linux-omap@...r.kernel.org>,
Linux-Renesas <linux-renesas-soc@...r.kernel.org>,
linux-clk <linux-clk@...r.kernel.org>, dmaengine@...r.kernel.org,
dri-devel <dri-devel@...ts.freedesktop.org>,
"open list:ARM/Amlogic Meson SoC support"
<linux-amlogic@...ts.infradead.org>,
Linux ARM <linux-arm-kernel@...ts.infradead.org>,
"open list:IOMMU DRIVERS" <iommu@...ts.linux-foundation.org>,
Linux Media Mailing List <linux-media@...r.kernel.org>,
linux-mmc <linux-mmc@...r.kernel.org>,
Networking <netdev@...r.kernel.org>,
linux-phy@...ts.infradead.org,
"open list:GPIO SUBSYSTEM" <linux-gpio@...r.kernel.org>,
linuxppc-dev <linuxppc-dev@...ts.ozlabs.org>,
linux-staging@...ts.linux.dev,
"moderated list:ARM/Mediatek SoC..."
<linux-mediatek@...ts.infradead.org>,
Linux PM list <linux-pm@...r.kernel.org>,
USB list <linux-usb@...r.kernel.org>,
LINUXWATCHDOG <linux-watchdog@...r.kernel.org>
Subject: Re: [RFC v1 PATCH 3/3] driver: update all the code that use soc_device_match
On Tue, Apr 20, 2021 at 1:44 AM Dominique MARTINET
<dominique.martinet@...ark-techno.com> wrote:
> Arnd Bergmann wrote on Mon, Apr 19, 2021 at 02:16:36PM +0200:
> > For built-in drivers, load order depends on the initcall level and
> > link order (how things are lined listed in the Makefile hierarchy).
> >
> > For loadable modules, this is up to user space in the end.
> >
> > Which of the drivers in this scenario are loadable modules?
>
> All the drivers involved in my case are built-in (nvmem, soc and final
> soc_device_match consumer e.g. caam_jr that crashes the kernel if soc is
> not identified properly).
Ok, in that case you may have a chance to just adapt the initcall
levels. This is somewhat fragile if someone else already relies
on a particular order, but it's an easy one-line change to change
a driver e.g. from module_init() or device_initcall() to arch_initcall().
> I frankly don't like the idea of moving nvmem/ above soc/ in
> drivers/Makefile as a "solution" to this (especially as there is one
> that seems to care about what soc they run on...), so I'll have a look
> at links first, hopefully that will work out.
Right, that would be way more fragile.
I think the main problem in this case is the caam driver that really
should not look into the particular SoC type or even machine
compatible string. This is something we can do as a last resort
for compatibility with busted devicetree files, but it appears that
this driver does it as the primary method for identifying different
hardware revisions. I would suggest fixing the binding so that
each SoC that includes one of these devices has a soc specific
compatible string associated with the device that the driver can
use as the primary way of identifying the device.
We probably need to keep the old logic around for old dtb files,
but there can at least be a comment next to that table that
discourages people from adding more entries there.
Arnd
Powered by blists - more mailing lists