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: <87zgaiz4nt.fsf@miraculix.mork.no>
Date:   Mon, 16 Jan 2023 19:59:50 +0100
From:   Bjørn Mork <bjorn@...k.no>
To:     "Russell King (Oracle)" <linux@...linux.org.uk>
Cc:     Frank Wunderlich <frank-w@...lic-files.de>,
        Frank Wunderlich <linux@...web.de>,
        linux-mediatek@...ts.infradead.org,
        Alexander Couzens <lynxis@...0.eu>,
        Felix Fietkau <nbd@....name>, John Crispin <john@...ozen.org>,
        Sean Wang <sean.wang@...iatek.com>,
        Mark Lee <Mark-MC.Lee@...iatek.com>,
        "David S. Miller" <davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>,
        Matthias Brugger <matthias.bgg@...il.com>,
        netdev@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] net: mtk_sgmii: implement mtk_pcs_ops

"Russell King (Oracle)" <linux@...linux.org.uk> writes:

> On Mon, Jan 16, 2023 at 07:30:27PM +0100, Bjørn Mork wrote:
>> "Russell King (Oracle)" <linux@...linux.org.uk> writes:
>> 
>> > That all looks fine. However, I'm running out of ideas.
>> 
>> Thanks a lot for the effort in any case.  It's comforting that even the
>> top experts can't figure out this one :-)
>> 
>> 
>> > What we seem to have is:
>> >
>> > PHY:
>> > VSPEC1_SGMII_CTRL = 0x34da
>> > VSPEC1_SGMII_STAT = 0x000e
>> >
>> > The PHY is programmed to exchange SGMII with the host PCS, and it
>> > says that it hasn't completed that exchange (bit 5 of STAT).
>> >
>> > The Mediatek PCS says:
>> > BMCR = 0x1140		AN enabled
>> > BMSR = 0x0008		AN capable
>> > ADVERTISE = 0x0001	SGMII response (bit 14 is clear, hardware is
>> > 			supposed to manage that bit)
>> > LPA = 0x0000		SGMII received control word (nothing)
>> > SGMII_MODE = 0x011b	SGMII mode, duplex AN, 1000M, Full duplex,
>> > 			Remote fault disable
>> >
>> > which all looks like it should work - but it isn't.
>> >
>> > One last thing I can think of trying at the moment would be writing
>> > the VSPEC1_SGMII_CTRL with 0x36da, setting bit 9 which allegedly
>> > restarts the SGMII exchange. There's some comments in the PHY driver
>> > that this may be needed - maybe it's necessary once the MAC's PCS
>> > has been switched to SGMII mode.
>> 
>> 
>> Tried that now.  Didn't change anything.  And still no packets.
>> 
>> root@...nWrt:/# mdio mdio-bus 6:30 raw 8
>> 0x34da
>> root@...nWrt:/# mdio mdio-bus 6:30 raw 9
>> 0x000e
>> root@...nWrt:/# mdio mdio-bus 6:30 raw 8 0x36da
>> root@...nWrt:/# mdio mdio-bus 6:30 raw 8
>> 0x34da
>> root@...nWrt:/# mdio mdio-bus 6:30 raw 9
>> 0x000e
>
> If bit 9 is indeed the restart-an bit, it will be self-clearing, so
> I wouldn't expect a read back of it to change to 0x36da.
>
> I guess next thing to try is clearing and setting the AN enable bit,
> bit 12, so please try this:
>
> mdio mdio-bus 6:30 raw 8 0x24da
> mdio mdio-bus 6:30 raw 8 0x36da
> mdio mdio-bus 6:30 raw 9
>
> If that doesn't work, then let's try something a bit harder:
>
> mdio mdio-bus 6:30 raw 8 0xb4da
> mdio mdio-bus 6:30 raw 9
>
> Please let me know the results from those.

OK, back to the original dts with phy-mode = "2500base-x", with peer set
to 1G.  Still no success:

root@...nWrt:/# mdio mdio-bus 6:30 raw 8
0x34da
root@...nWrt:/# mdio mdio-bus 6:30 raw 9
0x000e
root@...nWrt:/#  mdio mdio-bus 6:30 raw 8 0x24da
root@...nWrt:/# mdio mdio-bus 6:30 raw 8 0x36da
root@...nWrt:/# mdio mdio-bus 6:30 raw 9
0x000e
root@...nWrt:/# mdio mdio-bus 6:30 raw 8 0xb4da
root@...nWrt:/# mdio mdio-bus 6:30 raw 9
0x000e



Bjørn

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ