mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Sverdlin, Alexander" <alexander.sverdlin@siemens.com>
To: "wei.fang@nxp.com" <wei.fang@nxp.com>, "andrew@lunn.ch" <andrew@lunn.ch>
Cc: "xiaoning.wang@nxp.com" <xiaoning.wang@nxp.com>,
	"shenwei.wang@nxp.com" <shenwei.wang@nxp.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-imx@nxp.com" <linux-imx@nxp.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] net: fec: Defer probe if other FEC has deferred MDIO
Date: Thu, 9 Feb 2023 10:10:58 +0000	[thread overview]
Message-ID: <60f22dab4c51ee7e1a62d91c64e55205c18b9265.camel@siemens.com> (raw)
In-Reply-To: <DB9PR04MB81063375BAC5F0B9CBBB6A0D88D99@DB9PR04MB8106.eurprd04.prod.outlook.com>

Hello Wei,

On Thu, 2023-02-09 at 09:17 +0000, Wei Fang wrote:
> > > > -       if ((fep->quirks & FEC_QUIRK_SINGLE_MDIO) && fep-
> > > > >dev_id >
> > > > 0) {
> > > > +       if (fep->quirks & FEC_QUIRK_SINGLE_MDIO) {
> > > >                 /* fec1 uses fec0 mii_bus */
> > > >                 if (mii_cnt && fec0_mii_bus) {
> > > >                         fep->mii_bus = fec0_mii_bus;
> > > >                         mii_cnt++;
> > > >                         return 0;
> > > >                 }
> > > > -               return -ENOENT;
> > > 
> > > Could you not add an else clause here? return -EPROBE_DEFFER?
> > > 
> > > Basically, if fec0 has not probed, deffer the probing of fec1?
> > 
> > we do have a configuration with i.MX8 where we have only fec2
> > enabled (and
> > has mdio node).
> > I'm not sure if it was thought of by fec driver developers (it
> > makes a lot of
> > non-obvious assumtions), but that's how it works now.
> > 
> 
> Hi Alexander,
> 
> This issue seems that the fec2 (without mdio subnode) registers
> mii_bus first, then
> the fec1 (has mdio subnode) use the fec2's mii_bus when fec1 probes
> again, finally
> both fec1 and fec2 can not connect to PHY. Am I right?

yes, this is exactly what happens (except that we have more than one
PHY in this mdio node, which is then not registered/parsed).

> If so, I think this issue can't be reproduced on the upstream tree,
> because the quirks of
> i.MX8 on the upstream tree do not set the FEC_QUIRK_SINGLE_MDIO bit.
> So, the fec1
> will registers a mii_bus in your case rather than using the fec2's
> mii_bus. I'm a bit curious
> that have you tried to reproduce this issue base on the upstream
> tree?

You are right, there is unfortunately no i.MX8 support in the upstream
tree, so it's not possible to reproduce anything. Just wanted to
discuss the probe concept of this driver, which is rather fragile
with all there static local variables, probe call counters and relying
on the probe order. All of this falls together like a house of cards
if something gets deferred.

-- 
Alexander Sverdlin
Siemens AG
www.siemens.com

  reply	other threads:[~2023-02-09 10:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-08 10:18 A. Sverdlin
2023-02-09  0:55 ` Andrew Lunn
2023-02-09  7:27   ` Sverdlin, Alexander
2023-02-09  9:17     ` Wei Fang
2023-02-09 10:10       ` Sverdlin, Alexander [this message]
2023-02-09 13:35         ` Andrew Lunn
2023-02-09 14:14           ` Sverdlin, Alexander

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=60f22dab4c51ee7e1a62d91c64e55205c18b9265.camel@siemens.com \
    --to=alexander.sverdlin@siemens.com \
    --cc=andrew@lunn.ch \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=shenwei.wang@nxp.com \
    --cc=wei.fang@nxp.com \
    --cc=xiaoning.wang@nxp.com \
    /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

all inboxes | Powered by JetHome®