Skip to content

Commit d280233

Browse files
Hariprasad Kelamkuba-moo
authored andcommitted
Octeontx2-af: Fix NIX X2P calibration failures
Before configuring the NIX block, the AF driver initiates the "NIX block X2P bus calibration" and verifies that NIX interfaces such as CGX and LBK are active and functioning correctly. On few silicon variants(CNF10KA and CNF10KB), X2P calibration failures have been observed on some CGX blocks that are not mapped to the NIX block. Since both NIX-mapped and non-NIX-mapped CGX blocks share the same VENDOR,DEVICE,SUBSYS_DEVID, it's not possible to skip probe based on these parameters. This patch introuduces "is_cgx_mapped_to_nix" API to detect and skip probe of non NIX mapped CGX blocks. Fixes: aba53d5 ("octeontx2-af: NIX block admin queue init") Signed-off-by: Hariprasad Kelam <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent ec79003 commit d280233

File tree

2 files changed

+21
-0
lines changed
  • drivers/net/ethernet/marvell/octeontx2/af

2 files changed

+21
-0
lines changed

drivers/net/ethernet/marvell/octeontx2/af/cgx.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1978,6 +1978,13 @@ static int cgx_probe(struct pci_dev *pdev, const struct pci_device_id *id)
19781978
goto err_release_regions;
19791979
}
19801980

1981+
if (!is_cn20k(pdev) &&
1982+
!is_cgx_mapped_to_nix(pdev->subsystem_device, cgx->cgx_id)) {
1983+
dev_notice(dev, "CGX %d not mapped to NIX, skipping probe\n",
1984+
cgx->cgx_id);
1985+
goto err_release_regions;
1986+
}
1987+
19811988
cgx->lmac_count = cgx->mac_ops->get_nr_lmacs(cgx);
19821989
if (!cgx->lmac_count) {
19831990
dev_notice(dev, "CGX %d LMAC count is zero, skipping probe\n", cgx->cgx_id);

drivers/net/ethernet/marvell/octeontx2/af/rvu.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -783,6 +783,20 @@ static inline bool is_cn10kb(struct rvu *rvu)
783783
return false;
784784
}
785785

786+
static inline bool is_cgx_mapped_to_nix(unsigned short id, u8 cgx_id)
787+
{
788+
/* On CNF10KA and CNF10KB silicons only two CGX blocks are connected
789+
* to NIX.
790+
*/
791+
if (id == PCI_SUBSYS_DEVID_CNF10K_A || id == PCI_SUBSYS_DEVID_CNF10K_B)
792+
return cgx_id <= 1;
793+
794+
return !(cgx_id && !(id == PCI_SUBSYS_DEVID_96XX ||
795+
id == PCI_SUBSYS_DEVID_98XX ||
796+
id == PCI_SUBSYS_DEVID_CN10K_A ||
797+
id == PCI_SUBSYS_DEVID_CN10K_B));
798+
}
799+
786800
static inline bool is_rvu_npc_hash_extract_en(struct rvu *rvu)
787801
{
788802
u64 npc_const3;

0 commit comments

Comments
 (0)