public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Dominique MARTINET <dominique.martinet@atmark-techno•com>
To: Arnd Bergmann <arnd@arndb•de>
Cc: "Geert Uytterhoeven" <geert@linux-m68k•org>,
	"Alice Guo (OSS)" <alice.guo@oss•nxp.com>,
	gregkh <gregkh@linuxfoundation•org>,
	"Rafael Wysocki" <rafael@kernel•org>,
	"Horia Geantă" <horia.geanta@nxp•com>,
	aymen.sghaier@nxp•com, "Herbert Xu" <herbert@gondor•apana.org.au>,
	"David Miller" <davem@davemloft•net>,
	"Tony Lindgren" <tony@atomide•com>,
	"Geert Uytterhoeven" <geert+renesas@glider•be>,
	"Michael Turquette" <mturquette@baylibre•com>,
	"Stephen Boyd" <sboyd@kernel•org>,
	"Vinod Koul" <vkoul@kernel•org>,
	peter.ujfalusi@gmail•com, "Andrzej Hajda" <a.hajda@samsung•com>,
	"Neil Armstrong" <narmstrong@baylibre•com>,
	"Robert Foss" <robert.foss@linaro•org>,
	"David Airlie" <airlied@linux•ie>,
	"Daniel Vetter" <daniel@ffwll•ch>,
	"Kevin Hilman" <khilman@baylibre•com>,
	tomba@kernel•org, jyri.sarha@iki•fi,
	"Joerg Roedel" <joro@8bytes•org>, "Will Deacon" <will@kernel•org>,
	"Mauro Carvalho Chehab" <mchehab@kernel•org>,
	"Ulf Hansson" <ulf.hansson@linaro•org>,
	"Adrian Hunter" <adrian.hunter@intel•com>, Kishon <kishon@ti•com>,
	"Jakub Kicinski" <kuba@kernel•org>,
	"Linus Walleij" <linus.walleij@linaro•org>,
	"Roy Pledge" <Roy.Pledge@nxp•com>, "Leo Li" <leoyang.li@nxp•com>,
	"Santosh Shilimkar" <ssantosh@kernel•org>,
	"Matthias Brugger" <matthias.bgg@gmail•com>,
	"Eduardo Valentin" <edubezval@gmail•com>,
	Keerthy <j-keerthy@ti•com>, "Felipe Balbi" <balbi@kernel•org>,
	"Tony Prisk" <linux@prisktech•co.nz>,
	"Alan Stern" <stern@rowland•harvard.edu>,
	"Wim Van Sebroeck" <wim@linux-watchdog•org>,
	"Guenter Roeck" <linux@roeck-us•net>,
	"Linux Kernel Mailing List" <linux-kernel@vger•kernel.org>,
	"open list:HARDWARE RANDOM NUMBER GENERATOR CORE"
	<linux-crypto@vger•kernel.org>,
	linux-omap <linux-omap@vger•kernel.org>,
	Linux-Renesas <linux-renesas-soc@vger•kernel.org>,
	linux-clk <linux-clk@vger•kernel.org>,
	dmaengine@vger•kernel.org,
	dri-devel <dri-devel@lists•freedesktop.org>,
	"open list:ARM/Amlogic Meson SoC support"
	<linux-amlogic@lists•infradead.org>,
	"Linux ARM" <linux-arm-kernel@lists•infradead.org>,
	"open list:IOMMU DRIVERS" <iommu@lists•linux-foundation.org>,
	"Linux Media Mailing List" <linux-media@vger•kernel.org>,
	linux-mmc <linux-mmc@vger•kernel.org>,
	Networking <netdev@vger•kernel.org>,
	linux-phy@lists•infradead.org,
	"open list:GPIO SUBSYSTEM" <linux-gpio@vger•kernel.org>,
	linuxppc-dev <linuxppc-dev@lists•ozlabs.org>,
	linux-staging@lists•linux.dev,
	"moderated list:ARM/Mediatek SoC..."
	<linux-mediatek@lists•infradead.org>,
	"Linux PM list" <linux-pm@vger•kernel.org>,
	"USB list" <linux-usb@vger•kernel.org>,
	LINUXWATCHDOG <linux-watchdog@vger•kernel.org>
Subject: Re: [RFC v1 PATCH 3/3] driver: update all the code that use soc_device_match
Date: Tue, 20 Apr 2021 08:42:44 +0900	[thread overview]
Message-ID: <YH4VdPNO9cdzc5MD@atmark-techno.com> (raw)
In-Reply-To: <CAK8P3a1Mu2F0irDDCL-50HiHth29iYFL5b7WHZ=UX6W7zzoxAg@mail.gmail.com>

Arnd Bergmann wrote on Mon, Apr 19, 2021 at 02:16:36PM +0200:
> In some cases, you can use the device_link infrastructure to deal
> with dependencies between devices. Not sure if this would help
> in your case, but have a look at device_link_add() etc in drivers/base/core.c

I'll need to actually try to convince myself but if creating the link
forces driver registration then it should be workable.

> > In this particular case the problem is that since 7d981405d0fd ("soc:
> > imx8m: change to use platform driver") the soc probe tries to use the
> > nvmem driver for ocotp fuses for imx8m devices, which isn't ready yet.
> > So soc loading gets pushed back to the end of the list because it gets
> > defered and other drivers relying on soc_device_match get confused
> > because they wrongly think a device doesn't match a quirk when it
> > actually does.
> >
> > If there is a way to ensure the nvmem driver gets loaded before the soc,
> > that would also solve the problem nicely, and avoid the need to mess
> > with all the ~50 drivers which use it.
> >
> > Is there a way to control in what order drivers get loaded? Something in
> > the dtb perhaps?
> 
> 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).

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.


Thanks,
-- 
Dominique

  reply	other threads:[~2021-04-19 23:43 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-19  4:27 [RFC v1 PATCH 0/3] support soc_device_match to return -EPROBE_DEFER Alice Guo (OSS)
2021-04-19  4:27 ` [RFC v1 PATCH 1/3] drivers: soc: add support for soc_device_match returning -EPROBE_DEFER Alice Guo (OSS)
2021-04-19  4:49   ` Dominique MARTINET
2021-04-19  6:40     ` Alice Guo (OSS)
2021-04-19  8:20   ` Geert Uytterhoeven
2021-04-20 11:21     ` Dan Carpenter
2021-04-19  4:27 ` [RFC v1 PATCH 2/3] caam: add defer probe when the caam driver cannot identify SoC Alice Guo (OSS)
2021-04-19  4:27 ` [RFC v1 PATCH 3/3] driver: update all the code that use soc_device_match Alice Guo (OSS)
2021-04-19  5:02   ` Leon Romanovsky
2021-04-19  6:46     ` Alice Guo (OSS)
2021-04-19  5:02   ` Dominique MARTINET
2021-04-19  7:09     ` Alice Guo (OSS)
2021-04-19  9:03     ` Geert Uytterhoeven
2021-04-19  9:33       ` Dominique MARTINET
2021-04-19 12:16         ` Arnd Bergmann
2021-04-19 23:42           ` Dominique MARTINET [this message]
2021-04-20  9:07             ` Arnd Bergmann
2021-04-20  9:10             ` Arnd Bergmann
2021-04-19 13:36   ` Guenter Roeck
2021-04-20  9:40   ` Péter Ujfalusi

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=YH4VdPNO9cdzc5MD@atmark-techno.com \
    --to=dominique.martinet@atmark-techno$(echo .)com \
    --cc=Roy.Pledge@nxp$(echo .)com \
    --cc=a.hajda@samsung$(echo .)com \
    --cc=adrian.hunter@intel$(echo .)com \
    --cc=airlied@linux$(echo .)ie \
    --cc=alice.guo@oss$(echo .)nxp.com \
    --cc=arnd@arndb$(echo .)de \
    --cc=aymen.sghaier@nxp$(echo .)com \
    --cc=balbi@kernel$(echo .)org \
    --cc=daniel@ffwll$(echo .)ch \
    --cc=davem@davemloft$(echo .)net \
    --cc=dmaengine@vger$(echo .)kernel.org \
    --cc=dri-devel@lists$(echo .)freedesktop.org \
    --cc=edubezval@gmail$(echo .)com \
    --cc=geert+renesas@glider$(echo .)be \
    --cc=geert@linux-m68k$(echo .)org \
    --cc=gregkh@linuxfoundation$(echo .)org \
    --cc=herbert@gondor$(echo .)apana.org.au \
    --cc=horia.geanta@nxp$(echo .)com \
    --cc=iommu@lists$(echo .)linux-foundation.org \
    --cc=j-keerthy@ti$(echo .)com \
    --cc=joro@8bytes$(echo .)org \
    --cc=jyri.sarha@iki$(echo .)fi \
    --cc=khilman@baylibre$(echo .)com \
    --cc=kishon@ti$(echo .)com \
    --cc=kuba@kernel$(echo .)org \
    --cc=leoyang.li@nxp$(echo .)com \
    --cc=linus.walleij@linaro$(echo .)org \
    --cc=linux-amlogic@lists$(echo .)infradead.org \
    --cc=linux-arm-kernel@lists$(echo .)infradead.org \
    --cc=linux-clk@vger$(echo .)kernel.org \
    --cc=linux-crypto@vger$(echo .)kernel.org \
    --cc=linux-gpio@vger$(echo .)kernel.org \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=linux-media@vger$(echo .)kernel.org \
    --cc=linux-mediatek@lists$(echo .)infradead.org \
    --cc=linux-mmc@vger$(echo .)kernel.org \
    --cc=linux-omap@vger$(echo .)kernel.org \
    --cc=linux-phy@lists$(echo .)infradead.org \
    --cc=linux-pm@vger$(echo .)kernel.org \
    --cc=linux-renesas-soc@vger$(echo .)kernel.org \
    --cc=linux-staging@lists$(echo .)linux.dev \
    --cc=linux-usb@vger$(echo .)kernel.org \
    --cc=linux-watchdog@vger$(echo .)kernel.org \
    --cc=linux@prisktech$(echo .)co.nz \
    --cc=linux@roeck-us$(echo .)net \
    --cc=linuxppc-dev@lists$(echo .)ozlabs.org \
    --cc=matthias.bgg@gmail$(echo .)com \
    --cc=mchehab@kernel$(echo .)org \
    --cc=mturquette@baylibre$(echo .)com \
    --cc=narmstrong@baylibre$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=peter.ujfalusi@gmail$(echo .)com \
    --cc=rafael@kernel$(echo .)org \
    --cc=robert.foss@linaro$(echo .)org \
    --cc=sboyd@kernel$(echo .)org \
    --cc=ssantosh@kernel$(echo .)org \
    --cc=stern@rowland$(echo .)harvard.edu \
    --cc=tomba@kernel$(echo .)org \
    --cc=tony@atomide$(echo .)com \
    --cc=ulf.hansson@linaro$(echo .)org \
    --cc=vkoul@kernel$(echo .)org \
    --cc=will@kernel$(echo .)org \
    --cc=wim@linux-watchdog$(echo .)org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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