From: Dan Carpenter <dan.carpenter@oracle•com>
To: Geert Uytterhoeven <geert@linux-m68k•org>
Cc: "Alice Guo (OSS)" <alice.guo@oss•nxp.com>,
gregkh@linuxfoundation•org, rafael@kernel•org,
horia.geanta@nxp•com, aymen.sghaier@nxp•com,
herbert@gondor•apana.org.au, davem@davemloft•net,
tony@atomide•com, geert+renesas@glider•be,
mturquette@baylibre•com, sboyd@kernel•org, vkoul@kernel•org,
peter.ujfalusi@gmail•com, a.hajda@samsung•com,
narmstrong@baylibre•com, robert.foss@linaro•org,
airlied@linux•ie, daniel@ffwll•ch, khilman@baylibre•com,
tomba@kernel•org, jyri.sarha@iki•fi, joro@8bytes•org,
will@kernel•org, mchehab@kernel•org, ulf.hansson@linaro•org,
adrian.hunter@intel•com, kishon@ti•com, kuba@kernel•org,
linus.walleij@linaro•org, Roy.Pledge@nxp•com, leoyang.li@nxp•com,
ssantosh@kernel•org, matthias.bgg@gmail•com, edubezval@gmail•com,
j-keerthy@ti•com, balbi@kernel•org, linux@prisktech•co.nz,
stern@rowland•harvard.edu, wim@linux-watchdog•org,
linux@roeck-us•net, linux-kernel@vger•kernel.org,
linux-crypto@vger•kernel.org, linux-omap@vger•kernel.org,
linux-renesas-soc@vger•kernel.org, linux-clk@vger•kernel.org,
dmaengine@vger•kernel.org, dri-devel@lists•freedesktop.org,
linux-amlogic@lists•infradead.org,
linux-arm-kernel@lists•infradead.org,
iommu@lists•linux-foundation.org, linux-media@vger•kernel.org,
linux-mmc@vger•kernel.org, netdev@vger•kernel.org,
linux-phy@lists•infradead.org, linux-gpio@vger•kernel.org,
linuxppc-dev@lists•ozlabs.org, linux-staging@lists•linux.dev,
linux-mediatek@lists•infradead.org, linux-pm@vger•kernel.org,
linux-usb@vger•kernel.org, linux-watchdog@vger•kernel.org,
Arnd Bergmann <arnd@arndb•de>
Subject: Re: [RFC v1 PATCH 1/3] drivers: soc: add support for soc_device_match returning -EPROBE_DEFER
Date: Tue, 20 Apr 2021 14:21:52 +0300 [thread overview]
Message-ID: <20210420112151.GE1981@kadam> (raw)
In-Reply-To: <CAMuHMdUbrPxtJ9DCP0_nFrReuuO4vFY2J79LrKY82D7bCOfzRw@mail.gmail.com>
On Mon, Apr 19, 2021 at 10:20:13AM +0200, Geert Uytterhoeven wrote:
> Hi Alice,
>
> CC Arnd (soc_device_match() author)
>
> On Mon, Apr 19, 2021 at 6:28 AM Alice Guo (OSS) <alice.guo@oss•nxp.com> wrote:
> > From: Alice Guo <alice.guo@nxp•com>
> >
> > In i.MX8M boards, the registration of SoC device is later than caam
> > driver which needs it. Caam driver needs soc_device_match to provide
> > -EPROBE_DEFER when no SoC device is registered and no
> > early_soc_dev_attr.
>
> I'm wondering if this is really a good idea: soc_device_match() is a
> last-resort low-level check, and IMHO should be made available early on,
> so there is no need for -EPROBE_DEFER.
>
> >
> > Signed-off-by: Alice Guo <alice.guo@nxp•com>
>
> Thanks for your patch!
>
> > --- a/drivers/base/soc.c
> > +++ b/drivers/base/soc.c
> > @@ -110,6 +110,7 @@ static void soc_release(struct device *dev)
> > }
> >
> > static struct soc_device_attribute *early_soc_dev_attr;
> > +static bool soc_dev_attr_init_done = false;
>
> Do you need this variable?
>
> >
> > struct soc_device *soc_device_register(struct soc_device_attribute *soc_dev_attr)
> > {
> > @@ -157,6 +158,7 @@ struct soc_device *soc_device_register(struct soc_device_attribute *soc_dev_attr
> > return ERR_PTR(ret);
> > }
> >
> > + soc_dev_attr_init_done = true;
> > return soc_dev;
> >
> > out3:
> > @@ -246,6 +248,9 @@ const struct soc_device_attribute *soc_device_match(
> > if (!matches)
> > return NULL;
> >
> > + if (!soc_dev_attr_init_done && !early_soc_dev_attr)
>
> if (!soc_bus_type.p && !early_soc_dev_attr)
There is one place checking this already. We could wrap it in a helper
function:
static bool device_init_done(void)
{
return soc_bus_type.p ? true : false;
}
regards,
dan carpenter
next prev parent reply other threads:[~2021-04-20 11:57 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 [this message]
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
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=20210420112151.GE1981@kadam \
--to=dan.carpenter@oracle$(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