[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230419161438.lasmfqboy77evbn3@skbuf>
Date: Wed, 19 Apr 2023 19:14:38 +0300
From: Vladimir Oltean <olteanv@...il.com>
To: Christophe JAILLET <christophe.jaillet@...adoo.fr>
Cc: Woojung Huh <woojung.huh@...rochip.com>,
UNGLinuxDriver@...rochip.com, Andrew Lunn <andrew@...n.ch>,
Florian Fainelli <f.fainelli@...il.com>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Arun Ramadoss <arun.ramadoss@...rochip.com>,
Oleksij Rempel <linux@...pel-privat.de>,
linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org,
netdev@...r.kernel.org
Subject: Re: [PATCH net] net: dsa: microchip: ksz8795: Correctly handle huge
frame configuration
On Mon, Apr 17, 2023 at 08:19:33PM +0200, Christophe JAILLET wrote:
> Because of the logic in place, SW_HUGE_PACKET can never be set.
> (If the first condition is true, then the 2nd one is also true, but is not
> executed)
>
> Change the logic and update each bit individually.
>
> Fixes: 29d1e85f45e0 ("net: dsa: microchip: ksz8: add MTU configuration support")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@...adoo.fr>
> ---
> Untested.
> ---
> drivers/net/dsa/microchip/ksz8795.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/dsa/microchip/ksz8795.c b/drivers/net/dsa/microchip/ksz8795.c
> index 23614a937cc3..f56fca1b1a22 100644
> --- a/drivers/net/dsa/microchip/ksz8795.c
> +++ b/drivers/net/dsa/microchip/ksz8795.c
> @@ -96,7 +96,7 @@ static int ksz8795_change_mtu(struct ksz_device *dev, int frame_size)
>
> if (frame_size > KSZ8_LEGAL_PACKET_SIZE)
> ctrl2 |= SW_LEGAL_PACKET_DISABLE;
> - else if (frame_size > KSZ8863_NORMAL_PACKET_SIZE)
> + if (frame_size > KSZ8863_NORMAL_PACKET_SIZE)
> ctrl1 |= SW_HUGE_PACKET;
>
> ret = ksz_rmw8(dev, REG_SW_CTRL_1, SW_HUGE_PACKET, ctrl1);
> --
> 2.34.1
>
After checking with the datasheet, the change looks indeed correct.
Reviewed-by: Vladimir Oltean <olteanv@...il.com>
Powered by blists - more mailing lists