From patchwork Mon Apr 17 18:19:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 84411 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2332646vqo; Mon, 17 Apr 2023 11:48:20 -0700 (PDT) X-Google-Smtp-Source: AKy350aIY+H9bO6Sn2Mx9y8ufWltS3hhtOGKqnyREY8LXgTOqWMdt/+1ee61pM4bix4BCG7KZosN X-Received: by 2002:a05:6a20:2584:b0:f0:36a3:7079 with SMTP id k4-20020a056a20258400b000f036a37079mr2881223pzd.40.1681757300323; Mon, 17 Apr 2023 11:48:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681757300; cv=none; d=google.com; s=arc-20160816; b=V71Y9n4PQW3rMXsEywNcLQlYNeLW0qQfd5KVjKiIMvlYoKoP7wDEhNIo24QBx7Gjf+ oVfP0ahED2xdlffTs9mMbipC06O4f8zn1PBLMJikplhiMkapqZxM3qku5P/hhygsZA78 BLtveSCPpymPX+Fn7QztbtUGQ513V6oIBlYOI2AjJKTRquvPmZbbWCQAnPz6gXxxCC3v ClN/nD72SjgUUPrnT3VKIL5E0G5IG+RaTa9/sqnkwFWFYSoulZGJfDs6L2yYtX6So/9y OmVSKYjpHF34aayKVrHgWsnpFCmXXP1R87xGZ0QY1WgZiUFRj2OzTtqRIV1wRu/hWVaP iaUA== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a8-20020a63cd48000000b0051b10dc3a47si12062314pgj.158.2023.04.17.11.48.07; Mon, 17 Apr 2023 11:48:20 -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 S230094AbjDQSTo (ORCPT + 99 others); Mon, 17 Apr 2023 14:19:44 -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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1763450343081863652?= X-GMAIL-MSGID: =?utf-8?q?1763450343081863652?= 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 Reviewed-by: Oleksij Rempel Reviewed-by: Simon Horman Reviewed-by: Vladimir Oltean Reviewed-by: Florian Fainelli --- 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);