From nobody Fri Oct 06 17:06:01 2023 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 4S2FF533xgz4x6HQ; Fri, 6 Oct 2023 17:06:01 +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 4S2FF52QpSz4WG9; Fri, 6 Oct 2023 17:06:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1696611961; 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=tSnB0a1Vl1X9qLMF5WIFIWiPyVXkhmKXnutyV8tqwpA=; b=nd/C7UYUmVFAg6/VyHnoztr2YCcald+dWcC33N9RQqCSoYlQK1jbI34kE9AYBRbEdrocLv WJMIcSdjp3foPMAYYlDLEQTmiqKzdXOKX2pH7f8qa23KhzcJJby/vj1iaYE5wBCsLCeoPL 3hPla0nXwQ2u3ReolMEeepGnM5tA0V9EY856yAY+Gu0fFuoIyxnzZgcyC0tcbmlvu0yLYP uZby5xBrT7Ge6tmxxnGfuHjK2cpaT6IUQWhSFkbRvHdTV68cvenDxt/hmAuj3kDrF5nXwH sQIsrbNAZmQkC8pUvH+tpP2QpqjxvVR7KJR3VLtKNIrAkmn58tMZ7P9995r3SA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1696611961; a=rsa-sha256; cv=none; b=E9ADifn7uMv7tqeX4o9W4F8plQMkxxRPU2DfnQ/uGK7usObW5aVAn/6Vs6UvzUypht1Mjl 6wEagrEHubHDd/c1S//5FYmwaVMtKZtdXvt0sip78WzJKPGa9XZaF/16eFfARcv+p3r+nY W7/YQBwZ7f+Ws9OcrIXRISC+rtSe0q+8D4ClWPk3Ny90v65UB9NWnONRPdo6LRsOY3VBTp vOlRqnI5em3HiMO/SHb7SmxX+X4fs/5LHn/kKkv+KScqHz9Z1ezeaR0A2+CGOZ/eb73nol 1F+kMjS0s4aMNsBmU4WXVEiMuvHwn0pouDD5btU4YVpgvZfodVYEmK1G47SzIQ== 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=1696611961; 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=tSnB0a1Vl1X9qLMF5WIFIWiPyVXkhmKXnutyV8tqwpA=; b=xmRbHLMelVx4sUW49LU/zEhgP1H/rM/1hrTVyoGuTzS+QQ7Vjv9sGcgkC359ThIve9/iY9 S3wX5KjVHuzcaBUsp9pWLCQVKRvUq9yxbYkPzZa8Ybl/hvUYyuQopTVNMhvY+I6Fc1HvcL nBDT/DlIzkg0WEtPjs1zDD1qac/E9+fS3ix/Mb4xhBXZfEhFUmXGI3m43QJbmsqKoC85gl LHxwDp6nInYvlV0VQjU7ezzXkRD6UJxe8Inp0dJeNrznCPqqS8xswN0eyOPcW1RpCIK/jj W9JyMOnn74/ZxxpMzamldt7b69thoqSAeHGlR0WsxH5hLUyidmgZm+OwYJ068g== 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 4S2FF50wJjzwpJ; Fri, 6 Oct 2023 17:06:01 +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 396H61Q8060712; Fri, 6 Oct 2023 17:06:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 396H615W060709; Fri, 6 Oct 2023 17:06:01 GMT (envelope-from git) Date: Fri, 6 Oct 2023 17:06:01 GMT Message-Id: <202310061706.396H615W060709@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: 7854d0f6584d - main - dwc: Get the mii clock after calling IF_DWC_INIT 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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: 7854d0f6584d259fd7f13595e3d3a4f157db9339 Auto-Submitted: auto-generated The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=7854d0f6584d259fd7f13595e3d3a4f157db9339 commit 7854d0f6584d259fd7f13595e3d3a4f157db9339 Author: Emmanuel Vadot AuthorDate: 2023-10-06 15:43:09 +0000 Commit: Emmanuel Vadot CommitDate: 2023-10-06 17:05:40 +0000 dwc: Get the mii clock after calling IF_DWC_INIT We need to calculate it based on the clocks and they aren't started before IF_DWC_INIT. --- sys/dev/dwc/if_dwc.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/dev/dwc/if_dwc.c b/sys/dev/dwc/if_dwc.c index ffcf3e8d6afd..d212c2db131f 100644 --- a/sys/dev/dwc/if_dwc.c +++ b/sys/dev/dwc/if_dwc.c @@ -504,7 +504,6 @@ dwc_attach(device_t dev) sc->rx_idx = 0; sc->tx_desccount = TX_DESC_COUNT; sc->tx_mapcount = 0; - sc->mii_clk = IF_DWC_MII_CLK(dev); sc->node = ofw_bus_get_node(dev); sc->phy_mode = mii_fdt_get_contype(sc->node); @@ -552,6 +551,11 @@ dwc_attach(device_t dev) if (IF_DWC_INIT(dev) != 0) return (ENXIO); + if ((sc->mii_clk = IF_DWC_MII_CLK(dev)) < 0) { + device_printf(dev, "Cannot get mii clock value %d\n", -sc->mii_clk); + return (ENXIO); + } + if (bus_alloc_resources(dev, dwc_spec, sc->res)) { device_printf(dev, "could not allocate resources\n"); return (ENXIO);