a510cfdc1831e61c9bddc4c82a3e8ac1c5cc6a5f
[openwrt/staging/wigyori.git] /
1 From 06dd34a628ae5b6a839b757e746de165d6789ca8 Mon Sep 17 00:00:00 2001
2 From: Ansuel Smith <ansuelsmth@gmail.com>
3 Date: Sun, 17 Oct 2021 16:56:46 +0200
4 Subject: net: dsa: qca8k: fix delay applied to wrong cpu in parse_port_config
5
6 Fix delay settings applied to wrong cpu in parse_port_config. The delay
7 values is set to the wrong index as the cpu_port_index is incremented
8 too early. Start the cpu_port_index to -1 so the correct value is
9 applied to address also the case with invalid phy mode and not available
10 port.
11
12 Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
13 Signed-off-by: David S. Miller <davem@davemloft.net>
14 ---
15 drivers/net/dsa/qca8k.c | 2 +-
16 1 file changed, 1 insertion(+), 1 deletion(-)
17
18 --- a/drivers/net/dsa/qca8k.c
19 +++ b/drivers/net/dsa/qca8k.c
20 @@ -976,7 +976,7 @@ qca8k_setup_of_pws_reg(struct qca8k_priv
21 static int
22 qca8k_parse_port_config(struct qca8k_priv *priv)
23 {
24 - int port, cpu_port_index = 0, ret;
25 + int port, cpu_port_index = -1, ret;
26 struct device_node *port_dn;
27 phy_interface_t mode;
28 struct dsa_port *dp;