2
0
mirror of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2025-09-04 20:19:47 +08:00

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: aba53d5dbc ("octeontx2-af: NIX block admin queue init")
Signed-off-by: Hariprasad Kelam <hkelam@marvell.com>
Link: https://patch.msgid.link/20250822105805.2236528-1-hkelam@marvell.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
Hariprasad Kelam 2025-08-22 16:28:05 +05:30 committed by Jakub Kicinski
parent ec79003c5f
commit d280233fc8
2 changed files with 21 additions and 0 deletions

View File

@ -1978,6 +1978,13 @@ static int cgx_probe(struct pci_dev *pdev, const struct pci_device_id *id)
goto err_release_regions; goto err_release_regions;
} }
if (!is_cn20k(pdev) &&
!is_cgx_mapped_to_nix(pdev->subsystem_device, cgx->cgx_id)) {
dev_notice(dev, "CGX %d not mapped to NIX, skipping probe\n",
cgx->cgx_id);
goto err_release_regions;
}
cgx->lmac_count = cgx->mac_ops->get_nr_lmacs(cgx); cgx->lmac_count = cgx->mac_ops->get_nr_lmacs(cgx);
if (!cgx->lmac_count) { if (!cgx->lmac_count) {
dev_notice(dev, "CGX %d LMAC count is zero, skipping probe\n", cgx->cgx_id); dev_notice(dev, "CGX %d LMAC count is zero, skipping probe\n", cgx->cgx_id);

View File

@ -783,6 +783,20 @@ static inline bool is_cn10kb(struct rvu *rvu)
return false; return false;
} }
static inline bool is_cgx_mapped_to_nix(unsigned short id, u8 cgx_id)
{
/* On CNF10KA and CNF10KB silicons only two CGX blocks are connected
* to NIX.
*/
if (id == PCI_SUBSYS_DEVID_CNF10K_A || id == PCI_SUBSYS_DEVID_CNF10K_B)
return cgx_id <= 1;
return !(cgx_id && !(id == PCI_SUBSYS_DEVID_96XX ||
id == PCI_SUBSYS_DEVID_98XX ||
id == PCI_SUBSYS_DEVID_CN10K_A ||
id == PCI_SUBSYS_DEVID_CN10K_B));
}
static inline bool is_rvu_npc_hash_extract_en(struct rvu *rvu) static inline bool is_rvu_npc_hash_extract_en(struct rvu *rvu)
{ {
u64 npc_const3; u64 npc_const3;