From nobody Thu Oct 29 23:37:08 2026 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4jG0xx0VYfz6xr22 for ; Thu, 29 Oct 2026 23:37:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4jG0xw4Lphz4sbs for ; Thu, 29 Oct 2026 23:37:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1793317028; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mEcpF2H4vtF35MVzLFgZbrNsRmK9lhVbOBOjH+bpEm4=; b=IMa2+qSavDR9YYTKTxcWUoysgHkOeOm+wPNno5QteFEriU35g3S2mHx1ulxv5GDM3KmJu7 tcCF/8l06DXPAyrKQ6dyEg71dwmSWUxs2A0Gb7v1+YkdpBSbPu7E71pwHpRKYlvoUUUy+s CJhib/ZjiNxB/B76Zu+xrl+Ktv39LziJdK7ZeF/MIQHmwamcihikSzNY3GUPsz8FrEfuYo jwpriDqajAF7NjFuJJAI/wPAUiUaNRhL0IWqrtxhMnpYsSf17wSRHfPAAi/dBhSPa7LceF BPeia3IA814EuaVmFabRdQL8LE2+Uq3YTsyJi8hh0pBVg7LE5SvxObIzM7WOhw== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1793317028; b=vyP7Jy03mL2sb5DpvhWP+1Yxq5ipcEV+0NNyc67IDcuxhOdxgcGD5eQ6RhCbpKlv2//uNr JJunN2S51RKKSw+fJT5ig/+def/hk5XLj5d/3/fFHOSdom4sI792ELICP3wqDw6WS8zD5k BF8qsquHPkJzbi92xrv6U2QI2YfpY0vgCKGUtdHqamg5LYEonrMoEnKsmGgiurNTULUq1S KGRq4f9Gz7OExy2HiUWy8aSwLuPh+UmA9PmopwaON+oPIIItg8LXD0xm92s+OmZZ2YFy+6 OMGezoaavogDEdE2YOgo9X7QvC2oJ4KqsERPC3lUroW2HlZcg4e7wIwN23tGeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1793317028; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mEcpF2H4vtF35MVzLFgZbrNsRmK9lhVbOBOjH+bpEm4=; b=Aw4mPdhXvGvnZ3EBxxyn9rufo1sFr7i5A+9Vha4U61cv8GXaU0uvQe6ZsncRaQHnJ2wGLC RHgCl5AvIxJDYZ23u1+Qcv+zTwGxrrpLeEmvbTrwpqzAsooYd1oeIDipRjOQM6qPswpp9J 0CYYynN1gZhRYNXs6dK1Imi6diI+sNf9P86XIwlLJlxYb0ROR0h+aGcV2fQ5f3TeluSLIS u5iq+/3YU8WNt8BwTzNtXf9agaqubNBJUZ6I/GyK8hIrdBR/Pdc4qUIxd6w2mrl/8Its96 lwLuUezL2Xwr5th9ypf8MVGFfUrXSU147VzGWICvvS0iPpRIKzH9HAmLaPhEBw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4jG0xw317Rz12HR for ; Thu, 29 Oct 2026 23:37:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 39b6e by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 29 Oct 2026 23:37:08 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Sumit Saxena From: Kevin Bowling Subject: git: b9a751a0a0b2 - stable/15 - if_bnxt: honor firmware min wait before VER_GET on reset List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org List-Id: Commits to the stable branches of the FreeBSD src repository List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: b9a751a0a0b28d0c2cfb002c15f9e25b67ac7824 Auto-Submitted: auto-generated Date: Thu, 29 Oct 2026 23:37:08 +0000 Message-Id: <6ae3d8a4.39b6e.256734a6@gitrepo.freebsd.org> The branch stable/15 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=b9a751a0a0b28d0c2cfb002c15f9e25b67ac7824 commit b9a751a0a0b28d0c2cfb002c15f9e25b67ac7824 Author: Sumit Saxena AuthorDate: 2026-07-31 15:46:25 +0000 Commit: Kevin Bowling CommitDate: 2026-10-29 23:15:18 +0000 if_bnxt: honor firmware min wait before VER_GET on reset The firmware advertises a minimum wait time it needs before it is ready. The driver was not honoring it and sent VER_GET too early during firmware error-recovery, which could return an incomplete VER_GET buffer. Enforce that minimum wait, measured from when the RESET_NOTIFY async event arrived, before sending VER_GET. Reviewed by: gallatin Sponsored by: Broadcom Inc. Differential Revision: https://reviews.freebsd.org/D58608 (cherry picked from commit e009e1fd80839a4a570a73dae9011a04ed4579ca) --- sys/dev/bnxt/bnxt_en/bnxt.h | 2 ++ sys/dev/bnxt/bnxt_en/if_bnxt.c | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/sys/dev/bnxt/bnxt_en/bnxt.h b/sys/dev/bnxt/bnxt_en/bnxt.h index 595df977f93c..5736422e1253 100644 --- a/sys/dev/bnxt/bnxt_en/bnxt.h +++ b/sys/dev/bnxt/bnxt_en/bnxt.h @@ -1407,6 +1407,8 @@ struct bnxt_softc { u16 fw_reset_max_dsecs; #define BNXT_DFLT_FW_RST_MAX_DSECS 60 unsigned long fw_reset_timestamp; + unsigned long fw_reset_notify_timestamp; + u16 fw_reset_req_min_dsecs; struct bnxt_fw_health *fw_health; char board_partno[64]; diff --git a/sys/dev/bnxt/bnxt_en/if_bnxt.c b/sys/dev/bnxt/bnxt_en/if_bnxt.c index 0e10bfbc51f4..21befd82938d 100644 --- a/sys/dev/bnxt/bnxt_en/if_bnxt.c +++ b/sys/dev/bnxt/bnxt_en/if_bnxt.c @@ -1910,6 +1910,21 @@ static u32 bnxt_fw_health_readl(struct bnxt_softc *bp, int reg_idx) return val; } +/* + * Sleep until at least min_ms milliseconds have passed since start_jiffies. + */ +static void bnxt_sleep_until_min_elapsed(unsigned long start_jiffies, + unsigned int min_ms) +{ + unsigned long elapsed_time; + unsigned int elapsed_time_ms; + + elapsed_time = jiffies - start_jiffies; + elapsed_time_ms = (unsigned int)(elapsed_time * 1000 / HZ); + if (elapsed_time_ms < min_ms) + msleep(min_ms - elapsed_time_ms); +} + static void bnxt_fw_reset_close(struct bnxt_softc *bp) { int i; @@ -2391,6 +2406,8 @@ static void bnxt_fw_reset_task(struct work_struct *work) fallthrough; case BNXT_FW_RESET_STATE_POLL_FW: bp->hwrm_cmd_timeo = SHORT_HWRM_CMD_TIMEOUT; + bnxt_sleep_until_min_elapsed(bp->fw_reset_notify_timestamp, + bp->fw_reset_req_min_dsecs * 100); rc = bnxt_hwrm_poll(bp); if (rc) { if (bnxt_fw_reset_timeout(bp)) { @@ -5423,9 +5440,11 @@ bnxt_handle_async_event(struct bnxt_softc *softc, struct cmpl_base *cmpl) goto async_event_process_exit; softc->fw_reset_timestamp = jiffies; + softc->fw_reset_notify_timestamp = jiffies; softc->fw_reset_min_dsecs = ae->timestamp_lo; if (!softc->fw_reset_min_dsecs) softc->fw_reset_min_dsecs = BNXT_DFLT_FW_RST_MIN_DSECS; + softc->fw_reset_req_min_dsecs = softc->fw_reset_min_dsecs; softc->fw_reset_max_dsecs = le16toh(ae->timestamp_hi); if (!softc->fw_reset_max_dsecs) softc->fw_reset_max_dsecs = BNXT_DFLT_FW_RST_MAX_DSECS;