Skip to content

Commit 3d2f8f1

Browse files
tititiou36kuba-moo
authored andcommitted
net: dsa: microchip: ksz8795: Correctly handle huge frame configuration
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: 29d1e85 ("net: dsa: microchip: ksz8: add MTU configuration support") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Reviewed-by: Oleksij Rempel <o.rempel@pengutronix.de> Reviewed-by: Simon Horman <simon.horman@corigine.com> Reviewed-by: Vladimir Oltean <olteanv@gmail.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Link: https://lore.kernel.org/r/43107d9e8b5b8b05f0cbd4e1f47a2bb88c8747b2.1681755535.git.christophe.jaillet@wanadoo.fr Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent fcd4843 commit 3d2f8f1

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/net/dsa/microchip/ksz8795.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ static int ksz8795_change_mtu(struct ksz_device *dev, int frame_size)
9696

9797
if (frame_size > KSZ8_LEGAL_PACKET_SIZE)
9898
ctrl2 |= SW_LEGAL_PACKET_DISABLE;
99-
else if (frame_size > KSZ8863_NORMAL_PACKET_SIZE)
99+
if (frame_size > KSZ8863_NORMAL_PACKET_SIZE)
100100
ctrl1 |= SW_HUGE_PACKET;
101101

102102
ret = ksz_rmw8(dev, REG_SW_CTRL_1, SW_HUGE_PACKET, ctrl1);

0 commit comments

Comments
 (0)