[PATCH v2 2/3] realtek: restructure rtl_table_read/write

2022-12-17 Thread Jan Hoffmann
These two functions are identical apart from writing different values to the read/write bit. Create a new function rtl_table_exec to reduce code duplication. Also replace the unbounded busy-waiting loop. The new implementation may sleep, but as the hardware typically responds before the first poll

[PATCH v2 3/3] realtek: add cond_resched to loops accessing the FDB table

2022-12-17 Thread Jan Hoffmann
A full loop accessing all FDB entries can take several milliseconds (on RTL839x about 20 ms), so give other kernel tasks a chance to run. This is especially important for rtl83xx_port_fdb_dump which is itself called in a loop for all ports by the kernel. Signed-off-by: Jan Hoffmann --- .../linux

[PATCH v2 1/3] realtek: simplify log messages in rtl83xx_mdio_probe

2022-12-17 Thread Jan Hoffmann
This function currently prints three messages for every switch port at KERN_INFO level. This takes a considerable amount of time during bootup and can even trigger an external watchdog. Replace these log messages by a single one at KERN_DEBUG level. Signed-off-by: Jan Hoffmann --- .../realtek/f

[PATCH v2 0/3] realtek: avoid blocking for too long

2022-12-17 Thread Jan Hoffmann
This fixes multiple instances where the realtek drivers may block for too long. These issues were discovered on HPE 1920 devices where such behaviour is made obvious by the short timeout of the hardware watchdog. Changes in v2: - remove already applied commits - remove redundant log message in rtl

[PATCH v2] realtek: don't set L2LEARNING flag in rtl83xx TX header

2022-12-17 Thread Jan Hoffmann
As learning for the CPU port is now disabled globally, the bit in the TX header doesn't have any effect anymore. Remove it to make the header consistent with the global configuration. Originally, this change was intended to be applied before commit eb456aedfe24 ("realtek: use assisted learning on