netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jose Abreu <Jose.Abreu@synopsys.com>
To: "Ondřej Jirman" <megi@xff.cz>, "Jose Abreu" <Jose.Abreu@synopsys.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	Joao Pinto <Joao.Pinto@synopsys.com>,
	"David S . Miller" <davem@davemloft.net>,
	Giuseppe Cavallaro <peppe.cavallaro@st.com>,
	Alexandre Torgue <alexandre.torgue@st.com>,
	Russell King <linux@armlinux.org.uk>,
	Andrew Lunn <andrew@lunn.ch>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Heiner Kallweit <hkallweit1@gmail.com>
Subject: RE: [PATCH net-next 0/3] net: stmmac: Convert to phylink
Date: Mon, 22 Jul 2019 13:28:51 +0000	[thread overview]
Message-ID: <BN8PR12MB32660B12F8E2617ED42249BBD3C40@BN8PR12MB3266.namprd12.prod.outlook.com> (raw)
In-Reply-To: <20190722124240.464e73losonwb356@core.my.home>

[-- Attachment #1: Type: text/plain, Size: 6856 bytes --]

From: Ondřej Jirman <megi@xff.cz>
Date: Jul/22/2019, 13:42:40 (UTC+00:00)

> Hello Jose,
> 
> On Tue, Jun 11, 2019 at 05:18:44PM +0200, Jose Abreu wrote:
> > [ Hope this diff looks better (generated with --minimal) ]
> > 
> > This converts stmmac to use phylink. Besides the code redution this will
> > allow to gain more flexibility.
> 
> I'm testing 5.3-rc1 and on Orange Pi 3 (uses stmmac-sun8i.c glue) compared to
> 5.2 it fails to detect 1000Mbps link and the driver negotiates just a 10Mbps speed.
> 
> After going through stmmac patches since 5.2, I think it may be realted to this
> series, but I'm not completely sure. You'll probably have a better understanding
> of the changes. Do you have an idea what might be wrong? Please, see some logs
> below.

Probably due to:
5b0d7d7da64b ("net: stmmac: Add the missing speeds that XGMAC supports")

Can you try attached patch ?


> 
> thank you and regards,
> 	Ondrej
> 
> On 5.3-rc1 I see:
> 
> [    6.116512] dwmac-sun8i 5020000.ethernet eth0: PHY [stmmac-0:01] driver [RTL8211E Gigabit Ethernet]
> [    6.116522] dwmac-sun8i 5020000.ethernet eth0: phy: setting supported 00,00000000,000062cf advertising 00,00000000,000062cf
> [    6.118714] dwmac-sun8i 5020000.ethernet eth0: No Safety Features support found
> [    6.118725] dwmac-sun8i 5020000.ethernet eth0: No MAC Management Counters available
> [    6.118730] dwmac-sun8i 5020000.ethernet eth0: PTP not supported by HW
> [    6.118738] dwmac-sun8i 5020000.ethernet eth0: configuring for phy/rgmii link mode
> [    6.118747] dwmac-sun8i 5020000.ethernet eth0: phylink_mac_config: mode=phy/rgmii/Unknown/Unknown adv=00,00000000,000062cf pause=10 link=0 an=1
> [    6.126099] dwmac-sun8i 5020000.ethernet eth0: phy link down rgmii/Unknown/Unknown
> [    6.276325] random: crng init done
> [    6.276338] random: 7 urandom warning(s) missed due to ratelimiting
> [    7.543987] zram0: detected capacity change from 0 to 402653184
> [    7.667702] Adding 393212k swap on /dev/zram0.  Priority:10 extents:1 across:393212k SS
> 
> ... delay due to other causes ...
> 
> [   28.640234] dwmac-sun8i 5020000.ethernet eth0: phy link up rgmii/10Mbps/Full
> [   28.640295] dwmac-sun8i 5020000.ethernet eth0: phylink_mac_config: mode=phy/rgmii/10Mbps/Full adv=00,00000000,00000000 pause=0f link=1 an=0
> [   28.640324] dwmac-sun8i 5020000.ethernet eth0: Link is Up - 10Mbps/Full - flow control rx/tx
> 
> Settings for eth0:
> 	Supported ports: [ TP MII ]
> 	Supported link modes:   10baseT/Half 10baseT/Full 
> 	                        100baseT/Half 100baseT/Full 
> 	Supported pause frame use: Symmetric Receive-only
> 	Supports auto-negotiation: Yes
> 	Supported FEC modes: Not reported
> 	Advertised link modes:  10baseT/Half 10baseT/Full 
> 	                        100baseT/Half 100baseT/Full 
> 	Advertised pause frame use: Symmetric Receive-only
> 	Advertised auto-negotiation: Yes
> 	Advertised FEC modes: Not reported
> 	Link partner advertised link modes:  10baseT/Half 10baseT/Full 
> 	Link partner advertised pause frame use: Symmetric Receive-only
> 	Link partner advertised auto-negotiation: Yes
> 	Link partner advertised FEC modes: Not reported
> 	Speed: 10Mb/s
> 	Duplex: Full
> 	Port: MII
> 	PHYAD: 1
> 	Transceiver: internal
> 	Auto-negotiation: on
> 	Supports Wake-on: d
> 	Wake-on: d
> 	Current message level: 0x0000003f (63)
> 			       drv probe link timer ifdown ifup
> 	Link detected: yes
> 
> On 5.2 it looks like this:
> 
> [    1.153596] dwmac-sun8i 5020000.ethernet: PTP uses main clock
> [    1.416221] dwmac-sun8i 5020000.ethernet: PTP uses main clock
> [    1.522735] dwmac-sun8i 5020000.ethernet: Current syscon value is not the default 58000 (expect 50000)
> [    1.522750] dwmac-sun8i 5020000.ethernet: No HW DMA feature register supported
> [    1.522753] dwmac-sun8i 5020000.ethernet: RX Checksum Offload Engine supported
> [    1.522755] dwmac-sun8i 5020000.ethernet: COE Type 2
> [    1.522758] dwmac-sun8i 5020000.ethernet: TX Checksum insertion supported
> [    1.522761] dwmac-sun8i 5020000.ethernet: Normal descriptors
> [    1.522763] dwmac-sun8i 5020000.ethernet: Chain mode enabled
> [    5.352833] dwmac-sun8i 5020000.ethernet eth0: No Safety Features support found
> [    5.352842] dwmac-sun8i 5020000.ethernet eth0: No MAC Management Counters available
> [    5.352846] dwmac-sun8i 5020000.ethernet eth0: PTP not supported by HW
> [   10.463072] dwmac-sun8i 5020000.ethernet eth0: Link is Up - 1Gbps/Full - flow control off
> 
> Settings for eth0:
> 	Supported ports: [ TP MII ]
> 	Supported link modes:   10baseT/Half 10baseT/Full
> 	                        100baseT/Half 100baseT/Full
> 	                        1000baseT/Half 1000baseT/Full
> 	Supported pause frame use: Symmetric Receive-only
> 	Supports auto-negotiation: Yes
> 	Supported FEC modes: Not reported
> 	Advertised link modes:  10baseT/Half 10baseT/Full
> 	                        100baseT/Half 100baseT/Full
> 	                        1000baseT/Half 1000baseT/Full
> 	Advertised pause frame use: No
> 	Advertised auto-negotiation: Yes
> 	Advertised FEC modes: Not reported
> 	Link partner advertised link modes:  10baseT/Half 10baseT/Full
> 	                                     100baseT/Half 100baseT/Full
> 	                                     1000baseT/Full
> 	Link partner advertised pause frame use: Symmetric Receive-only
> 	Link partner advertised auto-negotiation: Yes
> 	Link partner advertised FEC modes: Not reported
> 	Speed: 1000Mb/s
> 	Duplex: Full
> 	Port: MII
> 	PHYAD: 1
> 	Transceiver: internal
> 	Auto-negotiation: on
> 	Supports Wake-on: d
> 	Wake-on: d
> 	Current message level: 0x0000003f (63)
> 			       drv probe link timer ifdown ifup
> 	Link detected: yes
> 
> 
> > Cc: Joao Pinto <jpinto@synopsys.com>
> > Cc: David S. Miller <davem@davemloft.net>
> > Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>
> > Cc: Alexandre Torgue <alexandre.torgue@st.com>
> > Cc: Russell King <linux@armlinux.org.uk>
> > Cc: Andrew Lunn <andrew@lunn.ch>
> > Cc: Florian Fainelli <f.fainelli@gmail.com>
> > Cc: Heiner Kallweit <hkallweit1@gmail.com>
> > 
> > Jose Abreu (3):
> >   net: stmmac: Prepare to convert to phylink
> >   net: stmmac: Start adding phylink support
> >   net: stmmac: Convert to phylink and remove phylib logic
> > 
> >  drivers/net/ethernet/stmicro/stmmac/Kconfig   |   3 +-
> >  drivers/net/ethernet/stmicro/stmmac/stmmac.h  |   7 +-
> >  .../ethernet/stmicro/stmmac/stmmac_ethtool.c  |  81 +---
> >  .../net/ethernet/stmicro/stmmac/stmmac_main.c | 391 ++++++++----------
> >  .../ethernet/stmicro/stmmac/stmmac_platform.c |  21 +-
> >  5 files changed, 190 insertions(+), 313 deletions(-)
> > 
> > -- 
> > 2.21.0
> > 


---
Thanks,
Jose Miguel Abreu

[-- Attachment #2: 0001-net-stmmac-Do-not-cut-down-1G-modes.patch --]
[-- Type: application/octet-stream, Size: 2316 bytes --]

From 6e94caa3b518735c8c637d58ef76cb1aabac6e09 Mon Sep 17 00:00:00 2001
Message-Id: <6e94caa3b518735c8c637d58ef76cb1aabac6e09.1563802080.git.joabreu@synopsys.com>
From: Jose Abreu <joabreu@synopsys.com>
Date: Mon, 22 Jul 2019 15:26:15 +0200
Subject: [PATCH net] net: stmmac: Do not cut down 1G modes
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Some glue logic drivers support 1G without having GMAC/GMAC4/XGMAC.

Let's allow this speed by default.

Reported-by: Ondřej Jirman <megi@xff.cz>
Fixes: 5b0d7d7da64b ("net: stmmac: Add the missing speeds that XGMAC supports")
Signed-off-by: Jose Abreu <joabreu@synopsys.com>

---
Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Cc: Alexandre Torgue <alexandre.torgue@st.com>
Cc: Jose Abreu <joabreu@synopsys.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>
Cc: netdev@vger.kernel.org
Cc: linux-stm32@st-md-mailman.stormreply.com
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 207c3755bcc5..b0d5e5346597 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -814,20 +814,15 @@ static void stmmac_validate(struct phylink_config *config,
 	phylink_set(mac_supported, 10baseT_Full);
 	phylink_set(mac_supported, 100baseT_Half);
 	phylink_set(mac_supported, 100baseT_Full);
+	phylink_set(mac_supported, 1000baseT_Half);
+	phylink_set(mac_supported, 1000baseT_Full);
+	phylink_set(mac_supported, 1000baseKX_Full);
 
 	phylink_set(mac_supported, Autoneg);
 	phylink_set(mac_supported, Pause);
 	phylink_set(mac_supported, Asym_Pause);
 	phylink_set_port_modes(mac_supported);
 
-	if (priv->plat->has_gmac ||
-	    priv->plat->has_gmac4 ||
-	    priv->plat->has_xgmac) {
-		phylink_set(mac_supported, 1000baseT_Half);
-		phylink_set(mac_supported, 1000baseT_Full);
-		phylink_set(mac_supported, 1000baseKX_Full);
-	}
-
 	/* Cut down 1G if asked to */
 	if ((max_speed > 0) && (max_speed < 1000)) {
 		phylink_set(mask, 1000baseT_Full);
-- 
2.7.4


  reply	other threads:[~2019-07-22 13:29 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-11 15:18 [PATCH net-next 0/3] net: stmmac: Convert to phylink Jose Abreu
2019-06-11 15:18 ` [PATCH net-next 1/3] net: stmmac: Prepare to convert " Jose Abreu
2019-06-11 15:18 ` [PATCH net-next 2/3] net: stmmac: Start adding phylink support Jose Abreu
2019-06-11 15:35   ` Russell King - ARM Linux admin
2019-06-11 15:40     ` Jose Abreu
2019-06-11 15:18 ` [PATCH net-next 3/3] net: stmmac: Convert to phylink and remove phylib logic Jose Abreu
2019-06-18  9:30   ` Jon Hunter
2019-06-18  9:35     ` Jose Abreu
2019-06-18  9:42       ` Jon Hunter
2019-06-18  9:46         ` Jose Abreu
2019-06-18 10:18           ` Jon Hunter
2019-06-18 15:20             ` Jon Hunter
2019-06-18 19:44               ` Jon Hunter
2019-06-20 14:05                 ` Jon Hunter
2019-06-25  7:37                   ` Jose Abreu
2019-06-25 11:10                     ` Jon Hunter
2019-06-25 11:25                       ` Jose Abreu
2019-06-13 21:02 ` [PATCH net-next 0/3] net: stmmac: Convert to phylink David Miller
2019-06-14 13:40 ` Corentin Labbe
2019-06-14 14:45   ` Jose Abreu
2019-07-22 12:42 ` Ondřej Jirman
2019-07-22 13:28   ` Jose Abreu [this message]
2019-07-22 13:40     ` Andrew Lunn
2019-07-22 13:58       ` Jose Abreu
2019-07-22 14:19         ` Andrew Lunn
2019-07-22 14:26           ` Jose Abreu
2019-07-22 14:39             ` Ondřej Jirman
2019-07-23  9:36               ` Jose Abreu
2019-07-22 13:49     ` Ondřej Jirman

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=BN8PR12MB32660B12F8E2617ED42249BBD3C40@BN8PR12MB3266.namprd12.prod.outlook.com \
    --to=jose.abreu@synopsys.com \
    --cc=Joao.Pinto@synopsys.com \
    --cc=alexandre.torgue@st.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=hkallweit1@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=megi@xff.cz \
    --cc=netdev@vger.kernel.org \
    --cc=peppe.cavallaro@st.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;
as well as URLs for NNTP newsgroup(s).