Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp4364907rwe; Mon, 17 Apr 2023 11:27:36 -0700 (PDT) X-Google-Smtp-Source: AKy350YCNCxjv1BCHJlhG1vxYEM3M6ZzTHbJozav4qXf3Z7Nf+qrp38xU6ya/lFKVs4QeN97LM6U X-Received: by 2002:a17:90b:3149:b0:23f:a674:dc0b with SMTP id ip9-20020a17090b314900b0023fa674dc0bmr15657763pjb.15.1681756055928; Mon, 17 Apr 2023 11:27:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681756055; cv=none; d=google.com; s=arc-20160816; b=Vld/wlzRNWxdHB/74v8h7kyjjqMweSnz2iWM/QqrRsrQmF1UXeZpbA5hBbg3G61GHu 6WjAenKt5HI0n+zQXzmXcAFCMMcFya8SjUU2WuqV6DWpFnfFNRydel+4CpfHPxt6RgjK 1I6l2vnE/B5lcPcb+Vs+M1tPEChbe2J+VRjxFWxOfRvw+e7p4n+bIxkNwCmz0upAIA4d vfcf46kLjBguYFoCewqOhwl10dw1DmZ5hIzIdr7dE2BqeQkS5YXfGuwnuvQaXnk9NXC/ H9CejdIkLnTQDaFeDe272BlQyiON/mhdbei6z5NqpBpRXX45NIgs5vZ4ViOAKHdWWTmo PfYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=y0spckrc7ta0K605nXj/b2AqFl80Yy12cQ6kS116dzM=; b=X5NHClsZAThQ/5YqtoUny5DaqVOdxQ2MeFOcVrD+vyJu5Gr0SthpNXqpqhsoujlkBW eHvPr0JJwEe9Xum1S0tR/BoiQ7EREj+LxL5jMyN8N8EAa/+taM1cNrL/2XbVpZv6drru jcgwfK3WJphQGIAmaimnsn1yFht1qqqXdWvPhEyRxb3V8Rcr+MtCg7GrVGGNoeliA7V+ Kad2Bii0BKbsFNvvw5dvvCpy3rkSe87PhN8rh+a+lVia3Aa2K6gkJhDNgd93YDcWGwBu uWub2m6eFfnKu3MPj9wK8ZDYKbVeDHSAuybDiwl97fSKchGeA58QKUQyWzJfaJUcgkzX EYhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@orange.fr header.s=t20230301 header.b=AfNloPvJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bv17-20020a17090af19100b00247101dd0c1si12153897pjb.15.2023.04.17.11.27.22; Mon, 17 Apr 2023 11:27:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@orange.fr header.s=t20230301 header.b=AfNloPvJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229991AbjDQSTn (ORCPT + 99 others); Mon, 17 Apr 2023 14:19:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37282 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229461AbjDQSTm (ORCPT ); Mon, 17 Apr 2023 14:19:42 -0400 Received: from smtp.smtpout.orange.fr (smtp-14.smtpout.orange.fr [80.12.242.14]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 056AFB0 for ; Mon, 17 Apr 2023 11:19:40 -0700 (PDT) Received: from pop-os.home ([86.243.2.178]) by smtp.orange.fr with ESMTPA id oTRuppJ6EjYHDoTRupnJXY; Mon, 17 Apr 2023 20:19:39 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=orange.fr; s=t20230301; t=1681755579; bh=y0spckrc7ta0K605nXj/b2AqFl80Yy12cQ6kS116dzM=; h=From:To:Cc:Subject:Date; b=AfNloPvJiO3xmvBS09ZuOQjvx+6u9dWeTwKbcTYn4JlO6q0rI8LXxqxdfMA3jHLQE X4xXr986pGtd5lFsK/BD779Cnjht4+RSFeJjL0eq0myseNiouJxcv0oC0p9SWPdBrK ISLxYqOiVehkzAcFB/edmx60L0e37321NgbcYVp1Hu1Ed7XclXEzo2F9WOM81MlHiP HNpjF5eC2un3sUnp//MYfFI51SVVWVmuW+76rYkJ+IozRNKCGL06juPXgeWr2TI1bT Yy69/h7qR1XqII+cKkUZV5gzZlGd5ILBfge987nNLU3nZ8sd/WU7KcZstu9X4pW2tc abwG8t1dIV7wg== X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Mon, 17 Apr 2023 20:19:39 +0200 X-ME-IP: 86.243.2.178 From: Christophe JAILLET To: Woojung Huh , UNGLinuxDriver@microchip.com, Andrew Lunn , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Arun Ramadoss , Oleksij Rempel Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , netdev@vger.kernel.org Subject: [PATCH net] net: dsa: microchip: ksz8795: Correctly handle huge frame configuration Date: Mon, 17 Apr 2023 20:19:33 +0200 Message-Id: <43107d9e8b5b8b05f0cbd4e1f47a2bb88c8747b2.1681755535.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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