From: Mohammad Athari Bin Ismail <mohammad.athari.ismail@intel.com>
To: Andrew Lunn <andrew@lunn.ch>,
"David S . Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
Oleksij Rempel <linux@rempel-privat.de>,
Heiner Kallweit <hkallweit1@gmail.com>,
Russell King <linux@armlinux.org.uk>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
mohammad.athari.ismail@intel.com, stable@vger.kernel.org
Subject: [PATCH net 1/1] net: phy: marvell: add Marvell specific PHY loopback
Date: Mon, 10 Jan 2022 14:21:17 +0800 [thread overview]
Message-ID: <20220110062117.17540-2-mohammad.athari.ismail@intel.com> (raw)
In-Reply-To: <20220110062117.17540-1-mohammad.athari.ismail@intel.com>
Existing genphy_loopback() is not applicable for Marvell PHY. So,
adding Marvell specific PHY loopback operation by only setting(enable) or
clearing(disable) BMCR_LOOPBACK bit.
Tested working on Marvell 88E1510.
Fixes: 014068dcb5b1 ("net: phy: genphy_loopback: add link speed configuration")
Cc: <stable@vger.kernel.org> # 5.15.x
Signed-off-by: Mohammad Athari Bin Ismail <mohammad.athari.ismail@intel.com>
---
drivers/net/phy/marvell.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c
index 4fcfca4e1702..2a73a959b48b 100644
--- a/drivers/net/phy/marvell.c
+++ b/drivers/net/phy/marvell.c
@@ -1932,6 +1932,12 @@ static void marvell_get_stats(struct phy_device *phydev,
data[i] = marvell_get_stat(phydev, i);
}
+static int marvell_loopback(struct phy_device *phydev, bool enable)
+{
+ return phy_modify(phydev, MII_BMCR, BMCR_LOOPBACK,
+ enable ? BMCR_LOOPBACK : 0);
+}
+
static int marvell_vct5_wait_complete(struct phy_device *phydev)
{
int i;
@@ -3078,7 +3084,7 @@ static struct phy_driver marvell_drivers[] = {
.get_sset_count = marvell_get_sset_count,
.get_strings = marvell_get_strings,
.get_stats = marvell_get_stats,
- .set_loopback = genphy_loopback,
+ .set_loopback = marvell_loopback,
.get_tunable = m88e1011_get_tunable,
.set_tunable = m88e1011_set_tunable,
.cable_test_start = marvell_vct7_cable_test_start,
--
2.17.1
next prev parent reply other threads:[~2022-01-10 6:22 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-10 6:21 [PATCH net 0/1] net: phy: marvell: add Marvell specific PHY loopback Mohammad Athari Bin Ismail
2022-01-10 6:21 ` Mohammad Athari Bin Ismail [this message]
2022-01-10 8:34 ` [PATCH net 1/1] " Heiner Kallweit
2022-01-10 9:36 ` Ismail, Mohammad Athari
2022-01-10 10:17 ` Heiner Kallweit
2022-01-12 9:30 ` Ismail, Mohammad Athari
2022-01-10 9:35 ` [PATCH net 0/1] " Russell King (Oracle)
2022-01-10 9:47 ` Ismail, Mohammad Athari
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=20220110062117.17540-2-mohammad.athari.ismail@intel.com \
--to=mohammad.athari.ismail@intel.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=hkallweit1@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=linux@rempel-privat.de \
--cc=netdev@vger.kernel.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).