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: <5851b137-2a3f-f8b3-cd0a-6efc2b7df67d@televic.com>
Date:   Mon, 9 Dec 2019 08:57:24 +0100
From:   Jürgen Lambrecht <j.lambrecht@...evic.com>
To:     Andrew Lunn <andrew@...n.ch>
Cc:     "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        rasmus.villemoes@...vas.dk,
        Thomas Petazzoni <thomas.petazzoni@...tlin.com>,
        vivien.didelot@...il.com,
        Antoine Ténart <antoine.tenart@...tlin.com>
Subject: Re: net: dsa: mv88e6xxx: error parsing ethernet node from dts

On 12/4/19 6:13 PM, Andrew Lunn wrote:
> CAUTION: This Email originated from outside Televic. Do not click links or open attachments unless you recognize the sender and know the content is safe.
>
>
> On Wed, Dec 04, 2019 at 05:20:04PM +0100, Jürgen Lambrecht wrote:
>> On 12/4/19 4:38 PM, Andrew Lunn wrote:
>>>> Here parts of dmesg (no error reported):
>>>>
>>>> [    1.992342] libphy: Fixed MDIO Bus: probed
>>>> [    2.009532] pps pps0: new PPS source ptp0
>>>> [    2.014387] libphy: fec_enet_mii_bus: probed
>>>> [    2.017159] mv88e6085 2188000.ethernet-1:00: switch 0x710 detected: Marvell 88E6071, revision 5
>>>> [    2.125616] libphy: mv88e6xxx SMI: probed
>>>> [    2.134450] fec 2188000.ethernet eth0: registered PHC device 0
>>>> ...
>>>> [   11.366359] Generic PHY fixed-0:00: attached PHY driver [Generic PHY] (mii_bus:phy_addr=fixed-0:00, irq=POLL)
>>>> [   11.366722] fec 2188000.ethernet eth0: Link is Up - 100Mbps/Full - flow control off
>>>>
>>>> When I enable debugging in the source code, I see that mv88e6xxx_probe() fails, because *'of_find_net_device_by_node(ethernet);'* fails. But why?,
>>> That always happens the first time. There is a chicken/egg
>>> problem. The MDIO bus is registered by the FEC driver, the switch is
>>> probed, and the DSA core looks for the ethernet interface. But the FEC
>>> driver has not yet registered the interface, it is still busy
>>> registering the MDIO bus. So you get an EPRODE_DEFFER from the switch
>>> probe. The FEC then completes its probe, registering the
>>> interface. Sometime later Linux retries the switch probe, and this
>>> time it works.
>>>
>>> What you are seeing here is the first attempt. There should be a
>>> second go later in the log.
>>>
>>>        Andrew
>> Indeed, but that also fails because this second time, reading the
>> switch ID (macreg 3 at addr 8) fails, it returns 0x0000!??
> So this is the real problem.
>
> Try removing the reset GPIO line from DT. If there is an EEPROM, and
> the EEPROM contains a lot of instructions, we have seen it take a long
> time to reset, load the EEPROM, and then start responding on the MDIO
> bus. If you take away the GPIO, it will only do a software reset,
> which is much faster. Even if you don't have an EEPROM, it is worth a
> try.
No didn't help
>
> But returning 0x0000 is odd. Normally, if an MDIO device does not
> respond, you read 0xffff, because of the pull up resistor on the bus.
Indeed
>
> The fact you find it once means it is something like this, some minor
> configuration problem, power management, etc.
>
>          Andrew

Thanks. I will have to look further in that direction. There must be sth obvious that I don't see.

A strange thing to me however is why - in my dts and in vf610-zii-ssmb-spu3.dts - there is 2 times a 'fixed-link' declaration? Moreover, when I omit the first declaration, the kernel crashes (oops).

I have the impression the first 'fixed-link' is used at the end of booting (at 11s, see first email) to configure the kernel in a fixed-phy configuration without a switch in between - and maybe that is the obvious that I don't see: why that fixed-phy config happens there, and even more, why does the kernel crash if it cannot config when I omit the info from dts?

I checked the kernel menuconfig, and there are fixed-phy configs enabled, but I cannot disable them, because they are selected by the DSA and freescale configs:

FIXED_PHY <= OF_MDIO [=y] && OF [=y] && PHYLIB [=y]
  PHYLIB <= FEC ... & ARCH_MXC
         <= PHYLINK && NETDEVICES
              PHYLINK <= NET_DSA && NET && HAVE_NET_DSA

Kind regards,

Jürgen


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ