From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pavel Machek Subject: Re: [PATCH net-next 1/1] net: dsa: microchip: Add Microchip KSZ8895 DSA driver Date: Thu, 14 Dec 2017 22:12:20 +0100 Message-ID: <20171214211220.GB31098@amd> References: <1510886597-5666-1-git-send-email-Tristram.Ha@microchip.com> <1510886597-5666-2-git-send-email-Tristram.Ha@microchip.com> <20171120105609.GA4460@amd> <93AF473E2DA327428DE3D46B72B1E9FD4113DCE0@CHN-SV-EXMX02.mchp-main.com> <20171207210448.GA16614@amd> <93AF473E2DA327428DE3D46B72B1E9FD4113EACE@CHN-SV-EXMX02.mchp-main.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="0ntfKIWw70PvrIHh" Cc: andrew@lunn.ch, f.fainelli@gmail.com, muvarov@gmail.com, nathan.leigh.conrad@gmail.com, vivien.didelot@savoirfairelinux.com, UNGLinuxDriver@microchip.com, netdev@vger.kernel.org To: Tristram.Ha@microchip.com Return-path: Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:57114 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753349AbdLNVMW (ORCPT ); Thu, 14 Dec 2017 16:12:22 -0500 Content-Disposition: inline In-Reply-To: <93AF473E2DA327428DE3D46B72B1E9FD4113EACE@CHN-SV-EXMX02.mchp-main.com> Sender: netdev-owner@vger.kernel.org List-ID: --0ntfKIWw70PvrIHh Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! Thanks for the support. > > root@miro:~# mii-tool lan3 > > lan3: negotiated 1000baseT-HD flow-control, link ok > >=20 > > But IIRC the switch is 100mbit? And dmesg does get it right. Its just > > mii-tool that is confused. > >=20 > > Link detection seems to work > >=20 > > root@miro:/sys/bus/spi/devices/spi2.0# mii-tool lan1 > > lan1: negotiated 1000baseT-HD flow-control, link ok > > root@miro:/sys/bus/spi/devices/spi2.0# mii-tool lan1 > > lan1: no link > >=20 > > (But that really should be 100baseT, not 1000baseT). >=20 > ethtool lan3 should also report the correct setting. Yes, after port is configured, ethtool produces right results: Speed: 100Mb/s Duplex: Full Before that, it looks rather confusing: root@miro:~# ethtool lan2 root@miro:~# ethtool lan2 Settings for lan2: =2E.. Speed: Unknown! Duplex: Unknown! (255) =20 > > Is there register dump available somewhere? I was using > > /sys/bus/spi/devices/spi32766.0/registers but this does not seem to be > > available. >=20 > There is a patch to add that functionality. It is very simple and I will= send it > to you later. Without that it is hard to debug the DSA driver if there is > something wrong. That would be nice :-). > I also have a simple utility to communicate with that registers file to r= ead/write > register individually. Is there a standard Linux utility for that > function? I don't think standard utility exists. Binary file which can be written by userspace shoudl be enough. > > p04_rx: 660 > > p04_rx_hi: 0 > > p04_rx_undersize: 0 > > p04_rx_fragments: 20 >=20 > This indicates a problem with the MAC. Are you using a MII or RMII versi= on? I do have: mac0: ethernet@800f0000 { phy-mode =3D "rmii"; pinctrl-names =3D "default"; ... } > > p04_tx_hi: 0 > > p04_tx_late_col: 0 > > p04_tx_pause: 0 > > p04_tx_bcast: 0 > > p04_tx_mcast: 3 >=20 > This indicates the host port tried to send frames to the MAC. > > tx_total_col: 0 > > tx_exc_col: 0 > > tx_single_col: 0 > > tx_mult_col: 0 > > rx_discards: 0 > > tx_discards: 0 >=20 > They just reported frames are received from the port. Because of problem= with > the host port there is no transmission coming from the host port. I disabled second ethernet port in the dts so it could not interfere with testing, butno change. Is there any way to debug the host port problems? I do have spi@0 { compatible =3D "microchip,ksz8895"; ... ports { port@4 { reg =3D <4>; label =3D "cpu"; ethernet =3D <&mac0>; fixed-link { speed =3D <100>; full-duplex; }; }; }; }; On one side, and mac0: ethernet@800f0000 { phy-mode =3D "rmii"; status =3D "okay"; fixed-link { speed =3D <100>; full-duplex; }; }; on the other... Thanks, Pavel =20 --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --0ntfKIWw70PvrIHh Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAloy6TQACgkQMOfwapXb+vJlZgCguQsfAB81ncRaXZHxN9HYVXnb +m8AoMI2XZoh/WfbY7uirWiSw5ZP5LUr =mTi9 -----END PGP SIGNATURE----- --0ntfKIWw70PvrIHh--