]> git.ipfire.org Git - thirdparty/kernel/stable.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 11:58:46 +0000 (13:58 +0200)
commit435a5736c220ae22b50bb433ea3c3829d10ea79d
treeb2afb62842c417b327c4766b7be78185fcee6180
parent5c37f7b20d36f2bf009816117837162412f8aa3e
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: 195aae321c82 ("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