Commit a83bdada authored by Sunil Goutham's avatar Sunil Goutham Committed by David S. Miller

octeontx2-af: Add debug messages for failures

Added debug messages for various failures during probe.
This will help in quickly identifying the API where the failure
is happening.
Signed-off-by: default avatarSunil Goutham <sgoutham@marvell.com>
Signed-off-by: default avatarSubbaraya Sundeep <sbhatta@marvell.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 7278c359
...@@ -924,16 +924,26 @@ static int rvu_setup_hw_resources(struct rvu *rvu) ...@@ -924,16 +924,26 @@ static int rvu_setup_hw_resources(struct rvu *rvu)
block->lfreset_reg = NPA_AF_LF_RST; block->lfreset_reg = NPA_AF_LF_RST;
sprintf(block->name, "NPA"); sprintf(block->name, "NPA");
err = rvu_alloc_bitmap(&block->lf); err = rvu_alloc_bitmap(&block->lf);
if (err) if (err) {
dev_err(rvu->dev,
"%s: Failed to allocate NPA LF bitmap\n", __func__);
return err; return err;
}
nix: nix:
err = rvu_setup_nix_hw_resource(rvu, BLKADDR_NIX0); err = rvu_setup_nix_hw_resource(rvu, BLKADDR_NIX0);
if (err) if (err) {
dev_err(rvu->dev,
"%s: Failed to allocate NIX0 LFs bitmap\n", __func__);
return err; return err;
}
err = rvu_setup_nix_hw_resource(rvu, BLKADDR_NIX1); err = rvu_setup_nix_hw_resource(rvu, BLKADDR_NIX1);
if (err) if (err) {
dev_err(rvu->dev,
"%s: Failed to allocate NIX1 LFs bitmap\n", __func__);
return err; return err;
}
/* Init SSO group's bitmap */ /* Init SSO group's bitmap */
block = &hw->block[BLKADDR_SSO]; block = &hw->block[BLKADDR_SSO];
...@@ -953,8 +963,11 @@ static int rvu_setup_hw_resources(struct rvu *rvu) ...@@ -953,8 +963,11 @@ static int rvu_setup_hw_resources(struct rvu *rvu)
block->lfreset_reg = SSO_AF_LF_HWGRP_RST; block->lfreset_reg = SSO_AF_LF_HWGRP_RST;
sprintf(block->name, "SSO GROUP"); sprintf(block->name, "SSO GROUP");
err = rvu_alloc_bitmap(&block->lf); err = rvu_alloc_bitmap(&block->lf);
if (err) if (err) {
dev_err(rvu->dev,
"%s: Failed to allocate SSO LF bitmap\n", __func__);
return err; return err;
}
ssow: ssow:
/* Init SSO workslot's bitmap */ /* Init SSO workslot's bitmap */
...@@ -974,8 +987,11 @@ static int rvu_setup_hw_resources(struct rvu *rvu) ...@@ -974,8 +987,11 @@ static int rvu_setup_hw_resources(struct rvu *rvu)
block->lfreset_reg = SSOW_AF_LF_HWS_RST; block->lfreset_reg = SSOW_AF_LF_HWS_RST;
sprintf(block->name, "SSOWS"); sprintf(block->name, "SSOWS");
err = rvu_alloc_bitmap(&block->lf); err = rvu_alloc_bitmap(&block->lf);
if (err) if (err) {
dev_err(rvu->dev,
"%s: Failed to allocate SSOW LF bitmap\n", __func__);
return err; return err;
}
tim: tim:
/* Init TIM LF's bitmap */ /* Init TIM LF's bitmap */
...@@ -996,35 +1012,55 @@ static int rvu_setup_hw_resources(struct rvu *rvu) ...@@ -996,35 +1012,55 @@ static int rvu_setup_hw_resources(struct rvu *rvu)
block->lfreset_reg = TIM_AF_LF_RST; block->lfreset_reg = TIM_AF_LF_RST;
sprintf(block->name, "TIM"); sprintf(block->name, "TIM");
err = rvu_alloc_bitmap(&block->lf); err = rvu_alloc_bitmap(&block->lf);
if (err) if (err) {
dev_err(rvu->dev,
"%s: Failed to allocate TIM LF bitmap\n", __func__);
return err; return err;
}
cpt: cpt:
err = rvu_setup_cpt_hw_resource(rvu, BLKADDR_CPT0); err = rvu_setup_cpt_hw_resource(rvu, BLKADDR_CPT0);
if (err) if (err) {
dev_err(rvu->dev,
"%s: Failed to allocate CPT0 LF bitmap\n", __func__);
return err; return err;
}
err = rvu_setup_cpt_hw_resource(rvu, BLKADDR_CPT1); err = rvu_setup_cpt_hw_resource(rvu, BLKADDR_CPT1);
if (err) {
dev_err(rvu->dev,
"%s: Failed to allocate CPT1 LF bitmap\n", __func__);
return err;
}
if (err) if (err)
return err; return err;
/* Allocate memory for PFVF data */ /* Allocate memory for PFVF data */
rvu->pf = devm_kcalloc(rvu->dev, hw->total_pfs, rvu->pf = devm_kcalloc(rvu->dev, hw->total_pfs,
sizeof(struct rvu_pfvf), GFP_KERNEL); sizeof(struct rvu_pfvf), GFP_KERNEL);
if (!rvu->pf) if (!rvu->pf) {
dev_err(rvu->dev,
"%s: Failed to allocate memory for PF's rvu_pfvf struct\n", __func__);
return -ENOMEM; return -ENOMEM;
}
rvu->hwvf = devm_kcalloc(rvu->dev, hw->total_vfs, rvu->hwvf = devm_kcalloc(rvu->dev, hw->total_vfs,
sizeof(struct rvu_pfvf), GFP_KERNEL); sizeof(struct rvu_pfvf), GFP_KERNEL);
if (!rvu->hwvf) if (!rvu->hwvf) {
dev_err(rvu->dev,
"%s: Failed to allocate memory for VF's rvu_pfvf struct\n", __func__);
return -ENOMEM; return -ENOMEM;
}
mutex_init(&rvu->rsrc_lock); mutex_init(&rvu->rsrc_lock);
rvu_fwdata_init(rvu); rvu_fwdata_init(rvu);
err = rvu_setup_msix_resources(rvu); err = rvu_setup_msix_resources(rvu);
if (err) if (err) {
dev_err(rvu->dev,
"%s: Failed to setup MSIX resources\n", __func__);
return err; return err;
}
for (blkid = 0; blkid < BLK_COUNT; blkid++) { for (blkid = 0; blkid < BLK_COUNT; blkid++) {
block = &hw->block[blkid]; block = &hw->block[blkid];
...@@ -1050,25 +1086,33 @@ static int rvu_setup_hw_resources(struct rvu *rvu) ...@@ -1050,25 +1086,33 @@ static int rvu_setup_hw_resources(struct rvu *rvu)
goto msix_err; goto msix_err;
err = rvu_npc_init(rvu); err = rvu_npc_init(rvu);
if (err) if (err) {
dev_err(rvu->dev, "%s: Failed to initialize npc\n", __func__);
goto npc_err; goto npc_err;
}
err = rvu_cgx_init(rvu); err = rvu_cgx_init(rvu);
if (err) if (err) {
dev_err(rvu->dev, "%s: Failed to initialize cgx\n", __func__);
goto cgx_err; goto cgx_err;
}
/* Assign MACs for CGX mapped functions */ /* Assign MACs for CGX mapped functions */
rvu_setup_pfvf_macaddress(rvu); rvu_setup_pfvf_macaddress(rvu);
err = rvu_npa_init(rvu); err = rvu_npa_init(rvu);
if (err) if (err) {
dev_err(rvu->dev, "%s: Failed to initialize npa\n", __func__);
goto npa_err; goto npa_err;
}
rvu_get_lbk_bufsize(rvu); rvu_get_lbk_bufsize(rvu);
err = rvu_nix_init(rvu); err = rvu_nix_init(rvu);
if (err) if (err) {
dev_err(rvu->dev, "%s: Failed to initialize nix\n", __func__);
goto nix_err; goto nix_err;
}
rvu_program_channels(rvu); rvu_program_channels(rvu);
...@@ -2984,27 +3028,37 @@ static int rvu_probe(struct pci_dev *pdev, const struct pci_device_id *id) ...@@ -2984,27 +3028,37 @@ static int rvu_probe(struct pci_dev *pdev, const struct pci_device_id *id)
err = rvu_mbox_init(rvu, &rvu->afpf_wq_info, TYPE_AFPF, err = rvu_mbox_init(rvu, &rvu->afpf_wq_info, TYPE_AFPF,
rvu->hw->total_pfs, rvu_afpf_mbox_handler, rvu->hw->total_pfs, rvu_afpf_mbox_handler,
rvu_afpf_mbox_up_handler); rvu_afpf_mbox_up_handler);
if (err) if (err) {
dev_err(dev, "%s: Failed to initialize mbox\n", __func__);
goto err_hwsetup; goto err_hwsetup;
}
err = rvu_flr_init(rvu); err = rvu_flr_init(rvu);
if (err) if (err) {
dev_err(dev, "%s: Failed to initialize flr\n", __func__);
goto err_mbox; goto err_mbox;
}
err = rvu_register_interrupts(rvu); err = rvu_register_interrupts(rvu);
if (err) if (err) {
dev_err(dev, "%s: Failed to register interrupts\n", __func__);
goto err_flr; goto err_flr;
}
err = rvu_register_dl(rvu); err = rvu_register_dl(rvu);
if (err) if (err) {
dev_err(dev, "%s: Failed to register devlink\n", __func__);
goto err_irq; goto err_irq;
}
rvu_setup_rvum_blk_revid(rvu); rvu_setup_rvum_blk_revid(rvu);
/* Enable AF's VFs (if any) */ /* Enable AF's VFs (if any) */
err = rvu_enable_sriov(rvu); err = rvu_enable_sriov(rvu);
if (err) if (err) {
dev_err(dev, "%s: Failed to enable sriov\n", __func__);
goto err_dl; goto err_dl;
}
/* Initialize debugfs */ /* Initialize debugfs */
rvu_dbg_init(rvu); rvu_dbg_init(rvu);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment