[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <724a1f58-3df6-402f-9ebd-25fe48229ace@lunn.ch>
Date: Thu, 27 Apr 2023 02:21:57 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Hayes Wang <hayeswang@...ltek.com>
Cc: kuba@...nel.org, davem@...emloft.net, netdev@...r.kernel.org,
nic_swsd@...ltek.com, linux-kernel@...r.kernel.org,
linux-usb@...r.kernel.org
Subject: Re: [PATCH net 1/3] r8152: fix flow control issue of RTL8156A
On Wed, Apr 26, 2023 at 08:28:03PM +0800, Hayes Wang wrote:
> 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.
>
> Fixes: 195aae321c82 ("r8152: support new chips")
> Signed-off-by: Hayes Wang <hayeswang@...ltek.com>
> ---
> drivers/net/usb/r8152.c | 56 ++++++++++++++++++++++++++---------------
> 1 file changed, 36 insertions(+), 20 deletions(-)
>
> diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
> index 0fc4b959edc1..08d1786135f2 100644
> --- a/drivers/net/usb/r8152.c
> +++ b/drivers/net/usb/r8152.c
> @@ -5986,6 +5986,25 @@ static void rtl8153_disable(struct r8152 *tp)
> r8153_aldps_en(tp, true);
> }
>
> +static inline u32 fc_pause_on_auto(struct r8152 *tp)
> +{
> + return (ALIGN(mtu_to_size(tp->netdev->mtu), 1024) + 6 * 1024);
> +}
No inline functions in .c files. Let the compiler decide. I see you
are just moving functions around, they were already inline, but now is
a good time to fix this.
Andrew
Powered by blists - more mailing lists