From nobody Thu Sep 17 06:11:31 2026 X-Original-To: dev-commits-src-main@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 4hllkq4FsBz6sVQF for ; Thu, 17 Sep 2026 06:11:31 +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 4hllkq3Y0mz4Y6J for ; Thu, 17 Sep 2026 06:11:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1789625491; 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=Mas1oD+OuIpHba2yE/drtJ1cpDtnRJ2aFDvuuuqyV5wGkuf+jD4ochhvYrPhGsdjMonfKj f2rxAHhdiu/bM7Q11/o3zU384HMsL7PvQ8e2JcxoUMQfPJEUcp6XkM1+plkjm5hyZCDlAV q6wvor0RCn2u6T//GRdlg13oOsjuriJsDxiCwXSAk3uRkkNAaPizMBZ+WsGYLrZo7IWd9t 2TLo5ciqsDbu7xfXh/f3WXEsmSkK0lCyELS4MTiaEoDOndf1BLO6NUJOCi0AwQj2/Dcdb2 uVBn4xtwYIdlbqbAASyWr1iVwJzH+rh1PfA9uBcKjtFrZ7wFmZPW7kPFlkg8EA== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1789625491; b=WZDa0gFho7TR9kDuIlPcS0+lel1Ge4PWaEuHX65DEbZSarcI+gmDm8M4qX9i4EGgic4lOw RvFGTYjxpbs/6Y6OrOuDkeK1hEyPDsZQBZS7qSQBaPE2LIq7kSWIV6znfrKFxHrmv8QpC3 wTTGrSTzl3vA93aF4G7gaKF2hzvAnAJ3KRq2lNiJ7Fgr5LwI0SxmZrt5DJ9PR8gfnYYJFz Mgem2BbhIF60m8yevBrAMXSpSLQfK+V6gHaxR7Y2rW+QzwMeamxou2L2zIyhuo4IGhfbLR 1ESs/XRknjTidpCU7NRwa+v8GRQfLH0YAj47zZoZeONrKClgoDeRAmMHnpCbeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1789625491; 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=XruolVMM8w9e5ZoFYlcUX5Qe1fNpMHAZiBwID7x//P7+JhGw5lv3s+Atlcas7UA1iwPOyk Td66J4J6WuAeM6KWS8AVwDYB9aioWS8CUVOn/P/qOuPGcyZMhUx+ZWEOiUsuilmnwZgeOd m5nKRji5xXDsKp0arcFFXTv8BjPJUckf/tt3mbUjaJyoloNrTVZFjLODcimiBqx4IAxkEE MB53/pYe/lcWmotOP2nGHgb0I1JnBLFYUPjq2HDVF4NCI15JNrCNM53CBi7DrP+ejHxbvN KXeIOLWJTB2PCOvv6QsGOWZWk4dFKJTJc0vj2/hgWNZcwOXbXCGHA3s/9ycs2Q== 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 4hllkq2bzGzKd8 for ; Thu, 17 Sep 2026 06:11:31 +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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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