netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Subbaraya Sundeep <sbhatta@marvell.com>
To: <davem@davemloft.net>, <kuba@kernel.org>,
	<netdev@vger.kernel.org>, <sundeep.lkml@gmail.com>
Cc: <hkelam@marvell.com>, <gakula@marvell.com>,
	<sgoutham@marvell.com>, Subbaraya Sundeep <sbhatta@marvell.com>
Subject: [net PATCH 7/9] octeontx2-af: cn10k: Do not enable RPM loopback for LPC interfaces
Date: Fri, 21 Jan 2022 12:04:45 +0530	[thread overview]
Message-ID: <1642746887-30924-8-git-send-email-sbhatta@marvell.com> (raw)
In-Reply-To: <1642746887-30924-1-git-send-email-sbhatta@marvell.com>

From: Geetha sowjanya <gakula@marvell.com>

Internal looback is not supported to low rate LPCS interface like
SGMII/QSGMII. Hence don't allow to enable for such interfaces.

Fixes: 3ad3f8f93c81 ("octeontx2-af: cn10k: MAC internal loopback support")
Signed-off-by: Geetha sowjanya <gakula@marvell.com>
Signed-off-by: Subbaraya Sundeep <sbhatta@marvell.com>
Signed-off-by: Sunil Goutham <sgoutham@marvell.com>
---
 drivers/net/ethernet/marvell/octeontx2/af/rpm.c | 27 +++++++++++--------------
 1 file changed, 12 insertions(+), 15 deletions(-)

diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rpm.c b/drivers/net/ethernet/marvell/octeontx2/af/rpm.c
index 4cbd915..9ea2f6a 100644
--- a/drivers/net/ethernet/marvell/octeontx2/af/rpm.c
+++ b/drivers/net/ethernet/marvell/octeontx2/af/rpm.c
@@ -291,23 +291,20 @@ int rpm_lmac_internal_loopback(void *rpmd, int lmac_id, bool enable)
 	if (!rpm || lmac_id >= rpm->lmac_count)
 		return -ENODEV;
 	lmac_type = rpm->mac_ops->get_lmac_type(rpm, lmac_id);
-	if (lmac_type == LMAC_MODE_100G_R) {
-		cfg = rpm_read(rpm, lmac_id, RPMX_MTI_PCS100X_CONTROL1);
-
-		if (enable)
-			cfg |= RPMX_MTI_PCS_LBK;
-		else
-			cfg &= ~RPMX_MTI_PCS_LBK;
-		rpm_write(rpm, lmac_id, RPMX_MTI_PCS100X_CONTROL1, cfg);
-	} else {
-		cfg = rpm_read(rpm, lmac_id, RPMX_MTI_LPCSX_CONTROL1);
-		if (enable)
-			cfg |= RPMX_MTI_PCS_LBK;
-		else
-			cfg &= ~RPMX_MTI_PCS_LBK;
-		rpm_write(rpm, lmac_id, RPMX_MTI_LPCSX_CONTROL1, cfg);
+
+	if (lmac_type == LMAC_MODE_QSGMII || lmac_type == LMAC_MODE_SGMII) {
+		dev_err(&rpm->pdev->dev, "loopback not supported for LPC mode\n");
+		return 0;
 	}
 
+	cfg = rpm_read(rpm, lmac_id, RPMX_MTI_PCS100X_CONTROL1);
+
+	if (enable)
+		cfg |= RPMX_MTI_PCS_LBK;
+	else
+		cfg &= ~RPMX_MTI_PCS_LBK;
+	rpm_write(rpm, lmac_id, RPMX_MTI_PCS100X_CONTROL1, cfg);
+
 	return 0;
 }
 
-- 
2.7.4


  parent reply	other threads:[~2022-01-21  6:35 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-21  6:34 [net PATCH 0/9] Fixes for CN10K and CN9xxx platforms Subbaraya Sundeep
2022-01-21  6:34 ` [net PATCH 1/9] octeontx2-af: Do not fixup all VF action entries Subbaraya Sundeep
2022-01-21  6:34 ` [net PATCH 2/9] octeontx2-af: Fix LBK backpressure id count Subbaraya Sundeep
2022-01-21  6:34 ` [net PATCH 3/9] octeontx2-af: Retry until RVU block reset complete Subbaraya Sundeep
2022-01-21  6:34 ` [net PATCH 4/9] octeontx2-af: cn10k: Use appropriate register for LMAC enable Subbaraya Sundeep
2022-01-21  6:34 ` [net PATCH 5/9] octeontx2-pf: cn10k: Ensure valid pointers are freed to aura Subbaraya Sundeep
2022-01-21  6:34 ` [net PATCH 6/9] octeontx2-af: Increase link credit restore polling timeout Subbaraya Sundeep
2022-01-21  6:34 ` Subbaraya Sundeep [this message]
2022-01-21  6:34 ` [net PATCH 8/9] octeontx2-pf: Forward error codes to VF Subbaraya Sundeep
2022-01-21  6:34 ` [net PATCH 9/9] octeontx2-af: Add KPU changes to parse NGIO as separate layer Subbaraya Sundeep
2022-01-27 13:32 ` [net PATCH 0/9] Fixes for CN10K and CN9xxx platforms sundeep subbaraya
2022-01-27 15:24   ` Jakub Kicinski
2022-01-28  3:58     ` sundeep subbaraya

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=1642746887-30924-8-git-send-email-sbhatta@marvell.com \
    --to=sbhatta@marvell.com \
    --cc=davem@davemloft.net \
    --cc=gakula@marvell.com \
    --cc=hkelam@marvell.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=sgoutham@marvell.com \
    --cc=sundeep.lkml@gmail.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 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).