提交 f42eb184 编写于 作者: V Vladimir Oltean 提交者: Zheng Zengkai

net: dsa: felix: don't deinitialize unused ports

stable inclusion
from stable-5.10.20
commit 100676d5c4d56e993e09958da9f7a74c8a7bbbaf
bugzilla: 50608

--------------------------------

[ Upstream commit 42b5adbb ]

ocelot_init_port is called only if dsa_is_unused_port == false, however
ocelot_deinit_port is called unconditionally. This causes a warning in
the skb_queue_purge inside ocelot_deinit_port saying that the spin lock
protecting ocelot_port->tx_skbs was not initialized.

Fixes: e5fb512d ("net: mscc: ocelot: deinitialize only initialized ports")
Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Acked-by: NXie XiuQi <xiexiuqi@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 2998383d
......@@ -638,8 +638,12 @@ static void felix_teardown(struct dsa_switch *ds)
ocelot_deinit_timestamp(ocelot);
ocelot_deinit(ocelot);
for (port = 0; port < ocelot->num_phys_ports; port++)
for (port = 0; port < ocelot->num_phys_ports; port++) {
if (dsa_is_unused_port(ds, port))
continue;
ocelot_deinit_port(ocelot, port);
}
if (felix->info->mdio_bus_free)
felix->info->mdio_bus_free(ocelot);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册