]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
net: ethernet: ti: ale: clean ale tbl on init and intf restart
authorGrygorii Strashko <grygorii.strashko@ti.com>
Tue, 19 Nov 2019 22:19:13 +0000 (00:19 +0200)
committerKhalid Elmously <khalid.elmously@canonical.com>
Wed, 29 Jan 2020 04:47:27 +0000 (23:47 -0500)
BugLink: https://bugs.launchpad.net/bugs/1859712
[ Upstream commit 7fe579dfb90fcdf0c7722f33c772d5f0d1bc7cb6 ]

Clean CPSW ALE on init and intf restart (up/down) to avoid reading obsolete
or garbage entries from ALE table.

Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/net/ethernet/ti/cpsw_ale.c

index 01d65baf5af9bea85ff26dd0d27dd7818cd0cffe..83393ba637e3d4c988f977147c7e8018e08b30c6 100644 (file)
@@ -870,6 +870,7 @@ EXPORT_SYMBOL_GPL(cpsw_ale_start);
 void cpsw_ale_stop(struct cpsw_ale *ale)
 {
        del_timer_sync(&ale->timer);
+       cpsw_ale_control_set(ale, 0, ALE_CLEAR, 1);
        cpsw_ale_control_set(ale, 0, ALE_ENABLE, 0);
 }
 EXPORT_SYMBOL_GPL(cpsw_ale_stop);
@@ -885,6 +886,7 @@ struct cpsw_ale *cpsw_ale_create(struct cpsw_ale_params *params)
        ale->params = *params;
        ale->ageout = ale->params.ale_ageout * HZ;
 
+       cpsw_ale_control_set(ale, 0, ALE_CLEAR, 1);
        return ale;
 }
 EXPORT_SYMBOL_GPL(cpsw_ale_create);