Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4824066ybl; Wed, 22 Jan 2020 05:26:20 -0800 (PST) X-Google-Smtp-Source: APXvYqz5/kakskeY462HUL36CggkanbmY2TI9FaaPZv+EZVwCBnnTLZIlGYWlH9e4AfbRb7XqHU7 X-Received: by 2002:a05:6830:10c6:: with SMTP id z6mr7674672oto.203.1579699580122; Wed, 22 Jan 2020 05:26:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579699580; cv=none; d=google.com; s=arc-20160816; b=0SNmxqALzQ1o08lfU2QEz007XTukhTAvutBBJE07CzdWlOKH/XkSptiR68B1Xi8KtC KUNSsvNfOrGvur99xoKSTv542EI74bTKgfY+EwJoR/mMJWywSww0AbVf2VUwr+HzXZYH 2kKIWwndn9S8gYcvJ463Z4cUsKsR4Q3K7tIGz0TXPhCISA87gn8dIgaAV7cgMlG7lcz8 1Pv/wOKPM0MPbRFA4NrV8TGyopzRgiGxzi2BnG7SXoKFDmLzndq43kAepaKlEY2fM/Nn 2Ac6k2l+gl9MDEf9QF5+JfK08D0X7O/WrrCXbIZtt1ROcT+mWA6w17gc6ocg61HrQMNr I9fg== 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=kec76+8lCHfB7KtiiKx43gpWd723QH9YynMbSToqKlk=; b=MqZsTMIfVaJUNvhsMRqt26tGkLu2RdlH5Csui/d8RHAvXiz88sNBilGNSdx7v5qmBO fxX7X2UJClfCY9EgI8sV6mUFCZtpMMVsw96D+GaKYRJ1C0KOiCxnkCyoH2+NeDUDkjQy j+fgnW7GDhqkAG0ocl1YXwZ2owQikYUPEo4jvad3RADAame4XwAWCwkrdBbdu+1CdPHn CCZvvzcAaBen7oy8tj5o3jFK1QTcd6b0BMlEetR1vR1U2BPbOiiDD+AoNNnPypPevo/6 A9rNDoxiuGIjnAmFLlia16u6ff5PslBwQFl0EocNhUiIUzYfqvavy7vKb9kBniaR0Z8D ejdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="idqSZ/PA"; 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 q72si22157972oic.18.2020.01.22.05.26.08; Wed, 22 Jan 2020 05:26:20 -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="idqSZ/PA"; 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 S1730853AbgAVNX5 (ORCPT + 99 others); Wed, 22 Jan 2020 08:23:57 -0500 Received: from mail.kernel.org ([198.145.29.99]:42422 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730547AbgAVNXy (ORCPT ); Wed, 22 Jan 2020 08:23:54 -0500 Received: from localhost (unknown [84.241.205.26]) (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 251FA24688; Wed, 22 Jan 2020 13:23:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579699433; bh=QKDa25hlURHn5kDz4X4uEheo2MeMZoYUHemUpyuIs7Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=idqSZ/PAKrGsv1BCw5a/Es1Xjf3njgb26BnG+ROPO+RL4q+pA/J9lqKgcAggJnCf1 gq9sDdKwh/C6zonS+rKF0virzwmZoxRGkEwtPSm2Q2Kc2IzDzzSa58V21gu1ZarSVH yU/4QJxwGXdzsI9xlt63g2lfP8vs8di+Nj892OWk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Michael Grzeschik , Andrew Lunn , "David S. Miller" Subject: [PATCH 5.4 142/222] net: phy: dp83867: Set FORCE_LINK_GOOD to default after reset Date: Wed, 22 Jan 2020 10:28:48 +0100 Message-Id: <20200122092843.900371168@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200122092833.339495161@linuxfoundation.org> References: <20200122092833.339495161@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: Michael Grzeschik [ Upstream commit 86ffe920e669ec73035e84553e18edf17d16317c ] According to the Datasheet this bit should be 0 (Normal operation) in default. With the FORCE_LINK_GOOD bit set, it is not possible to get a link. This patch sets FORCE_LINK_GOOD to the default value after resetting the phy. Signed-off-by: Michael Grzeschik Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/phy/dp83867.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) --- a/drivers/net/phy/dp83867.c +++ b/drivers/net/phy/dp83867.c @@ -80,6 +80,7 @@ #define DP83867_PHYCR_FIFO_DEPTH_MAX 0x03 #define DP83867_PHYCR_FIFO_DEPTH_MASK GENMASK(15, 14) #define DP83867_PHYCR_RESERVED_MASK BIT(11) +#define DP83867_PHYCR_FORCE_LINK_GOOD BIT(10) /* RGMIIDCTL bits */ #define DP83867_RGMII_TX_CLK_DELAY_MAX 0xf @@ -454,7 +455,12 @@ static int dp83867_phy_reset(struct phy_ usleep_range(10, 20); - return 0; + /* After reset FORCE_LINK_GOOD bit is set. Although the + * default value should be unset. Disable FORCE_LINK_GOOD + * for the phy to work properly. + */ + return phy_modify(phydev, MII_DP83867_PHYCTRL, + DP83867_PHYCR_FORCE_LINK_GOOD, 0); } static struct phy_driver dp83867_driver[] = {