Skip to content

Commit 0db1688

Browse files
committed
Merge branch 'bnge-fixes'
Vikas Gupta says: ==================== bnge fixes Patch-1: Due to wrong HWRM sequence, driver do not get the correct information regarding resources and capabilities. The patch fixes the initial HWRM sequence. Patch-2: Remove the unsupported backing store type initialization, which is not supported in Thor Ultra devices. ==================== Link: https://patch.msgid.link/20260418023438.1597876-1-vikas.gupta@broadcom.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 parents 645d044 + c6b34ad commit 0db1688

2 files changed

Lines changed: 22 additions & 24 deletions

File tree

drivers/net/ethernet/broadcom/bnge/bnge_core.c

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,13 @@ static int bnge_func_qcaps(struct bnge_dev *bd)
7474
return rc;
7575
}
7676

77+
return 0;
78+
}
79+
80+
static int bnge_func_qrcaps_qcfg(struct bnge_dev *bd)
81+
{
82+
int rc;
83+
7784
rc = bnge_hwrm_func_resc_qcaps(bd);
7885
if (rc) {
7986
dev_err(bd->dev, "query resc caps failure rc: %d\n", rc);
@@ -133,23 +140,28 @@ static int bnge_fw_register_dev(struct bnge_dev *bd)
133140

134141
bnge_hwrm_fw_set_time(bd);
135142

136-
rc = bnge_hwrm_func_drv_rgtr(bd);
143+
/* Get the resources and configuration from firmware */
144+
rc = bnge_func_qcaps(bd);
137145
if (rc) {
138-
dev_err(bd->dev, "Failed to rgtr with firmware rc: %d\n", rc);
146+
dev_err(bd->dev, "Failed querying caps rc: %d\n", rc);
139147
return rc;
140148
}
141149

142150
rc = bnge_alloc_ctx_mem(bd);
143151
if (rc) {
144152
dev_err(bd->dev, "Failed to allocate ctx mem rc: %d\n", rc);
145-
goto err_func_unrgtr;
153+
goto err_free_ctx_mem;
146154
}
147155

148-
/* Get the resources and configuration from firmware */
149-
rc = bnge_func_qcaps(bd);
156+
rc = bnge_hwrm_func_drv_rgtr(bd);
150157
if (rc) {
151-
dev_err(bd->dev, "Failed initial configuration rc: %d\n", rc);
152-
rc = -ENODEV;
158+
dev_err(bd->dev, "Failed to rgtr with firmware rc: %d\n", rc);
159+
goto err_free_ctx_mem;
160+
}
161+
162+
rc = bnge_func_qrcaps_qcfg(bd);
163+
if (rc) {
164+
dev_err(bd->dev, "Failed querying resources rc: %d\n", rc);
153165
goto err_func_unrgtr;
154166
}
155167

@@ -158,7 +170,9 @@ static int bnge_fw_register_dev(struct bnge_dev *bd)
158170
return 0;
159171

160172
err_func_unrgtr:
161-
bnge_fw_unregister_dev(bd);
173+
bnge_hwrm_func_drv_unrgtr(bd);
174+
err_free_ctx_mem:
175+
bnge_free_ctx_mem(bd);
162176
return rc;
163177
}
164178

drivers/net/ethernet/broadcom/bnge/bnge_rmem.c

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,6 @@ int bnge_alloc_ctx_mem(struct bnge_dev *bd)
324324
u32 l2_qps, qp1_qps, max_qps;
325325
u32 ena, entries_sp, entries;
326326
u32 srqs, max_srqs, min;
327-
u32 num_mr, num_ah;
328327
u32 extra_srqs = 0;
329328
u32 extra_qps = 0;
330329
u32 fast_qpmd_qps;
@@ -390,21 +389,6 @@ int bnge_alloc_ctx_mem(struct bnge_dev *bd)
390389
if (!bnge_is_roce_en(bd))
391390
goto skip_rdma;
392391

393-
ctxm = &ctx->ctx_arr[BNGE_CTX_MRAV];
394-
/* 128K extra is needed to accommodate static AH context
395-
* allocation by f/w.
396-
*/
397-
num_mr = min_t(u32, ctxm->max_entries / 2, 1024 * 256);
398-
num_ah = min_t(u32, num_mr, 1024 * 128);
399-
ctxm->split_entry_cnt = BNGE_CTX_MRAV_AV_SPLIT_ENTRY + 1;
400-
if (!ctxm->mrav_av_entries || ctxm->mrav_av_entries > num_ah)
401-
ctxm->mrav_av_entries = num_ah;
402-
403-
rc = bnge_setup_ctxm_pg_tbls(bd, ctxm, num_mr + num_ah, 2);
404-
if (rc)
405-
return rc;
406-
ena |= FUNC_BACKING_STORE_CFG_REQ_ENABLES_MRAV;
407-
408392
ctxm = &ctx->ctx_arr[BNGE_CTX_TIM];
409393
rc = bnge_setup_ctxm_pg_tbls(bd, ctxm, l2_qps + qp1_qps + extra_qps, 1);
410394
if (rc)

0 commit comments

Comments
 (0)