]> git.baikalelectronics.ru Git - kernel.git/commit
net: dsa: microchip: ksz9477: fix fdb_dump last invalid entry
authorArun Ramadoss <arun.ramadoss@microchip.com>
Tue, 16 Aug 2022 10:55:16 +0000 (16:25 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Aug 2022 09:18:30 +0000 (11:18 +0200)
commitbf0e60a8c1594b3a7367a4fb667b894db82fcd0b
tree9cfa091c8c9bdee3f5159356eca0983c8c6feafd
parent0aa935892fd9dc465854c09ea657cbe3c58cfd16
net: dsa: microchip: ksz9477: fix fdb_dump last invalid entry

commit d82ed347242d14d69f38e6ceb5c85c377e1200a2 upstream.

In the ksz9477_fdb_dump function it reads the ALU control register and
exit from the timeout loop if there is valid entry or search is
complete. After exiting the loop, it reads the alu entry and report to
the user space irrespective of entry is valid. It works till the valid
entry. If the loop exited when search is complete, it reads the alu
table. The table returns all ones and it is reported to user space. So
bridge fdb show gives ff:ff:ff:ff:ff:ff as last entry for every port.
To fix it, after exiting the loop the entry is reported only if it is
valid one.

Fixes: 93279a8384af ("dsa: add DSA switch driver for Microchip KSZ9477")
Signed-off-by: Arun Ramadoss <arun.ramadoss@microchip.com>
Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
Link: https://lore.kernel.org/r/20220816105516.18350-1-arun.ramadoss@microchip.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/dsa/microchip/ksz9477.c