diff options
author | Kurt Kanzenbach <kurt@linutronix.de> | 2021-08-25 15:58:12 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-08-26 10:26:05 +0100 |
commit | a7db5ed8632c88c029254d5d74765d52614af3fd (patch) | |
tree | de7ff101121b0e1b5f42b833fb5d98b7e1885545 /drivers/net | |
parent | 43fed4d48d325e0a61dc2638a84da972fbb1087b (diff) | |
download | linux-stable-a7db5ed8632c88c029254d5d74765d52614af3fd.tar.gz linux-stable-a7db5ed8632c88c029254d5d74765d52614af3fd.tar.bz2 linux-stable-a7db5ed8632c88c029254d5d74765d52614af3fd.zip |
net: dsa: hellcreek: Fix incorrect setting of GCL
Currently the gate control list which is programmed into the hardware is
incorrect resulting in wrong traffic schedules. The problem is the loop
variables are incremented before they are referenced. Therefore, move the
increment to the end of the loop.
Fixes: 24dfc6eb39b2 ("net: dsa: hellcreek: Add TAPRIO offloading support")
Signed-off-by: Kurt Kanzenbach <kurt@linutronix.de>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/dsa/hirschmann/hellcreek.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/dsa/hirschmann/hellcreek.c b/drivers/net/dsa/hirschmann/hellcreek.c index 5c54ae1be62c..b57aea92684b 100644 --- a/drivers/net/dsa/hirschmann/hellcreek.c +++ b/drivers/net/dsa/hirschmann/hellcreek.c @@ -1472,9 +1472,6 @@ static void hellcreek_setup_gcl(struct hellcreek *hellcreek, int port, u16 data; u8 gates; - cur++; - next++; - if (i == schedule->num_entries) gates = initial->gate_mask ^ cur->gate_mask; @@ -1503,6 +1500,9 @@ static void hellcreek_setup_gcl(struct hellcreek *hellcreek, int port, (initial->gate_mask << TR_GCLCMD_INIT_GATE_STATES_SHIFT); hellcreek_write(hellcreek, data, TR_GCLCMD); + + cur++; + next++; } } |