From nobody Thu Sep 17 06:11:31 2026 X-Original-To: dev-commits-src-all@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 4hllkw72Dfz6sVLV for ; Thu, 17 Sep 2026 06:11:36 +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 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "YR2" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4hllkw5lS1z4XtW for ; Thu, 17 Sep 2026 06:11:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1789625496; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=X0JUhDDahDmm9666q9fREkRvxbTcubvNpoMOGOrIC4w=; b=E2PRB+Jm+CRb/RVME8Q5evO9ylcGyIv2A1SHuVXgGJJ0iGX3RsvHAlrbuVRU0mbdhCvEUQ yaYyPDQIzfQU6OJ8AIKXV8PsXPUS5Dbe1u2gnMOvQI8DpGYkzDweGoebDPRUUCBSjzCBol XRjnPdRMdtyovSo2zPphuN1Ita/TutnblXpYmr1PPXgVzuPV9mMo+kJ7etOvdZ2l95lf0v vp4iMEr56X+aiBVTiFLJ7u0np16/k1/tH1R68+eO5poFk2HzOj+XdRJTTnde5TZYvILUPL /F8uivifAmRhfMpi81HHVYajlXuvGlxcRs63gqHawCJDmgVtlTlaN7j9MERgkw== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1789625496; b=VdKn/4VoqvvTTdC/S+4gLOaQ3oZPpTayBUaWK3UdaOgKMT0w2TrYnZVnuiNNYFXv2sw8/+ MyxKKmFNIGM4DkWLU/5Oz+wlBD8mg5xhfMylPuLIRVvaZ1u/LE4jCT9jlgK3SCfv/Pucvh OswZ6EG/Nm5x+JZlqLGR+UXmoUa/ooG+XwrgdV/UUxbmYdOhKoxTAde0+HzQx12d9J5KqH jVKDGs58vpIIIvfmQVnlk6C1yNCnjLixXs8saJ9vBhPNsL+4//bhGq5fGUQSjYwGSlq/9P 6oDTDX7a6FUTI79SUqORbjnYD4PIW7hHbddwWUaA6y6427cIWOFrci5hNl3iIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1789625496; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=X0JUhDDahDmm9666q9fREkRvxbTcubvNpoMOGOrIC4w=; b=y3anU3/crqIAiLOdpHoXfLCBHNRNJZfJNEya4SgEwETvp5bq1Ht381zmRUSrZLucCyLn80 AKDMPfBffA81+R+hMYCNuEVrWELuwn6HzG4rfHYHltyZF8nbFF4uirQK0LZOdQqih7x4Bi p57TNjdjFCGdrEldb07kaP2f4/w+kcTMr9WUCSfEk36zhmFSZ9gcdnvNl2I0avsxAG5QFz PAHiv1Ry8aILh1tfRe45qouwWbuy/EcushO1ZWV0VUvdpvlmuXNSRQsGkRwUnqgHZKdd31 zfVsZVHy1/p6jjjASY695UpWOhe4KQ3x4bDzbDMEiHcFjw/GtWCqRttIXdlLxQ== 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 4hllkw4pTGzKKS for ; Thu, 17 Sep 2026 06:11:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 264a5 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 17 Sep 2026 06:11:31 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: b263545980f4 - main - axgbe: Propagate hardware and PHY initialization failures List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org List-Id: 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/main X-Git-Reftype: branch X-Git-Commit: b263545980f44c0318afcc26188046ad7e559ceb Auto-Submitted: auto-generated Date: Thu, 17 Sep 2026 06:11:31 +0000 Message-Id: <6aab8493.264a5.221700e0@gitrepo.freebsd.org> The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=b263545980f44c0318afcc26188046ad7e559ceb commit b263545980f44c0318afcc26188046ad7e559ceb Author: Kevin Bowling AuthorDate: 2026-09-07 11:00:55 +0000 Commit: Kevin Bowling CommitDate: 2026-09-17 06:09:30 +0000 axgbe: Propagate hardware and PHY initialization failures Check hardware initialization instead of discarding its result, and preserve the original initialization error across cleanup. Report a failed init to iflib rather than publishing a running datapath. Return normalized FreeBSD errors from attach_post. Reuse the existing native reset cleanup on failure. MFC after: 2 weeks Sponsored by: BBOX.io --- sys/dev/axgbe/if_axgbe_pci.c | 40 ++++++++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/sys/dev/axgbe/if_axgbe_pci.c b/sys/dev/axgbe/if_axgbe_pci.c index 0153247495e3..7cf74b49e339 100644 --- a/sys/dev/axgbe/if_axgbe_pci.c +++ b/sys/dev/axgbe/if_axgbe_pci.c @@ -93,7 +93,7 @@ static int axgbe_if_msix_intr_assign(if_ctx_t, int); static void xgbe_free_intr(struct xgbe_prv_data *, struct resource *, void *, int); /* Init and Iflib routines */ -static void axgbe_pci_init(struct xgbe_prv_data *); +static int axgbe_pci_init(struct xgbe_prv_data *); static void axgbe_pci_stop(if_ctx_t); static void xgbe_disable_rx_tx_int(struct xgbe_prv_data *, struct xgbe_channel *); static void xgbe_disable_rx_tx_ints(struct xgbe_prv_data *); @@ -1500,9 +1500,8 @@ axgbe_if_attach_post(if_ctx_t ctx) scctx->isc_max_frame_size = if_getmtu(ifp) + 18; scctx->isc_min_frame_size = XGMAC_MIN_PACKET; - axgbe_pci_init(pdata); - - return (0); + ret = axgbe_pci_init(pdata); + return (ret < 0 ? -ret : ret); } /* axgbe_if_attach_post */ static void @@ -1595,27 +1594,28 @@ axgbe_if_detach(if_ctx_t ctx) return (0); } /* axgbe_if_detach */ -static void +static int axgbe_pci_init(struct xgbe_prv_data *pdata) { struct xgbe_phy_if *phy_if = &pdata->phy_if; struct xgbe_hw_if *hw_if = &pdata->hw_if; - int ret = 0; + int ret, reset_ret; if (!__predict_false((test_bit(XGBE_DOWN, &pdata->dev_state)))) { axgbe_printf(1, "%s: Starting when XGBE_UP\n", __func__); - return; + return (0); } - hw_if->init(pdata); + ret = hw_if->init(pdata); + if (ret != 0) { + axgbe_error("%s: hardware init error %d\n", __func__, ret); + goto fail; + } - ret = phy_if->phy_start(pdata); - if (ret) { - axgbe_error("%s: phy start %d\n", __func__, ret); - ret = hw_if->exit(pdata); - if (ret) - axgbe_error("%s: exit error %d\n", __func__, ret); - return; + ret = phy_if->phy_start(pdata); + if (ret != 0) { + axgbe_error("%s: phy start error %d\n", __func__, ret); + goto fail; } hw_if->enable_tx(pdata); @@ -1631,6 +1631,13 @@ axgbe_pci_init(struct xgbe_prv_data *pdata) xgbe_dump_mtl_registers(pdata); xgbe_dump_mac_registers(pdata); xgbe_dump_rmon_counters(pdata); + return (0); + +fail: + reset_ret = hw_if->exit(pdata); + if (reset_ret != 0) + axgbe_error("%s: cleanup reset error %d\n", __func__, reset_ret); + return (ret); } static void @@ -1639,7 +1646,8 @@ axgbe_if_init(if_ctx_t ctx) struct axgbe_if_softc *sc = iflib_get_softc(ctx); struct xgbe_prv_data *pdata = &sc->pdata; - axgbe_pci_init(pdata); + if (axgbe_pci_init(pdata) != 0) + iflib_init_failed(ctx); } static void