* [[PATCH,net]] net: dsa: mt7530: Change the LINK bit to reflect the link status
@ 2020-03-19 13:47 René van Dorst
2020-03-19 16:41 ` Vivien Didelot
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: René van Dorst @ 2020-03-19 13:47 UTC (permalink / raw)
To: netdev
Cc: Frank Wunderlich, DENG Qingfang, Landen Chao, Sean Wang,
Andrew Lunn, Vivien Didelot, Florian Fainelli, David S. Miller,
Matthias Brugger, Russell King, linux-mediatek,
René van Dorst, Andrew Smith
Andrew reported:
After a number of network port link up/down changes, sometimes the switch
port gets stuck in a state where it thinks it is still transmitting packets
but the cpu port is not actually transmitting anymore. In this state you
will see a message on the console
"mtk_soc_eth 1e100000.ethernet eth0: transmit timed out" and the Tx counter
in ifconfig will be incrementing on virtual port, but not incrementing on
cpu port.
The issue is that MAC TX/RX status has no impact on the link status or
queue manager of the switch. So the queue manager just queues up packets
of a disabled port and sends out pause frames when the queue is full.
Change the LINK bit to reflect the link status.
Fixes: b8f126a8d543 ("net-next: dsa: add dsa support for Mediatek MT7530 switch")
Reported-by: Andrew Smith <andrew.smith@digi.com>
Signed-off-by: René van Dorst <opensource@vdorst.com>
---
drivers/net/dsa/mt7530.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/dsa/mt7530.c b/drivers/net/dsa/mt7530.c
index 9ee3f263d529..d422d3d6a129 100644
--- a/drivers/net/dsa/mt7530.c
+++ b/drivers/net/dsa/mt7530.c
@@ -566,7 +566,7 @@ mt7530_mib_reset(struct dsa_switch *ds)
static void
mt7530_port_set_status(struct mt7530_priv *priv, int port, int enable)
{
- u32 mask = PMCR_TX_EN | PMCR_RX_EN;
+ u32 mask = PMCR_TX_EN | PMCR_RX_EN | PMCR_FORCE_LNK;
if (enable)
mt7530_set(priv, MT7530_PMCR_P(port), mask);
@@ -1512,7 +1512,7 @@ static void mt7530_phylink_mac_config(struct dsa_switch *ds, int port,
mcr_new &= ~(PMCR_FORCE_SPEED_1000 | PMCR_FORCE_SPEED_100 |
PMCR_FORCE_FDX | PMCR_TX_FC_EN | PMCR_RX_FC_EN);
mcr_new |= PMCR_IFG_XMIT(1) | PMCR_MAC_MODE | PMCR_BACKOFF_EN |
- PMCR_BACKPR_EN | PMCR_FORCE_MODE | PMCR_FORCE_LNK;
+ PMCR_BACKPR_EN | PMCR_FORCE_MODE;
/* Are we connected to external phy */
if (port == 5 && dsa_is_user_port(ds, 5))
--
2.25.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [[PATCH,net]] net: dsa: mt7530: Change the LINK bit to reflect the link status
2020-03-19 13:47 [[PATCH,net]] net: dsa: mt7530: Change the LINK bit to reflect the link status René van Dorst
@ 2020-03-19 16:41 ` Vivien Didelot
2020-03-19 20:34 ` René van Dorst
2020-03-19 16:43 ` Florian Fainelli
2020-03-20 4:11 ` David Miller
2 siblings, 1 reply; 5+ messages in thread
From: Vivien Didelot @ 2020-03-19 16:41 UTC (permalink / raw)
To: René van Dorst
Cc: netdev, Frank Wunderlich, DENG Qingfang, Landen Chao, Sean Wang,
Andrew Lunn, Florian Fainelli, David S. Miller, Matthias Brugger,
Russell King, linux-mediatek, René van Dorst, Andrew Smith
Hi René,
On Thu, 19 Mar 2020 14:47:56 +0100, René van Dorst <opensource@vdorst.com> wrote:
> Andrew reported:
>
> After a number of network port link up/down changes, sometimes the switch
> port gets stuck in a state where it thinks it is still transmitting packets
> but the cpu port is not actually transmitting anymore. In this state you
> will see a message on the console
> "mtk_soc_eth 1e100000.ethernet eth0: transmit timed out" and the Tx counter
> in ifconfig will be incrementing on virtual port, but not incrementing on
> cpu port.
>
> The issue is that MAC TX/RX status has no impact on the link status or
> queue manager of the switch. So the queue manager just queues up packets
> of a disabled port and sends out pause frames when the queue is full.
>
> Change the LINK bit to reflect the link status.
>
> Fixes: b8f126a8d543 ("net-next: dsa: add dsa support for Mediatek MT7530 switch")
> Reported-by: Andrew Smith <andrew.smith@digi.com>
> Signed-off-by: René van Dorst <opensource@vdorst.com>
Reviewed-by: Vivien Didelot <vivien.didelot@gmail.com>
For the subject prefix, it is preferable to use "[PATCH net]" over
"[[PATCH,net]]". You can easily add this bracketed prefix with git
format-patch's option --subject-prefix="PATCH net".
Thank you,
Vivien
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [[PATCH,net]] net: dsa: mt7530: Change the LINK bit to reflect the link status
2020-03-19 16:41 ` Vivien Didelot
@ 2020-03-19 20:34 ` René van Dorst
0 siblings, 0 replies; 5+ messages in thread
From: René van Dorst @ 2020-03-19 20:34 UTC (permalink / raw)
To: Vivien Didelot
Cc: netdev, Frank Wunderlich, DENG Qingfang, Landen Chao, Sean Wang,
Andrew Lunn, Florian Fainelli, David S. Miller, Matthias Brugger,
Russell King, linux-mediatek, Andrew Smith
Quoting Vivien Didelot <vivien.didelot@gmail.com>:
> Hi René,
>
> On Thu, 19 Mar 2020 14:47:56 +0100, René van Dorst
> <opensource@vdorst.com> wrote:
>> Andrew reported:
>>
>> After a number of network port link up/down changes, sometimes the switch
>> port gets stuck in a state where it thinks it is still transmitting packets
>> but the cpu port is not actually transmitting anymore. In this state you
>> will see a message on the console
>> "mtk_soc_eth 1e100000.ethernet eth0: transmit timed out" and the Tx counter
>> in ifconfig will be incrementing on virtual port, but not incrementing on
>> cpu port.
>>
>> The issue is that MAC TX/RX status has no impact on the link status or
>> queue manager of the switch. So the queue manager just queues up packets
>> of a disabled port and sends out pause frames when the queue is full.
>>
>> Change the LINK bit to reflect the link status.
>>
>> Fixes: b8f126a8d543 ("net-next: dsa: add dsa support for Mediatek
>> MT7530 switch")
>> Reported-by: Andrew Smith <andrew.smith@digi.com>
>> Signed-off-by: René van Dorst <opensource@vdorst.com>
>
Hi Vivien,
> Reviewed-by: Vivien Didelot <vivien.didelot@gmail.com>
>
> For the subject prefix, it is preferable to use "[PATCH net]" over
> "[[PATCH,net]]". You can easily add this bracketed prefix with git
> format-patch's option --subject-prefix="PATCH net".
Thanks for reviewing.
Funny is that I used subject-prefix option but I with the brackets.
Like --subject-prefix="[PATCH,net]" but not realizing that git also
add brackets. I didn't noticed until I got an email back from the
mailinglist that it had double brackets.
Next time I use "[PATCH net]".
Great,
René
>
>
> Thank you,
>
> Vivien
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [[PATCH,net]] net: dsa: mt7530: Change the LINK bit to reflect the link status
2020-03-19 13:47 [[PATCH,net]] net: dsa: mt7530: Change the LINK bit to reflect the link status René van Dorst
2020-03-19 16:41 ` Vivien Didelot
@ 2020-03-19 16:43 ` Florian Fainelli
2020-03-20 4:11 ` David Miller
2 siblings, 0 replies; 5+ messages in thread
From: Florian Fainelli @ 2020-03-19 16:43 UTC (permalink / raw)
To: René van Dorst, netdev
Cc: Frank Wunderlich, DENG Qingfang, Landen Chao, Sean Wang,
Andrew Lunn, Vivien Didelot, David S. Miller, Matthias Brugger,
Russell King, linux-mediatek, Andrew Smith
Le 2020-03-19 à 06:47, René van Dorst a écrit :
> Andrew reported:
>
> After a number of network port link up/down changes, sometimes the switch
> port gets stuck in a state where it thinks it is still transmitting packets
> but the cpu port is not actually transmitting anymore. In this state you
> will see a message on the console
> "mtk_soc_eth 1e100000.ethernet eth0: transmit timed out" and the Tx counter
> in ifconfig will be incrementing on virtual port, but not incrementing on
> cpu port.
>
> The issue is that MAC TX/RX status has no impact on the link status or
> queue manager of the switch. So the queue manager just queues up packets
> of a disabled port and sends out pause frames when the queue is full.
>
> Change the LINK bit to reflect the link status.
>
> Fixes: b8f126a8d543 ("net-next: dsa: add dsa support for Mediatek MT7530 switch")
> Reported-by: Andrew Smith <andrew.smith@digi.com>
> Signed-off-by: René van Dorst <opensource@vdorst.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
--
Florian
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [[PATCH,net]] net: dsa: mt7530: Change the LINK bit to reflect the link status
2020-03-19 13:47 [[PATCH,net]] net: dsa: mt7530: Change the LINK bit to reflect the link status René van Dorst
2020-03-19 16:41 ` Vivien Didelot
2020-03-19 16:43 ` Florian Fainelli
@ 2020-03-20 4:11 ` David Miller
2 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2020-03-20 4:11 UTC (permalink / raw)
To: opensource
Cc: netdev, frank-w, dqfext, landen.chao, sean.wang, andrew,
vivien.didelot, f.fainelli, matthias.bgg, linux, linux-mediatek,
andrew.smith
From: René van Dorst <opensource@vdorst.com>
Date: Thu, 19 Mar 2020 14:47:56 +0100
> Andrew reported:
>
> After a number of network port link up/down changes, sometimes the switch
> port gets stuck in a state where it thinks it is still transmitting packets
> but the cpu port is not actually transmitting anymore. In this state you
> will see a message on the console
> "mtk_soc_eth 1e100000.ethernet eth0: transmit timed out" and the Tx counter
> in ifconfig will be incrementing on virtual port, but not incrementing on
> cpu port.
>
> The issue is that MAC TX/RX status has no impact on the link status or
> queue manager of the switch. So the queue manager just queues up packets
> of a disabled port and sends out pause frames when the queue is full.
>
> Change the LINK bit to reflect the link status.
>
> Fixes: b8f126a8d543 ("net-next: dsa: add dsa support for Mediatek MT7530 switch")
> Reported-by: Andrew Smith <andrew.smith@digi.com>
> Signed-off-by: René van Dorst <opensource@vdorst.com>
Applied and queued up for -stable, thanks.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2020-03-20 4:11 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-19 13:47 [[PATCH,net]] net: dsa: mt7530: Change the LINK bit to reflect the link status René van Dorst
2020-03-19 16:41 ` Vivien Didelot
2020-03-19 20:34 ` René van Dorst
2020-03-19 16:43 ` Florian Fainelli
2020-03-20 4:11 ` David Miller
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).