From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 185C1C00454 for ; Tue, 10 Dec 2019 22:34:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D58A320828 for ; Tue, 10 Dec 2019 22:34:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576017294; bh=4nmSszgup869i+Cy9FnGcifZ8Phu2EmSABXl2wPWDXs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=myiPr3XX/DpF01XW2T4HQYthUtwOVjziNJsoUptPf7FqTOFiwssQpZlsng4jaC0tG 4Sj3OTC4mdovO+qJ2dhdblNqF7mhQWUOPe1HG0h7utCx+WTHhy9nLvB19r51mtvR2j t9WHGZVOmLpeIEX4aA9Fw7bcwOypPZKqp8vfTSso= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727810AbfLJWew (ORCPT ); Tue, 10 Dec 2019 17:34:52 -0500 Received: from mail.kernel.org ([198.145.29.99]:56346 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727891AbfLJWem (ORCPT ); Tue, 10 Dec 2019 17:34:42 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BEE112077B; Tue, 10 Dec 2019 22:34:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576017281; bh=4nmSszgup869i+Cy9FnGcifZ8Phu2EmSABXl2wPWDXs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ae9DLoEHdxp+6yZaTcDC0+swiSiSGQaUemJvryOVArxHitz//0miN9kXND2y4Q6h2 gai4GUjOJikjEBhMedwjw5hnaWIe6MqTDzpV3l1T5EGV12Xg9qat7L1JgBIEiJg1UT GWT/rpJhKx0pnWlLEAUA9hw926X9SCaDXopQngM4= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Russell King , Jakub Kicinski , Sasha Levin , netdev@vger.kernel.org Subject: [PATCH AUTOSEL 4.4 71/71] net: phy: initialise phydev speed and duplex sanely Date: Tue, 10 Dec 2019 17:33:16 -0500 Message-Id: <20191210223316.14988-71-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191210223316.14988-1-sashal@kernel.org> References: <20191210223316.14988-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore 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 c6a87834723d1..b15eceb8b4425 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c @@ -161,8 +161,8 @@ struct phy_device *phy_device_create(struct mii_bus *bus, int addr, int phy_id, dev->dev.release = phy_device_release; - dev->speed = 0; - dev->duplex = -1; + dev->speed = SPEED_UNKNOWN; + dev->duplex = DUPLEX_UNKNOWN; dev->pause = 0; dev->asym_pause = 0; dev->link = 1; -- 2.20.1