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=unavailable 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 834E3C352AA for ; Tue, 1 Oct 2019 16:43:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4B96421920 for ; Tue, 1 Oct 2019 16:43:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1569948223; bh=tmXa0FEQRJPapT/YfBJ9PRkdDGPkucied7VAktKeJSI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=US/n7WlVBwiyj6mQrnDREHbwm7tla6JyW1G1dRfvCTRgS18f9pHS+QXDcpdzG7T55 Ww0es4xj4v2Wo8eBZpFQR1hIji5eyv52h0QjzaQD/fkjnWjHcBzB932mgeEiKmTY19 LEpStcJvEo9O/3O9LZqEDQ6e35ZWrj9lGoL1y7Vo= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732927AbfJAQnl (ORCPT ); Tue, 1 Oct 2019 12:43:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:55780 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732865AbfJAQnj (ORCPT ); Tue, 1 Oct 2019 12:43:39 -0400 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 D6BA12190F; Tue, 1 Oct 2019 16:43:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1569948218; bh=tmXa0FEQRJPapT/YfBJ9PRkdDGPkucied7VAktKeJSI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NddOCQEd0GVsTOw1WnVMll2CJLrS8gwJmbwtDzIR+CA+5733Lw9KuFdrwAzCuYQcj prerDrP2B2bmQBwWj7++w3Ql4XJ48h7ZSdHmYbFkCrUxTRgjf1I1UiLTOkxnpJPJcG TdfQu4/RcQqHsCFr7iJkDSi5must5Z+s7bQmcz+U= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Peter Mamonov , Andrew Lunn , Jakub Kicinski , Sasha Levin , netdev@vger.kernel.org Subject: [PATCH AUTOSEL 4.19 20/43] net/phy: fix DP83865 10 Mbps HDX loopback disable function Date: Tue, 1 Oct 2019 12:42:48 -0400 Message-Id: <20191001164311.15993-20-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191001164311.15993-1-sashal@kernel.org> References: <20191001164311.15993-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Peter Mamonov [ Upstream commit e47488b2df7f9cb405789c7f5d4c27909fc597ae ] According to the DP83865 datasheet "the 10 Mbps HDX loopback can be disabled in the expanded memory register 0x1C0.1". The driver erroneously used bit 0 instead of bit 1. Fixes: 4621bf129856 ("phy: Add file missed in previous commit.") Signed-off-by: Peter Mamonov Reviewed-by: Andrew Lunn Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/phy/national.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/net/phy/national.c b/drivers/net/phy/national.c index 2b1e336961f9c..bf4070ef6b84f 100644 --- a/drivers/net/phy/national.c +++ b/drivers/net/phy/national.c @@ -110,14 +110,17 @@ static void ns_giga_speed_fallback(struct phy_device *phydev, int mode) static void ns_10_base_t_hdx_loopack(struct phy_device *phydev, int disable) { + u16 lb_dis = BIT(1); + if (disable) - ns_exp_write(phydev, 0x1c0, ns_exp_read(phydev, 0x1c0) | 1); + ns_exp_write(phydev, 0x1c0, + ns_exp_read(phydev, 0x1c0) | lb_dis); else ns_exp_write(phydev, 0x1c0, - ns_exp_read(phydev, 0x1c0) & 0xfffe); + ns_exp_read(phydev, 0x1c0) & ~lb_dis); pr_debug("10BASE-T HDX loopback %s\n", - (ns_exp_read(phydev, 0x1c0) & 0x0001) ? "off" : "on"); + (ns_exp_read(phydev, 0x1c0) & lb_dis) ? "off" : "on"); } static int ns_config_init(struct phy_device *phydev) -- 2.20.1