]> git.baikalelectronics.ru Git - kernel.git/commit
net: dsa: sja1105: unconditionally free old gating config
authorVladimir Oltean <vladimir.oltean@nxp.com>
Wed, 24 Jun 2020 13:54:45 +0000 (16:54 +0300)
committerDavid S. Miller <davem@davemloft.net>
Thu, 25 Jun 2020 23:06:56 +0000 (16:06 -0700)
commit6458bc03cfa63a63fc642a4be8635340808ead47
tree2cee0637b5936c1c2203786fd43c1795cde46bb5
parent71dc34ce31aa7bf57390cba5e19da99bb5647ae7
net: dsa: sja1105: unconditionally free old gating config

Currently sja1105_compose_gating_subschedule is not prepared to be
called for the case where we want to recompute the global tc-gate
configuration after we've deleted those actions on a port.

After deleting the tc-gate actions on the last port, max_cycle_time
would become zero, and that would incorrectly prevent
sja1105_free_gating_config from getting called.

So move the freeing function above the check for the need to apply a new
configuration.

Fixes: 83ed1d663245 ("net: dsa: sja1105: implement tc-gate using time-triggered virtual links")
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/sja1105/sja1105_vl.c