]> git.baikalelectronics.ru Git - kernel.git/commit
net: dsa: qca8k: Initialize the switch with correct number of ports
authorMichal Vokáč <michal.vokac@ysoft.com>
Thu, 24 Oct 2019 13:46:58 +0000 (15:46 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 28 Oct 2019 20:39:31 +0000 (13:39 -0700)
commitc9f4efb33024de2547ef7de1d89bfceab4640aac
tree1d183ab21595d4e82ba80bf57afd93d75e2b9648
parent6b5f06e6ad6b0aaf9ea3eb7c7b557b24c1e90e76
net: dsa: qca8k: Initialize the switch with correct number of ports

Since commit bbb21750feeb ("net: dsa: enable and disable all ports")
the dsa core disables all unused ports of a switch. In this case
disabling ports with numbers higher than QCA8K_NUM_PORTS causes that
some switch registers are overwritten with incorrect content.

To fix this, initialize the dsa_switch->num_ports with correct number
of ports.

Fixes: 9f04f08e7eac ("net: dsa: remove dsa_switch_alloc helper")
Signed-off-by: Michal Vokáč <michal.vokac@ysoft.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/qca8k.c