Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1619872pxb; Mon, 11 Oct 2021 09:36:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwDFDPNN3TwDK1M0ur8DfIicVlz0xZf5Gc9FZsdqF2juyd8hRHnjb9qzdaS048yWMAxSVeB X-Received: by 2002:a17:902:d48a:b0:13f:4411:8ae9 with SMTP id c10-20020a170902d48a00b0013f44118ae9mr3820839plg.86.1633970212852; Mon, 11 Oct 2021 09:36:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633970212; cv=none; d=google.com; s=arc-20160816; b=eoe2HzsLRJDW5eyQzG+0DmvVkuQMtkPnzB7ycjQCAyXDwDFXRD8EEhTr6BwVSBpdmp Af106Cs+FpPxn+osY/RM8gI7Dwge2nymHe+iPD539ckLWI4pMv0TvRvufoGxsAPZoEGr dFIS78xFxN4eCMH+++azBQTL+c6NByswq+E7FAlcqC3WfKJ9FzBXEPftXxfily4ozmK/ D82FNbMeN7tkY/nh+5K/OpBR/F/cbor4MhJSXcsvPDlD8T95M+PQ9B2ycDGMUsSI2WLO 8HZTbONDRE/NWcQRnFScnp55l9YC8yIqUH2/DSynExCerNy+p6VPhY8pqSqH3Q9ZlYaE gA+g== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=8uTLbCObr6iPcTfBlJ7IUDWDgYB8uidbGZmvEnurNZU=; b=d2r9nEtG9R3rlFymRb253lyL+6b0a/+FYqeaWEaMI7am3enBLd92KRkTmLWdAyzjpS Rsl6lA8k4O/f48ThTMdDTOuubNz+2b7btj5iiSsaMFEr0LaEVl+FsjI3PVzSoOto9mSq Pko3tkUJk+aV3pWmlE9n4Qzb9ZM1iGxQ83tnwc8w/XgZBoA2NLjIWLmZyPyQeO/IpLsq tQe67Yld8hEZUyecresDBS5/mQytM1uoc8N8R+4GPDyI1pmg3r3FsHQEHYdZCC5K4H6B 9pI8DLNeQuAMVNZ71VULNa8NlGtbfzgCR4TAYvs3scvxyRM025yOd29OiMzWQG4Lw/w9 ZFhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=E3SMeAAh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q18si6780903pfk.48.2021.10.11.09.36.40; Mon, 11 Oct 2021 09:36:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=E3SMeAAh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239663AbhJKOML (ORCPT + 99 others); Mon, 11 Oct 2021 10:12:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:57621 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242408AbhJKOI4 (ORCPT ); Mon, 11 Oct 2021 10:08:56 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5A544610A4; Mon, 11 Oct 2021 14:01:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1633960897; bh=HhpJpmWrjCFG1UDrTsOVQChc5YErbrpiZFtouS3DQng=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=E3SMeAAhZ1rQkBzuWJJdhqTMQslOoPpTrOZCYeJqvwV06u9zHSSg7REE4fFKjzDze 3DtzZOyuP8L9ue25faqckCPqviFzTeqKCELn4K8UjcDFxau13DJ0ooGlwVCwiTyeto xKI9k8OlZe6kpgzZjMCK7Gt+jGMzD9GcLj5tbB7M= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Michael Sit Wei Hong , Wong Vee Khee , "David S. Miller" , Sasha Levin Subject: [PATCH 5.14 106/151] net: pcs: xpcs: fix incorrect steps on disable EEE Date: Mon, 11 Oct 2021 15:46:18 +0200 Message-Id: <20211011134521.243663376@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211011134517.833565002@linuxfoundation.org> References: <20211011134517.833565002@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Wong Vee Khee [ Upstream commit 590df78bc7d1d0425196a8e11ce6676d7023fb26 ] When Energy-Efficient Ethernet(EEE) is disable from the MAC side, we need to clear the DW_VR_MII_EEE_TRN_LPI bit of DW_VR_MII_EEE_MCTRL1 register. Fixes: 7617af3d1a5e ("net: pcs: Introducing support for DWC xpcs Energy Efficient Ethernet") Cc: Michael Sit Wei Hong Signed-off-by: Wong Vee Khee Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/pcs/pcs-xpcs.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/net/pcs/pcs-xpcs.c b/drivers/net/pcs/pcs-xpcs.c index 4a169545797b..d4ab03a92fb5 100644 --- a/drivers/net/pcs/pcs-xpcs.c +++ b/drivers/net/pcs/pcs-xpcs.c @@ -662,6 +662,10 @@ int xpcs_config_eee(struct dw_xpcs *xpcs, int mult_fact_100ns, int enable) { int ret; + ret = xpcs_read(xpcs, MDIO_MMD_VEND2, DW_VR_MII_EEE_MCTRL0); + if (ret < 0) + return ret; + if (enable) { /* Enable EEE */ ret = DW_VR_MII_EEE_LTX_EN | DW_VR_MII_EEE_LRX_EN | @@ -669,9 +673,6 @@ int xpcs_config_eee(struct dw_xpcs *xpcs, int mult_fact_100ns, int enable) DW_VR_MII_EEE_TX_EN_CTRL | DW_VR_MII_EEE_RX_EN_CTRL | mult_fact_100ns << DW_VR_MII_EEE_MULT_FACT_100NS_SHIFT; } else { - ret = xpcs_read(xpcs, MDIO_MMD_VEND2, DW_VR_MII_EEE_MCTRL0); - if (ret < 0) - return ret; ret &= ~(DW_VR_MII_EEE_LTX_EN | DW_VR_MII_EEE_LRX_EN | DW_VR_MII_EEE_TX_QUIET_EN | DW_VR_MII_EEE_RX_QUIET_EN | DW_VR_MII_EEE_TX_EN_CTRL | DW_VR_MII_EEE_RX_EN_CTRL | @@ -686,7 +687,11 @@ int xpcs_config_eee(struct dw_xpcs *xpcs, int mult_fact_100ns, int enable) if (ret < 0) return ret; - ret |= DW_VR_MII_EEE_TRN_LPI; + if (enable) + ret |= DW_VR_MII_EEE_TRN_LPI; + else + ret &= ~DW_VR_MII_EEE_TRN_LPI; + return xpcs_write(xpcs, MDIO_MMD_VEND2, DW_VR_MII_EEE_MCTRL1, ret); } EXPORT_SYMBOL_GPL(xpcs_config_eee); -- 2.33.0