Skip to content

Commit 561a22d

Browse files
committed
Merge branch 'bnxt_en-bug-fixes'
Pavan Chebbi says: ==================== bnxt_en: Bug fixes This patchset adds the following fixes for bnxt: Patch #1 fixes DPC AER handling to make it more reliable Patch svenkatr#2 fixes incorrect capping bp->max_tpa based on what the FW supports Patch svenkatr#3 fixes ignoring of VNIC configuration result when RDMA driver is loading Patch svenkatr#4 fixes logic to make phase adjustment on the PPS OUT signal ==================== Link: https://patch.msgid.link/20260504083611.1383776-1-pavan.chebbi@broadcom.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 parents 5ad509c + bd279e1 commit 561a22d

3 files changed

Lines changed: 25 additions & 30 deletions

File tree

drivers/net/ethernet/broadcom/bnxt/bnxt.c

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3825,7 +3825,10 @@ static int bnxt_alloc_tpa_info(struct bnxt *bp)
38253825
if (bp->flags & BNXT_FLAG_CHIP_P5_PLUS) {
38263826
if (!bp->max_tpa_v2)
38273827
return 0;
3828-
bp->max_tpa = max_t(u16, bp->max_tpa_v2, MAX_TPA_P5);
3828+
bp->max_tpa = min_t(u16, bp->max_tpa_v2, MAX_TPA_P5);
3829+
/* Older P5 FW sets max_tpa_v2 low by mistake except NPAR */
3830+
if (bp->max_tpa <= 32 && BNXT_CHIP_P5(bp) && !BNXT_NPAR(bp))
3831+
bp->max_tpa = MAX_TPA_P5;
38293832
}
38303833

38313834
for (i = 0; i < bp->rx_nr_rings; i++) {
@@ -17360,9 +17363,14 @@ static pci_ers_result_t bnxt_io_slot_reset(struct pci_dev *pdev)
1736017363

1736117364
netdev_info(bp->dev, "PCI Slot Reset\n");
1736217365

17363-
if (!(bp->flags & BNXT_FLAG_CHIP_P5_PLUS) &&
17364-
test_bit(BNXT_STATE_PCI_CHANNEL_IO_FROZEN, &bp->state))
17365-
msleep(900);
17366+
if (test_bit(BNXT_STATE_PCI_CHANNEL_IO_FROZEN, &bp->state)) {
17367+
/* After DPC, the chip should return CRS when the vendor ID
17368+
* config register is read until it is ready. On all chips,
17369+
* this is not happening reliably so add a 5-second delay as a
17370+
* workaround.
17371+
*/
17372+
msleep(5000);
17373+
}
1736617374

1736717375
netdev_lock(netdev);
1736817376

drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c

Lines changed: 5 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -419,42 +419,20 @@ void bnxt_ptp_reapply_pps(struct bnxt *bp)
419419
}
420420
}
421421

422-
static int bnxt_get_target_cycles(struct bnxt_ptp_cfg *ptp, u64 target_ns,
423-
u64 *cycles_delta)
424-
{
425-
u64 cycles_now;
426-
u64 nsec_now, nsec_delta;
427-
int rc;
428-
429-
rc = bnxt_refclk_read(ptp->bp, NULL, &cycles_now);
430-
if (rc)
431-
return rc;
432-
433-
nsec_now = bnxt_timecounter_cyc2time(ptp, cycles_now);
434-
435-
nsec_delta = target_ns - nsec_now;
436-
*cycles_delta = div64_u64(nsec_delta << ptp->cc.shift, ptp->cc.mult);
437-
return 0;
438-
}
439-
440422
static int bnxt_ptp_perout_cfg(struct bnxt_ptp_cfg *ptp,
441423
struct ptp_clock_request *rq)
442424
{
443425
struct hwrm_func_ptp_cfg_input *req;
444426
struct bnxt *bp = ptp->bp;
445427
struct timespec64 ts;
446-
u64 target_ns, delta;
428+
u64 target_ns;
447429
u16 enables;
448430
int rc;
449431

450432
ts.tv_sec = rq->perout.start.sec;
451433
ts.tv_nsec = rq->perout.start.nsec;
452434
target_ns = timespec64_to_ns(&ts);
453435

454-
rc = bnxt_get_target_cycles(ptp, target_ns, &delta);
455-
if (rc)
456-
return rc;
457-
458436
rc = hwrm_req_init(bp, req, HWRM_FUNC_PTP_CFG);
459437
if (rc)
460438
return rc;
@@ -468,7 +446,10 @@ static int bnxt_ptp_perout_cfg(struct bnxt_ptp_cfg *ptp,
468446
req->ptp_freq_adj_dll_phase = 0;
469447
req->ptp_freq_adj_ext_period = cpu_to_le32(NSEC_PER_SEC);
470448
req->ptp_freq_adj_ext_up = 0;
471-
req->ptp_freq_adj_ext_phase_lower = cpu_to_le32(delta);
449+
req->ptp_freq_adj_ext_phase_lower =
450+
cpu_to_le32(lower_32_bits(target_ns));
451+
req->ptp_freq_adj_ext_phase_upper =
452+
cpu_to_le32(upper_32_bits(target_ns));
472453

473454
return hwrm_req_send(bp, req);
474455
}

drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,14 @@ int bnxt_register_dev(struct bnxt_en_dev *edev,
175175
ulp->handle = handle;
176176
rcu_assign_pointer(ulp->ulp_ops, ulp_ops);
177177

178-
if (test_bit(BNXT_STATE_OPEN, &bp->state))
179-
bnxt_hwrm_vnic_cfg(bp, &bp->vnic_info[BNXT_VNIC_DEFAULT]);
178+
if (test_bit(BNXT_STATE_OPEN, &bp->state)) {
179+
rc = bnxt_hwrm_vnic_cfg(bp, &bp->vnic_info[BNXT_VNIC_DEFAULT]);
180+
if (rc) {
181+
netdev_err(dev, "Failed to configure dual VNIC mode\n");
182+
RCU_INIT_POINTER(ulp->ulp_ops, NULL);
183+
goto exit;
184+
}
185+
}
180186

181187
edev->ulp_tbl->msix_requested = bnxt_get_ulp_msix_num(bp);
182188

0 commit comments

Comments
 (0)