All of lore.kernel.org
 help / color / mirror / Atom feed
From: Raju Rangoju <Raju.Rangoju@amd.com>
To: <thomas.lendacky@amd.com>, <Shyam-sundar.S-k@amd.com>,
	<davem@davemloft.net>, <kuba@kernel.org>
Cc: <netdev@vger.kernel.org>, <Rajesh1.Kumar@amd.com>,
	Raju Rangoju <Raju.Rangoju@amd.com>
Subject: [PATCH v3 net 3/5] amd-xgbe: enable PLL_CTL for fixed PHY modes only
Date: Thu, 20 Oct 2022 12:12:13 +0530	[thread overview]
Message-ID: <20221020064215.2341278-4-Raju.Rangoju@amd.com> (raw)
In-Reply-To: <20221020064215.2341278-1-Raju.Rangoju@amd.com>

PLL control setting(RRC) is needed only in fixed PHY configuration to
fix the peer-peer issues. Without the PLL control setting, the link up
takes longer time in a fixed phy configuration.

Driver implements SW RRC for Autoneg On configuration, hence PLL control
setting (RRC) is not needed for AN On configuration, and can be skipped.

Also, PLL re-initialization is not needed for PHY Power Off and RRC
commands. Otherwise, they lead to mailbox errors. Added the changes
accordingly.

Fixes: daf182d360e5 ("net: amd-xgbe: Toggle PLL settings during rate change")
Signed-off-by: Raju Rangoju <Raju.Rangoju@amd.com>
---
Changes since v2:
 - update the POWER_OFF and RRC enumerations
 - updated the commit message to use RRC instead of RRCM

Changes since v1:
- used enums for all mailxbox command and subcommands, pre-patch to this
  contains the enum updates
- updated the comment section to include RRC command
- updated the commit message to use RRC instead of RRCM

 drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c b/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c
index 8cf5d81fca36..349ba0dc1fa2 100644
--- a/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c
+++ b/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c
@@ -1979,6 +1979,10 @@ static void xgbe_phy_rx_reset(struct xgbe_prv_data *pdata)
 
 static void xgbe_phy_pll_ctrl(struct xgbe_prv_data *pdata, bool enable)
 {
+	/* PLL_CTRL feature needs to be enabled for fixed PHY modes (Non-Autoneg) only */
+	if (pdata->phy.autoneg != AUTONEG_DISABLE)
+		return;
+
 	XMDIO_WRITE_BITS(pdata, MDIO_MMD_PMAPMD, MDIO_VEND2_PMA_MISC_CTRL0,
 			 XGBE_PMA_PLL_CTRL_MASK,
 			 enable ? XGBE_PMA_PLL_CTRL_ENABLE
@@ -2029,8 +2033,10 @@ static void xgbe_phy_perform_ratechange(struct xgbe_prv_data *pdata,
 	xgbe_phy_rx_reset(pdata);
 
 reenable_pll:
-	/* Enable PLL re-initialization */
-	xgbe_phy_pll_ctrl(pdata, true);
+	/* Enable PLL re-initialization, not needed for PHY Power Off and RRC cmds */
+	if (cmd != XGBE_MB_CMD_POWER_OFF &&
+	    cmd != XGBE_MB_CMD_RRC)
+		xgbe_phy_pll_ctrl(pdata, true);
 }
 
 static void xgbe_phy_rrc(struct xgbe_prv_data *pdata)
-- 
2.25.1


  parent reply	other threads:[~2022-10-20  6:43 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-20  6:42 [PATCH v3 net 0/5] amd-xgbe: Miscellaneous fixes Raju Rangoju
2022-10-20  6:42 ` [PATCH v3 net 1/5] amd-xgbe: Yellow carp devices do not need rrc Raju Rangoju
2022-10-21  4:46   ` Jakub Kicinski
2022-10-21 13:40     ` Tom Lendacky
2022-10-20  6:42 ` [PATCH v3 net 2/5] amd-xgbe: use enums for mailbox cmd and sub_cmds Raju Rangoju
2022-10-20  6:42 ` Raju Rangoju [this message]
2022-10-20  6:42 ` [PATCH v3 net 4/5] amd-xgbe: fix the SFP compliance codes check for DAC cables Raju Rangoju
2022-10-20  6:42 ` [PATCH v3 net 5/5] amd-xgbe: add the bit rate quirk for Molex cables Raju Rangoju
2022-10-20 17:33 ` [PATCH v3 net 0/5] amd-xgbe: Miscellaneous fixes Tom Lendacky
2022-10-22  5:50 ` patchwork-bot+netdevbpf

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=20221020064215.2341278-4-Raju.Rangoju@amd.com \
    --to=raju.rangoju@amd.com \
    --cc=Rajesh1.Kumar@amd.com \
    --cc=Shyam-sundar.S-k@amd.com \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=thomas.lendacky@amd.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.