From: Sasha Levin <sashal@kernel•org>
To: linux-kernel@vger•kernel.org, stable@vger•kernel.org
Cc: Peter Mamonov <pmamonov@gmail•com>, Andrew Lunn <andrew@lunn•ch>,
Jakub Kicinski <jakub.kicinski@netronome•com>,
Sasha Levin <sashal@kernel•org>,
netdev@vger•kernel.org
Subject: [PATCH AUTOSEL 4.4 09/15] net/phy: fix DP83865 10 Mbps HDX loopback disable function
Date: Tue, 1 Oct 2019 12:45:27 -0400 [thread overview]
Message-ID: <20191001164533.16915-9-sashal@kernel.org> (raw)
In-Reply-To: <20191001164533.16915-1-sashal@kernel.org>
From: Peter Mamonov <pmamonov@gmail•com>
[ 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 <pmamonov@gmail•com>
Reviewed-by: Andrew Lunn <andrew@lunn•ch>
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome•com>
Signed-off-by: Sasha Levin <sashal@kernel•org>
---
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 0a7b9c7f09a29..5c40655ec808b 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
next prev parent reply other threads:[~2019-10-01 16:46 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20191001164533.16915-1-sashal@kernel.org>
2019-10-01 16:45 ` [PATCH AUTOSEL 4.4 07/15] cdc_ncm: fix divide-by-zero caused by invalid wMaxPacketSize Sasha Levin
2019-10-01 16:45 ` [PATCH AUTOSEL 4.4 08/15] usbnet: ignore endpoints with " Sasha Levin
2019-10-01 16:45 ` Sasha Levin [this message]
2019-10-01 16:45 ` [PATCH AUTOSEL 4.4 12/15] arcnet: provide a buffer big enough to actually receive packets Sasha Levin
2019-10-01 16:45 ` [PATCH AUTOSEL 4.4 14/15] usbnet: sanity checking of packet sizes and device mtu Sasha Levin
2019-10-01 16:45 ` [PATCH AUTOSEL 4.4 15/15] sch_netem: fix a divide by zero in tabledist() Sasha Levin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191001164533.16915-9-sashal@kernel.org \
--to=sashal@kernel$(echo .)org \
--cc=andrew@lunn$(echo .)ch \
--cc=jakub.kicinski@netronome$(echo .)com \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=netdev@vger$(echo .)kernel.org \
--cc=pmamonov@gmail$(echo .)com \
--cc=stable@vger$(echo .)kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox