Skip to content

Commit a7e3a73

Browse files
Geetha sowjanyagregkh
authored andcommitted
octeontx2-af: cn10k: Do not enable RPM loopback for LPC interfaces
[ Upstream commit df66b6e ] Internal looback is not supported to low rate LPCS interface like SGMII/QSGMII. Hence don't allow to enable for such interfaces. Fixes: 3ad3f8f ("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> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 97008a3 commit a7e3a73

1 file changed

Lines changed: 12 additions & 15 deletions

File tree

  • drivers/net/ethernet/marvell/octeontx2/af

‎drivers/net/ethernet/marvell/octeontx2/af/rpm.c‎

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -291,23 +291,20 @@ int rpm_lmac_internal_loopback(void *rpmd, int lmac_id, bool enable)
291291
if (!rpm || lmac_id >= rpm->lmac_count)
292292
return -ENODEV;
293293
lmac_type = rpm->mac_ops->get_lmac_type(rpm, lmac_id);
294-
if (lmac_type == LMAC_MODE_100G_R) {
295-
cfg = rpm_read(rpm, lmac_id, RPMX_MTI_PCS100X_CONTROL1);
296-
297-
if (enable)
298-
cfg |= RPMX_MTI_PCS_LBK;
299-
else
300-
cfg &= ~RPMX_MTI_PCS_LBK;
301-
rpm_write(rpm, lmac_id, RPMX_MTI_PCS100X_CONTROL1, cfg);
302-
} else {
303-
cfg = rpm_read(rpm, lmac_id, RPMX_MTI_LPCSX_CONTROL1);
304-
if (enable)
305-
cfg |= RPMX_MTI_PCS_LBK;
306-
else
307-
cfg &= ~RPMX_MTI_PCS_LBK;
308-
rpm_write(rpm, lmac_id, RPMX_MTI_LPCSX_CONTROL1, cfg);
294+
295+
if (lmac_type == LMAC_MODE_QSGMII || lmac_type == LMAC_MODE_SGMII) {
296+
dev_err(&rpm->pdev->dev, "loopback not supported for LPC mode\n");
297+
return 0;
309298
}
310299

300+
cfg = rpm_read(rpm, lmac_id, RPMX_MTI_PCS100X_CONTROL1);
301+
302+
if (enable)
303+
cfg |= RPMX_MTI_PCS_LBK;
304+
else
305+
cfg &= ~RPMX_MTI_PCS_LBK;
306+
rpm_write(rpm, lmac_id, RPMX_MTI_PCS100X_CONTROL1, cfg);
307+
311308
return 0;
312309
}
313310

0 commit comments

Comments
 (0)