]> git.baikalelectronics.ru Git - kernel.git/commit
r8152: fix flow control issue of RTL8156A
authorHayes Wang <hayeswang@realtek.com>
Fri, 28 Apr 2023 08:53:29 +0000 (16:53 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 May 2023 09:53:34 +0000 (11:53 +0200)
commit7f216c2c81ce4c545938c814ba734b97a6360496
tree8c857d380392c02dfd2a3434873ba65023ca0cdb
parentb1a71714cf9589ffbc18d42c1812becc6f64dc68
r8152: fix flow control issue of RTL8156A

[ Upstream commit 8ceda6d5a1e5402fd852e6cc59a286ce3dc545ee ]

The feature of flow control becomes abnormal, if the device sends a
pause frame and the tx/rx is disabled before sending a release frame. It
causes the lost of packets.

Set PLA_RX_FIFO_FULL and PLA_RX_FIFO_EMPTY to zeros before disabling the
tx/rx. And, toggle FC_PATCH_TASK before enabling tx/rx to reset the flow
control patch and timer. Then, the hardware could clear the state and
the flow control becomes normal after enabling tx/rx.

Besides, remove inline for fc_pause_on_auto() and fc_pause_off_auto().

Fixes: 20d6936ad320 ("r8152: support new chips")
Signed-off-by: Hayes Wang <hayeswang@realtek.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/usb/r8152.c