netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: phy: at803x: mask 1000 Base-X link mode
@ 2021-06-27 10:16 David Bauer
  2021-06-27 17:08 ` Andrew Lunn
  2021-06-28 22:50 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: David Bauer @ 2021-06-27 10:16 UTC (permalink / raw)
  To: andrew, hkallweit1, linux, davem, kuba, netdev

AR8031/AR8033 have different status registers for copper
and fiber operation. However, the extended status register
is the same for both operation modes.

As a result of that, ESTATUS_1000_XFULL is set to 1 even when
operating in copper TP mode.

Remove this mode from the supported link modes, as this driver
currently only supports copper operation.

Signed-off-by: David Bauer <mail@david-bauer.net>
---
 drivers/net/phy/at803x.c | 30 +++++++++++++++++++++++++++++-
 1 file changed, 29 insertions(+), 1 deletion(-)

diff --git a/drivers/net/phy/at803x.c b/drivers/net/phy/at803x.c
index 32af52dd5aed..d797c2c9ae3f 100644
--- a/drivers/net/phy/at803x.c
+++ b/drivers/net/phy/at803x.c
@@ -610,6 +610,34 @@ static void at803x_remove(struct phy_device *phydev)
 		regulator_disable(priv->vddio);
 }
 
+static int at803x_get_features(struct phy_device *phydev)
+{
+	int err;
+
+	err = genphy_read_abilities(phydev);
+	if (err)
+		return err;
+
+	if (!at803x_match_phy_id(phydev, ATH8031_PHY_ID))
+		return 0;
+
+	/* AR8031/AR8033 have different status registers
+	 * for copper and fiber operation. However, the
+	 * extended status register is the same for both
+	 * operation modes.
+	 *
+	 * As a result of that, ESTATUS_1000_XFULL is set
+	 * to 1 even when operating in copper TP mode.
+	 *
+	 * Remove this mode from the supported link modes,
+	 * as this driver currently only supports copper
+	 * operation.
+	 */
+	linkmode_clear_bit(ETHTOOL_LINK_MODE_1000baseX_Full_BIT,
+			   phydev->supported);
+	return 0;
+}
+
 static int at803x_smarteee_config(struct phy_device *phydev)
 {
 	struct at803x_priv *priv = phydev->priv;
@@ -1225,7 +1253,7 @@ static struct phy_driver at803x_driver[] = {
 	.resume			= at803x_resume,
 	.read_page		= at803x_read_page,
 	.write_page		= at803x_write_page,
-	/* PHY_GBIT_FEATURES */
+	.get_features		= at803x_get_features,
 	.read_status		= at803x_read_status,
 	.config_intr		= &at803x_config_intr,
 	.handle_interrupt	= at803x_handle_interrupt,
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] net: phy: at803x: mask 1000 Base-X link mode
  2021-06-27 10:16 [PATCH] net: phy: at803x: mask 1000 Base-X link mode David Bauer
@ 2021-06-27 17:08 ` Andrew Lunn
  2021-06-28 22:50 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Andrew Lunn @ 2021-06-27 17:08 UTC (permalink / raw)
  To: David Bauer; +Cc: hkallweit1, linux, davem, kuba, netdev

On Sun, Jun 27, 2021 at 12:16:07PM +0200, David Bauer wrote:
> AR8031/AR8033 have different status registers for copper
> and fiber operation. However, the extended status register
> is the same for both operation modes.
> 
> As a result of that, ESTATUS_1000_XFULL is set to 1 even when
> operating in copper TP mode.
> 
> Remove this mode from the supported link modes, as this driver
> currently only supports copper operation.
> 
> Signed-off-by: David Bauer <mail@david-bauer.net>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] net: phy: at803x: mask 1000 Base-X link mode
  2021-06-27 10:16 [PATCH] net: phy: at803x: mask 1000 Base-X link mode David Bauer
  2021-06-27 17:08 ` Andrew Lunn
@ 2021-06-28 22:50 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-06-28 22:50 UTC (permalink / raw)
  To: David Bauer; +Cc: andrew, hkallweit1, linux, davem, kuba, netdev

Hello:

This patch was applied to netdev/net.git (refs/heads/master):

On Sun, 27 Jun 2021 12:16:07 +0200 you wrote:
> AR8031/AR8033 have different status registers for copper
> and fiber operation. However, the extended status register
> is the same for both operation modes.
> 
> As a result of that, ESTATUS_1000_XFULL is set to 1 even when
> operating in copper TP mode.
> 
> [...]

Here is the summary with links:
  - net: phy: at803x: mask 1000 Base-X link mode
    https://git.kernel.org/netdev/net/c/b856150c8098

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-06-28 22:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-06-27 10:16 [PATCH] net: phy: at803x: mask 1000 Base-X link mode David Bauer
2021-06-27 17:08 ` Andrew Lunn
2021-06-28 22:50 ` patchwork-bot+netdevbpf

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).