netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Hilman <khilman@baylibre.com>
To: Vignesh Raghavendra <vigneshr@ti.com>,
	Nicolas Frayer <nfrayer@baylibre.com>,
	nm@ti.com, ssantosh@kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, peter.ujfalusi@gmail.com,
	vkoul@kernel.org, dmaengine@vger.kernel.org,
	grygorii.strashko@ti.com, davem@davemloft.net,
	edumazet@google.com, kuba@kernel.org, pabeni@redhat.com,
	linux-omap@vger.kernel.org, netdev@vger.kernel.org
Cc: glaroque@baylibre.com
Subject: Re: [PATCH v4 4/4] net: ethernet: ti: davinci_mdio: Deferring probe when soc_device_match() returns NULL
Date: Wed, 23 Nov 2022 09:33:33 -0800	[thread overview]
Message-ID: <7ho7sx8tjm.fsf@baylibre.com> (raw)
In-Reply-To: <c3ded2b8-cf99-36ac-7152-5a23245a2e9c@ti.com>

Hi Vignesh,

Vignesh Raghavendra <vigneshr@ti.com> writes:

> Hi Nicolas,
>
> On 08/11/22 11:41 pm, Nicolas Frayer wrote:
>> When the k3 socinfo driver is built as a module, there is a possibility
>> that it will probe after the davinci mdio driver. By deferring the mdio
>> probe we allow the k3 socinfo to probe and register the
>> soc_device_attribute structure needed by the mdio driver.
>> 
>> Signed-off-by: Nicolas Frayer <nfrayer@baylibre.com>
>> ---
>>  drivers/net/ethernet/ti/davinci_mdio.c | 4 ++++
>>  1 file changed, 4 insertions(+)
>> 
>> diff --git a/drivers/net/ethernet/ti/davinci_mdio.c b/drivers/net/ethernet/ti/davinci_mdio.c
>> index 946b9753ccfb..095198b6b7be 100644
>> --- a/drivers/net/ethernet/ti/davinci_mdio.c
>> +++ b/drivers/net/ethernet/ti/davinci_mdio.c
>> @@ -533,6 +533,10 @@ static int davinci_mdio_probe(struct platform_device *pdev)
>>  		const struct soc_device_attribute *soc_match_data;
>>  
>>  		soc_match_data = soc_device_match(k3_mdio_socinfo);
>> +
>> +		if (!soc_match_data)
>> +			return -EPROBE_DEFER;
>
> I dont think this is right way to detect if socinfo driver is probed.
> Per documentation of soc_device_match() , function will return NULL if
> it does not match any of the entries in k3_mdio_socinfo (ie if we are
> running on any platforms other that ones in the list)
>
> Note that this driver is used on TI's 32 bit SoCs too that dont even
> have a k3-socinfo driver equivalent. In such case, this code will end up
> probe deferring indefinitely.

Yes, you're right.  This is not the right solution and this patch should
be dropped. We'll need to have a deeper look at socinfo to figure out
if/how it could be configured to support a fully modular kernel.

Kevin

      reply	other threads:[~2022-11-23 17:33 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-08 18:11 [PATCH v4 0/4] soc: ti: Add module build support to the socinfo Nicolas Frayer
2022-11-08 18:11 ` [PATCH v4 1/4] soc: ti: Convert allocations to devm Nicolas Frayer
2022-11-08 18:11 ` [PATCH v4 2/4] soc: ti: Add module build support Nicolas Frayer
2022-11-08 18:18   ` Randy Dunlap
2022-11-24  9:04     ` Nicolas Frayer
2022-11-24  7:54   ` Péter Ujfalusi
2022-11-24  9:01     ` Nicolas Frayer
2022-11-08 18:11 ` [PATCH v4 3/4] dmaengine: ti: k3-udma: Deferring probe when soc_device_match() returns NULL Nicolas Frayer
2022-11-08 18:11 ` [PATCH v4 4/4] net: ethernet: ti: davinci_mdio: " Nicolas Frayer
2022-11-10 11:21   ` Paolo Abeni
2022-11-16 10:52     ` Nicolas Frayer
2022-11-23 15:59   ` Vignesh Raghavendra
2022-11-23 17:33     ` Kevin Hilman [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=7ho7sx8tjm.fsf@baylibre.com \
    --to=khilman@baylibre.com \
    --cc=davem@davemloft.net \
    --cc=dmaengine@vger.kernel.org \
    --cc=edumazet@google.com \
    --cc=glaroque@baylibre.com \
    --cc=grygorii.strashko@ti.com \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nfrayer@baylibre.com \
    --cc=nm@ti.com \
    --cc=pabeni@redhat.com \
    --cc=peter.ujfalusi@gmail.com \
    --cc=ssantosh@kernel.org \
    --cc=vigneshr@ti.com \
    --cc=vkoul@kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).