From nobody Mon Dec 11 10:41:14 2023 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 4SpdZg0nSzz53Q4S; Mon, 11 Dec 2023 10:41:15 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SpdZg0J1Sz3BvJ; Mon, 11 Dec 2023 10:41:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702291275; 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=dUFm2mgth91f0et1zqB6K+Wvj3/eKxw4y19BwxYKbiw=; b=TJBbC8idTC1hFxI/0wEo72dqFh4QiZC3gZfOX8F9t9UdNTlpTR7HqL3O7az95yI9D1J9ul 0DBmUoozbcfSetFd6db48wq/t+d7rlGhjfdqy9ByqImAbO6krP1WjMaekBMzfXVA/JN4+o Z/j8W5pbc/qLOeaPZA2jdZ3uFOdb6mkd3ox54ZwO5TQvsnheoVohmKV9W00DNUvb4izRIB t0wrIGWgZwSXoylI83alujclvqTz5j6U5Io3W7yRLUW0l3Y5dulejanv/GSWP+0pi+N500 4kVp8/+HEcoTDXBYwVrUzQo09fdZBp9dSW8rxXE4iHAkoqsteCDR5sJRpK4jNA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702291275; a=rsa-sha256; cv=none; b=mi9auiuTKS1QXsWrCg0MsD6nxHJokJQhTlc/BZ90iGB966OZ+80zZiBzmIcLxHNz1B4zqx qVoNRZ6ybSSEnQNVvJp2MQKhnE9H64dzOPzqN5TtbamshJ1mdrfiXG7LmZcP+428o3C0ee lBYFAi1o5n066iYRUg3BYowUTQtX6JFbPSyifV2OyCDJbNpEerfQQ4ZM+7+7mYPQriRRQr Z27Ih4Ksy6LPOMZemZUU+ntP9M+PsLEnbWBzJBuBGbAb25MCXL6ApFRsP93sySnks/Vy78 eZ8vMxY/udG7Vk40g6gSYQowh8RfZ+VY7XCbV5kQVuReAcI7iM+BHFmYIx9DUA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702291275; 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=dUFm2mgth91f0et1zqB6K+Wvj3/eKxw4y19BwxYKbiw=; b=pfsfjz7OVhZWF7wUhLxbQ2Wt1xX8MxjT7kadOyAdMD5fbJPYGRAct4fCuSU3vKc3/l4PJ+ MuSc4F5Tky7I2rasETQZz8fQvvSqrT5ShvjSWw3i04PBow6sOR28JjFj/IpWduGKlTuGJt rVTxPxAQMttgnqa7+0q3b5ZxkkSPjoT0c6vW8/qlUI2s22bO6bXOuqtb4tq46+SQ5RPfRZ uxTm7rEKQJmjLfGKmXwqOuQdgyFeKs7RoAVetCEck1AWqjTufyEKvN7UU751Xmx0I6HwJI Izms4pJ1b1xiJSOrn1y7Rn4wFyPaD4TuNPDdQTJJCOV0x1e3UvugHAo31kOpkA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SpdZf6WWvzD9Q; Mon, 11 Dec 2023 10:41:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BBAfEx0013625; Mon, 11 Dec 2023 10:41:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BBAfE0o013611; Mon, 11 Dec 2023 10:41:14 GMT (envelope-from git) Date: Mon, 11 Dec 2023 10:41:14 GMT Message-Id: <202312111041.3BBAfE0o013611@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: bd0771390ef5 - main - eqos: Call init earlier 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: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bd0771390ef532ce0ae3f39350acd540125e5620 Auto-Submitted: auto-generated The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=bd0771390ef532ce0ae3f39350acd540125e5620 commit bd0771390ef532ce0ae3f39350acd540125e5620 Author: Emmanuel Vadot AuthorDate: 2023-12-11 10:29:51 +0000 Commit: Emmanuel Vadot CommitDate: 2023-12-11 10:31:28 +0000 eqos: Call init earlier Call the subclassed IF_EQOS_INIT before trying to read the mac, clocks and reset needs to dealt with before we can read the registers. --- sys/dev/eqos/if_eqos.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sys/dev/eqos/if_eqos.c b/sys/dev/eqos/if_eqos.c index 0dc476acd520..75e3ca957b48 100644 --- a/sys/dev/eqos/if_eqos.c +++ b/sys/dev/eqos/if_eqos.c @@ -1119,6 +1119,9 @@ eqos_attach(device_t dev) return (ENXIO); } + if ((error = IF_EQOS_INIT(dev))) + return (error); + sc->dev = dev; ver = RD4(sc, GMAC_MAC_VERSION); userver = (ver & GMAC_MAC_VERSION_USERVER_MASK) >> @@ -1142,10 +1145,6 @@ eqos_attach(device_t dev) sc->hw_feature[2], sc->hw_feature[3]); } - - if ((error = IF_EQOS_INIT(dev))) - return (error); - mtx_init(&sc->lock, "eqos lock", MTX_NETWORK_LOCK, MTX_DEF); callout_init_mtx(&sc->callout, &sc->lock, 0);