Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp4888418rwe; Mon, 17 Apr 2023 21:43:45 -0700 (PDT) X-Google-Smtp-Source: AKy350aL5j5jXL4QyBTGSPMTfXPOoGDwzguPO6JschdMQERFKwDngg+9oXKY6whsOutMjlmlcTyo X-Received: by 2002:a17:90b:1007:b0:247:5c00:10 with SMTP id gm7-20020a17090b100700b002475c000010mr1006238pjb.2.1681793024914; Mon, 17 Apr 2023 21:43:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681793024; cv=none; d=google.com; s=arc-20160816; b=kljoeJxbs3R8Vz5BTXAldlNqDzpjsUSbFP1WOxbpxoLQOXiohZfbmxXYCeuV2Jyt5P pCTV10uoBxyJ8IUW8dRsWMHHe0Zy4fpygbFkSMA8j/29YlWfZgGnmfKdXQrSJbhJTnUA KOwsMQfroUxBEcecSjT9Ba+k/odIGnow7fTFRHqj+dZPCLqltFftSNV3iw/LoEgwK0Mo FBbOvsL2n6/+tDTIrUpfWl6mDSRMzlxqKVPt80JaT0jOxNPwFBg/wGdRFW18ioCxv5lI j7MmfGJ6QWz2pH98Q4SmU0IM+1Yd1doCe/t2i63ddrqtbS644TCBT6JHaYnnZv16mYAq CjGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=KTaoGPUH17w5Y7yxWQi8WZmtY0EYDXE8b/xGDSqY1hE=; b=u/61FKr6pxmyAJdCqDCXEedGs881XxJPhcX+SirLKMJl5jCZghBjmNjNXG5K8EDz9n TyC+/mYpbxwvwFys25VeN4fYj/Ek39oSbPMP7ujgKdr7F4xSJXJJIL4bMkkWOWr5IL1J lUOSC92ivTMgBKS77zmmMuodBNYJdQX49jwq/7regc4gk97MEZr0JQb7K3Mzl8CRPBnm 2YPkEpLbldGNIliC5MR/ozIORc6pU7NicviyaqTAVGFSm6/fgOib3k6yTx+Fu4SPatd0 mOPDt4OJs5W8FW5IgZRuwqdr7veF8OT3pm8AoCzWNyMh3T93ZCJQ7PwmFHFstL8A3SdA VbzQ== ARC-Authentication-Results: i=1; mx.google.com; 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 ne2-20020a17090b374200b00247526ba960si8614452pjb.119.2023.04.17.21.43.33; Mon, 17 Apr 2023 21:43:44 -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; 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 S230026AbjDREWL (ORCPT + 99 others); Tue, 18 Apr 2023 00:22:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38474 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229962AbjDREWJ (ORCPT ); Tue, 18 Apr 2023 00:22:09 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8B7AF46B8 for ; Mon, 17 Apr 2023 21:22:06 -0700 (PDT) Received: from ptx.hi.pengutronix.de ([2001:67c:670:100:1d::c0]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pocqe-0007Xi-Nc; Tue, 18 Apr 2023 06:21:44 +0200 Received: from ore by ptx.hi.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1pocqc-0001NI-0V; Tue, 18 Apr 2023 06:21:42 +0200 Date: Tue, 18 Apr 2023 06:21:41 +0200 From: Oleksij Rempel To: Christophe JAILLET Cc: Woojung Huh , UNGLinuxDriver@microchip.com, Andrew Lunn , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Arun Ramadoss , Oleksij Rempel , linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, netdev@vger.kernel.org Subject: Re: [PATCH net] net: dsa: microchip: ksz8795: Correctly handle huge frame configuration Message-ID: <20230418042141.GA30964@pengutronix.de> References: <43107d9e8b5b8b05f0cbd4e1f47a2bb88c8747b2.1681755535.git.christophe.jaillet@wanadoo.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <43107d9e8b5b8b05f0cbd4e1f47a2bb88c8747b2.1681755535.git.christophe.jaillet@wanadoo.fr> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-Accept-Language: de,en X-Accept-Content-Type: text/plain User-Agent: Mutt/1.10.1 (2018-07-13) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c0 X-SA-Exim-Mail-From: ore@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 Hi Christophe, 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 Reviewed-by: Oleksij Rempel Thank you! > --- > Untested. I do not have access to this HW too. > --- > 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 > > -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |