From nobody Sat Nov 14 06:53:03 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 4jRPvz1kMsz70sC2 for ; Sat, 14 Nov 2026 06:53:03 +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 4jRPvz17NXz4FnT for ; Sat, 14 Nov 2026 06:53:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1794639183; 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=X7mgnQD7jtMtURaOc4BdOFmeNx89gIUhATuUywVycB8=; b=Q5OjpusCBIAMD3WbY4wGI5+nenv/s0iUwTZsjkDXwmPaq6ApL4upz1TZUDSyQKWnsot5rL K18MF0yqxo87HDGXu3J1ivI4jMUU6r9Xj0gOCFyL6O//wHWhAE/FYJixb8S1c+RLd2SvZW CSI8uRMSNCgW1iLXJFMkgynHqGwvbVjKSHnke4oFDn7vFTjoZvcTvgeCdCNzVkixBhgHS2 MQC5GuVsUmsEGrXT3Y4WI0vdXG+gZh8hYvzcCpUA+4mUxalwIM9eyXzM9u1ceNRhXyxXqb xEsJAZ5TBOqMLHu8EnVKGxXAE0NHyP22mQDLzOS+PoSLGpPZUrsptlzFElgArw== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1794639183; b=LAzukFwt+z7Q4i/YoxYSQPPiTG0xZHYxN2UfhJxpXiiAWUB+aYoVZeMS17NSRwjlkiGeZy h59ZOBdWOzLeZW4MQ49fejokgoC9A79hMKkBMEfhIEjvHsM7bzAbyV0rXJ+U+9jPcRw0dx y3k1gAI9b/SniBQutbbEDv2hIqewswNt2jDJEUFoKYhqSnjvC86VBZnrzc3fvxuT7rOQmM MhRslSZvYU3Mgk4dJLn7GlVVFyH8efjQ49B4AKQCjc5RVckasorNdiMcUJQXrMQQxrQUey lVByvn1x52I0qDE5PlGiAQIgKchXNgOxtpxMkWieOy8UvkAUpQ45pvsmNYKtUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1794639183; 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=X7mgnQD7jtMtURaOc4BdOFmeNx89gIUhATuUywVycB8=; b=YHNvUYujPS/FArdbeSHaVB2pzSKKF6bV5M/Rpj0HiDsS6vG84IrG7nJ6bjSEmdt/ogqV+Q tylg+4GO0caO8MMiwEwV9a8KMmJQjKWaJtLWzRbISw/Db/kP2/s9NToQVYIcmsIAvlDZGJ BvkTFbDW3Ie5f3V2shoQV4zEPf7q5ZU41awXc1L314pvhpcA0jv2lNn3Fbce03UPouQJuB REYqJ3d3dNCWf4BlCfbxnmTt4yxnZh1z8Gz0VIUfRUKABxH8lQiApWuFBl7BIOBtlKKbv9 jI9mdWI5JcUz4xKPKOXNiWXCPoSDWjXAlIvfPdMhL4QFXWcGj4tbmD4ZfFoKgA== 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 4jRPvz0fLvz19Cb for ; Sat, 14 Nov 2026 06:53:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 4316 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 14 Nov 2026 06:53:03 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: 512342998935 - main - awg: Stop the controller and power down the PHY on shutdown List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all X-BeenThere: dev-commits-src-all@freebsd.org List-Id: Commit messages for all branches of the 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: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 512342998935242b65352654191e6f6f3ca7c78f Auto-Submitted: auto-generated Date: Sat, 14 Nov 2026 06:53:03 +0000 Message-Id: <6af8054f.4316.679a97d@gitrepo.freebsd.org> The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=512342998935242b65352654191e6f6f3ca7c78f commit 512342998935242b65352654191e6f6f3ca7c78f Author: Emmanuel Vadot AuthorDate: 2026-11-13 19:43:16 +0000 Commit: Emmanuel Vadot CommitDate: 2026-11-14 06:52:44 +0000 awg: Stop the controller and power down the PHY on shutdown On the Pine H64 model B the PHY is supplied by a regulator of the AXP805, which keeps its state over a reset of the SoC. After a reboot the PHY is still powered and U-Boot finds it, while after a power cycle it does not. When U-Boot finds the PHY the kernel hangs or panics at a random place very early, before any driver is attached, most of the time. When it does not, the boot is fine. The reason is not known, the Ethernet controller of the SoC being left running by U-Boot is one possibility. Stop the controller and disable the PHY supply when shutting down, so that the next boot starts like after a power cycle. This is a workaround, the problem should be fixed in U-Boot. Tested on: H6 --- sys/arm/allwinner/if_awg.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/sys/arm/allwinner/if_awg.c b/sys/arm/allwinner/if_awg.c index 24956c124580..3277ef070f11 100644 --- a/sys/arm/allwinner/if_awg.c +++ b/sys/arm/allwinner/if_awg.c @@ -205,6 +205,7 @@ struct awg_softc { int if_flags; enum awg_type type; struct syscon *syscon; + regulator_t phy_supply; struct awg_txring tx; struct awg_rxring rx; @@ -1710,6 +1711,7 @@ awg_setup_extres(device_t dev) device_printf(dev, "cannot enable PHY regulator\n"); goto fail; } + sc->phy_supply = reg; } /* Determine MDC clock divide ratio based on AHB clock */ @@ -2003,10 +2005,32 @@ awg_attach(device_t dev) return (0); } +static int +awg_shutdown(device_t dev) +{ + struct awg_softc *sc; + + sc = device_get_softc(dev); + + AWG_LOCK(sc); + if ((if_getdrvflags(sc->ifp) & IFF_DRV_RUNNING) != 0) + awg_stop(sc); + AWG_UNLOCK(sc); + + /* + * Power down the PHY so that the next stage does not find it ready. + */ + if (sc->phy_supply != NULL) + regulator_disable(sc->phy_supply); + + return (0); +} + static device_method_t awg_methods[] = { /* Device interface */ DEVMETHOD(device_probe, awg_probe), DEVMETHOD(device_attach, awg_attach), + DEVMETHOD(device_shutdown, awg_shutdown), /* MII interface */ DEVMETHOD(miibus_readreg, awg_miibus_readreg),