Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp13475559ybl; Sun, 29 Dec 2019 12:48:49 -0800 (PST) X-Google-Smtp-Source: APXvYqwUvGXadsGVWClm7DMKdrE0Uc2OFU8eX65pizswHLCvmc3gaXdGXiECrKIDcV48YTXKk+Nl X-Received: by 2002:a05:6830:1608:: with SMTP id g8mr66600839otr.169.1577652529785; Sun, 29 Dec 2019 12:48:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577652529; cv=none; d=google.com; s=arc-20160816; b=hbNHHkdNRqgPGABGj2ETjeSsAfJOUwTZlzcteVdtLlej5a8jmDjNVCktT99+2wDsuh T08A9ng6BQ9yD+pFUmIECouldxxUjbyzpDV0eXwUD+BMDyHTW7esMVzVKq+rc8Hdjoh/ Aps1/IHirH8AXgl/n08ES6HGj8A4nAKMe2Tp7WH+NDi/8N3nHR2Pb0cgrat5Jj4nlVNV 0Lg7S83It3RHkHbeLV7Va+nBq+wlqBGtPDyhym91wNq34YBtadctT+FO369o3Dj1Fu9R lVUoyqQRW0uy6qZec7D7w/9IFgoWbVs5sEuuCK/hl5d9cmQouERivRr1DsceZ7XybVuI PHxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=9VPbfYdjH2c8bUAPCKCnOeI5wu49V+xPMwS5YjS1ws0=; b=MfmLW1yUuJj4T9JAXKE6Y4FDfVLyzZSYPRHahTq1tJ8xohifIH0rbK4BN9mmsHoF48 X/dv9xNLlUs4/AAPmBnqrlyqh7ETCgmJbbGrTYMHI/Ks4oNGlCtaR1JOfK4wuPcW5Jiw gtEcEQrZacgjwzaUlQT/nroOd3Ta+ghgZNaAtSHGVZtTpoa/Z4nD5elmQTuZv7+sTi3w Y9LLZLKFazkhvclUESgwl8clRAEYQvgUFfb5LdG6glRqSpHg62zkQv0WIpGrjvQxHmgO //MNdj0Alho2PhEYjs5JdRR3CoK33JaFwDINqBABWeIBC3ATPxymL+GpXXLupLBYVuep 036A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=tS0KLbI1; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e20si19894575oig.199.2019.12.29.12.48.39; Sun, 29 Dec 2019 12:48:49 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=tS0KLbI1; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732616AbfL2Rz1 (ORCPT + 99 others); Sun, 29 Dec 2019 12:55:27 -0500 Received: from mail.kernel.org ([198.145.29.99]:44032 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732908AbfL2RzZ (ORCPT ); Sun, 29 Dec 2019 12:55:25 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 76045206A4; Sun, 29 Dec 2019 17:55:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577642124; bh=7IhDB8fZo0VwcPlFw0jdycofdMzvRlQYJC6mVeFH3Xs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tS0KLbI1R8mTtI60+lQpboTx78rUKv0+XD/4fwn8Qeg7HED4n67d+02Zz5urJoyAN 9gtoyUVvCPj/GhLhO3RpeM2V7Cf65nWJULowDeTkJ/mSm/qbOJFHCwoFXqMd59J32s gmPVTOgMnvFFH4b+zY2OkzqSLDRLAFgMWjNsJWA8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Russell King , Jakub Kicinski , Sasha Levin Subject: [PATCH 5.4 352/434] net: phy: initialise phydev speed and duplex sanely Date: Sun, 29 Dec 2019 18:26:45 +0100 Message-Id: <20191229172725.352306708@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191229172702.393141737@linuxfoundation.org> References: <20191229172702.393141737@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Russell King [ Upstream commit a5d66f810061e2dd70fb7a108dcd14e535bc639f ] When a phydev is created, the speed and duplex are set to zero and -1 respectively, rather than using the predefined SPEED_UNKNOWN and DUPLEX_UNKNOWN constants. There is a window at initialisation time where we may report link down using the 0/-1 values. Tidy this up and use the predefined constants, so debug doesn't complain with: "Unsupported (update phy-core.c)/Unsupported (update phy-core.c)" when the speed and duplex settings are printed. Signed-off-by: Russell King Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/phy/phy_device.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index 14c6b7597b06..cee8724caf2d 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c @@ -596,8 +596,8 @@ struct phy_device *phy_device_create(struct mii_bus *bus, int addr, int phy_id, mdiodev->device_free = phy_mdio_device_free; mdiodev->device_remove = phy_mdio_device_remove; - dev->speed = 0; - dev->duplex = -1; + dev->speed = SPEED_UNKNOWN; + dev->duplex = DUPLEX_UNKNOWN; dev->pause = 0; dev->asym_pause = 0; dev->link = 0; -- 2.20.1