lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <AM6PR08MB4376E34F5E143E2676271043FFC19@AM6PR08MB4376.eurprd08.prod.outlook.com>
Date:   Mon, 16 Jan 2023 19:19:28 +0000
From:   Pierluigi Passaro <pierluigi.p@...iscite.com>
To:     Alexander Stein <alexander.stein@...tq-group.com>,
        Andrew Lunn <andrew@...n.ch>,
        Pierluigi Passaro <pierluigi.passaro@...il.com>
CC:     "wei.fang@....com" <wei.fang@....com>,
        "shenwei.wang@....com" <shenwei.wang@....com>,
        "xiaoning.wang@....com" <xiaoning.wang@....com>,
        "linux-imx@....com" <linux-imx@....com>,
        "davem@...emloft.net" <davem@...emloft.net>,
        "edumazet@...gle.com" <edumazet@...gle.com>,
        "kuba@...nel.org" <kuba@...nel.org>,
        "pabeni@...hat.com" <pabeni@...hat.com>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Eran Matityahu <eran.m@...iscite.com>,
        Nate Drude <Nate.D@...iscite.com>,
        Francesco Ferraro <francesco.f@...iscite.com>
Subject: Re: [PATCH v2] net: fec: manage corner deferred probe condition

On Mon, Jan 16, 2023 at 8:35 AM Alexander Stein <alexander.stein@...tq-group.com> wrote:
> Hi,
>
> Am Sonntag, 15. Januar 2023, 23:23:51 CET schrieb Pierluigi Passaro:
> > On Sun, Jan 15, 2023 at 10:56 PM Andrew Lunn <andrew@...n.ch> wrote:
> > > On Sun, Jan 15, 2023 at 10:38:04PM +0100, Pierluigi Passaro wrote:
> > > > For dual fec interfaces, external phys can only be configured by fec0.
> > > > When the function of_mdiobus_register return -EPROBE_DEFER, the driver
> > > > is lately called to manage fec1, which wrongly register its mii_bus as
> > > > fec0_mii_bus.
> > > > When fec0 retry the probe, the previous assignement prevent the MDIO bus
> > > > registration.
> > > > Use a static boolean to trace the orginal MDIO bus deferred probe and
> > > > prevent further registrations until the fec0 registration completed
> > > > succesfully.
> > >
> > > The real problem here seems to be that fep->dev_id is not
> > > deterministic. I think a better fix would be to make the mdio bus name
> > > deterministic. Use pdev->id instead of fep->dev_id + 1. That is what
> > > most mdiobus drivers use.
> >
> > Actually, the sequence is deterministic, fec0 and then fec1,
> > but sometimes the GPIO of fec0 is not yet available.
>
> Not in every case though. On i.MX6UL has the following memory map for FEC:
> * FEC2: 0x020b4000
> * FEC1: 0x02188000
>
> Which essentially means that fec2 will be probed first.
>
This is actually the expected behaviour, by FEC0 I refer to the 1st instance of
FEC, no matter the alias used for it: apologizing for the misleading notation.
For iMX6UL, when both the FEC are present, the MDIO is owned by
fec@...20b4000, which is the 1st instance of FEC.
>
> > The EPROBE_DEFER does not prevent the second instance from being probed.
> > This is the origin of the problem.
>
> Is this the actual cause? There is also a problem in the case above if the
> MDIO controlling interface (fec2) is not probed first, e.g. using fec1 for
> MDIO access. But then again there is i.MX6ULG1 which only has fec1
> interface...
>
I'm not familiar with iMX6ULG1, but I would expect that its device tree disables
one of the 2 fec: this patch is relevant only for dual FEC configuration.
>
> Best regards,
> Alexander

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ