941fa23eb4c66974b692160372106b816aad8e4b
[openwrt/staging/pepe2k.git] /
1 From 3ff26b29230c54fea2353b63124c589b61953e14 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
3 Date: Thu, 16 Sep 2021 14:03:53 +0200
4 Subject: [PATCH] net: dsa: b53: Improve flow control setup on BCM5301x
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 According to the Broadcom's reference driver flow control needs to be
10 enabled for any CPU switch port (5, 7 or 8 - depending on which one is
11 used). Current code makes it work only for the port 5. Use
12 dsa_is_cpu_port() which solved that problem.
13
14 Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
15 Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
16 Tested-by: Florian Fainelli <f.fainelli@gmail.com>
17 Signed-off-by: Jakub Kicinski <kuba@kernel.org>
18 ---
19 drivers/net/dsa/b53/b53_common.c | 2 +-
20 1 file changed, 1 insertion(+), 1 deletion(-)
21
22 --- a/drivers/net/dsa/b53/b53_common.c
23 +++ b/drivers/net/dsa/b53/b53_common.c
24 @@ -1222,7 +1222,7 @@ static void b53_adjust_link(struct dsa_s
25 return;
26
27 /* Enable flow control on BCM5301x's CPU port */
28 - if (is5301x(dev) && port == dev->cpu_port)
29 + if (is5301x(dev) && dsa_is_cpu_port(ds, port))
30 tx_pause = rx_pause = true;
31
32 if (phydev->pause) {