[net,v1,1/1] net: phy: c45: fix network interface initialization failures on xtensa, arm:cubieboard
Message ID | 20230225071644.2754893-1-o.rempel@pengutronix.de |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp1370019wrd; Fri, 24 Feb 2023 23:34:06 -0800 (PST) X-Google-Smtp-Source: AK7set8+27xFVxo8FTEu0EupwnjKrKMEKtntTsBxxjWgF+1VvCmMiQ1YoMDKQZK/umtr+6tRiff/ X-Received: by 2002:a17:907:8a1e:b0:8ea:2055:4f1b with SMTP id sc30-20020a1709078a1e00b008ea20554f1bmr14254887ejc.24.1677310445866; Fri, 24 Feb 2023 23:34:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677310445; cv=none; d=google.com; s=arc-20160816; b=hbxU3Q6j7LAJOKp5RUHi6tQPzji5mL2KyY1hB/1ffU+mFGohBYYpA7sHzd7H67hZ6j ymT3DORjXW+tcwgOUff0iUludUtCjVc2EjslZth45QsFcZNmdw/rgO6NYip10wO65Ir8 fViYq9IigMrTCRcWSCQGdFHgNWwQFUJSybUekkcjKfj+lIKXpS9QzGzA3Gf/bvj1NQnX 1KMLxKaz1WRRpl+rQREwNGLmYPJ89U52ANTRcg3Bv6D0pyCQvNkmfv00N1dkt/ylskdv rFj/VnGSutNqMu7k340GKNHpuPGVHm9Z6faCbqOMss33c2cuQoenwtU51KIf9JH54/Lo EoxA== 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; bh=cmW3LqUyhp4o7ytod0cz6O0foicyGyd+gYC2GL2RDvQ=; b=HWEtLK6pbuLC4PvLypdv7sYmvygfd8+NZJKQa73jjzwKedo6MEfdEH4U8fxjxjAUam WPcminWO6zgAGbMPKbMG+DvIE6sQAbMU5UbL3zV/BTUT5Yh14HWhabU57PY+49tkf6pH /eNdJ3ZekKGGGfcvuA623rhNCsrbhgtDjAPKG5UsFJTfixujKiFntPJrKcCrN2BYs2rr 7tukBc8BmUZzT6Q81NBY3G1KjGNqXNYifFvulXiCGDxK+K8fwLVbEfuyAN5FIpI70bCs tsDTvhhIqxPgtqmyR5EFuG7uFeILmF9bJRWDpWE6kV1vey9uVDC8LyYIl3F8clbzqPvR ebpA== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x7-20020a170906298700b008b17eb1fda6si1464519eje.423.2023.02.24.23.33.43; Fri, 24 Feb 2023 23:34:05 -0800 (PST) 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 S229486AbjBYHQ7 (ORCPT <rfc822;guoshuai5156@gmail.com> + 99 others); Sat, 25 Feb 2023 02:16:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56406 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229445AbjBYHQ6 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sat, 25 Feb 2023 02:16:58 -0500 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 74EB27A9C for <linux-kernel@vger.kernel.org>; Fri, 24 Feb 2023 23:16:57 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from <ore@pengutronix.de>) id 1pVonY-0003E1-HE; Sat, 25 Feb 2023 08:16:48 +0100 Received: from [2a0a:edc0:0:1101:1d::ac] (helo=dude04.red.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from <ore@pengutronix.de>) id 1pVonW-0007hj-Ey; Sat, 25 Feb 2023 08:16:46 +0100 Received: from ore by dude04.red.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from <ore@pengutronix.de>) id 1pVonV-00BYge-Mz; Sat, 25 Feb 2023 08:16:45 +0100 From: Oleksij Rempel <o.rempel@pengutronix.de> To: Andrew Lunn <andrew@lunn.ch>, Heiner Kallweit <hkallweit1@gmail.com>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com> Cc: Oleksij Rempel <o.rempel@pengutronix.de>, Guenter Roeck <linux@roeck-us.net>, kernel@pengutronix.de, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Russell King <linux@armlinux.org.uk> Subject: [PATCH net v1 1/1] net: phy: c45: fix network interface initialization failures on xtensa, arm:cubieboard Date: Sat, 25 Feb 2023 08:16:44 +0100 Message-Id: <20230225071644.2754893-1-o.rempel@pengutronix.de> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 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 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1758787478266736515?= X-GMAIL-MSGID: =?utf-8?q?1758787478266736515?= |
Series |
[net,v1,1/1] net: phy: c45: fix network interface initialization failures on xtensa, arm:cubieboard
|
|
Commit Message
Oleksij Rempel
Feb. 25, 2023, 7:16 a.m. UTC
Without proper initialization, "changed" returned random numbers and caused interface initialization failures. Fixes: 022c3f87f88e ("net: phy: add genphy_c45_ethtool_get/set_eee() support") Reported-by: Guenter Roeck <linux@roeck-us.net> Tested-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> --- drivers/net/phy/phy-c45.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Sat, Feb 25, 2023 at 08:16:44AM +0100, Oleksij Rempel wrote: > Without proper initialization, "changed" returned random numbers and caused > interface initialization failures. > > Fixes: 022c3f87f88e ("net: phy: add genphy_c45_ethtool_get/set_eee() support") > Reported-by: Guenter Roeck <linux@roeck-us.net> > Tested-by: Guenter Roeck <linux@roeck-us.net> > Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Reviewed-by: Simon Horman <simon.horman@corigine.com>
On Sat, 25 Feb 2023 08:16:44 +0100 Oleksij Rempel wrote: > Without proper initialization, "changed" returned random numbers and caused > interface initialization failures. > > Fixes: 022c3f87f88e ("net: phy: add genphy_c45_ethtool_get/set_eee() support") > Reported-by: Guenter Roeck <linux@roeck-us.net> > Tested-by: Guenter Roeck <linux@roeck-us.net> > Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Applied, thanks!
diff --git a/drivers/net/phy/phy-c45.c b/drivers/net/phy/phy-c45.c index 3813b86689d0..fee514b96ab1 100644 --- a/drivers/net/phy/phy-c45.c +++ b/drivers/net/phy/phy-c45.c @@ -672,7 +672,7 @@ EXPORT_SYMBOL_GPL(genphy_c45_read_mdix); */ int genphy_c45_write_eee_adv(struct phy_device *phydev, unsigned long *adv) { - int val, changed; + int val, changed = 0; if (linkmode_intersects(phydev->supported_eee, PHY_EEE_CAP1_FEATURES)) { val = linkmode_to_mii_eee_cap1_t(adv);