From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.208.142.49 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796033869; b=1NtKKO7JtcA++QgpTvq2CZajHvuoT/dXjHTlhreoTC2zHn+ZqKVoKam11HHMYF09oeWv 4lWvG3DnLEzdp9R54b2uxSkijaaUgqL6+taZf64gNSiKLoAau8Y2LJsOsJizDqdvtRxTB zxRTBlrVnxSf0ASRLyDniL0g/cDcIiUAVUzTcpkwTgcHIL3vYwch5Yot7mixTjIQtV+qz p0FMmsvalKMX9HeiwINI2lv9GHP2UEBbXOXBjHD2aBaWZmNlFWB+R6caIPYUkj0cX9GXX GqdJrXL5kcdm7jNnwfvn723JeWR8g8MBom+8cWXi3rbM4saxeFlKju79bqBF0TaS5QA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796033869; h=DMARC-Filter:DKIM-Signature:Received:From:To:Cc:Subject:Date: Message-ID:X-Mailer:MIME-Version:Content-Transfer-Encoding; bh=q1JIeXCTH0KxC22RX9I7Svj+e9uEawyim/eHh5JlV54=; b=lZRjHwY594CjXxro6V6q4cKn6vhGkRI/3oMZHOTcZU6R9NCzpGwxTSjpRgpx+bFOV2Fm my2XyZSZi209f11YaEsClsvSr9cos0dugS8djNLRFxiVTdGaFRrPX6y6+GRpkxjqceFDF IU/leT+Uiy/FRh8BI45FP0+g7whvmZD/sTPEvp2zCRK6sTQc9cCdO1UDdugOooB1BbR9F 84OifEbvTT2355rnansNSUtVcZAmPi8ll4rZuezQx6bj9HCUwW28GLjA5la5xk4socv+H F1yW++HnZejqzkRq0iEXcWY/pTd8YwDndP//5+C3fLV5NIVxRhzWESznavLLWNn7EDA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=kernelriot.com; spf=pass smtp.mailfrom=kernelriot.com; dkim=pass header.d=kernelriot.com header.i=@kernelriot.com header.a=rsa-sha256 header.s=kr2026 header.b=BHPMNR+e; arc=none smtp.remote-ip=74.208.142.49 Received: from mail.kernelriot.com (mail.kernelriot.com [74.208.142.49]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C1622606A32A; Mon, 30 Nov 2026 10:17:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org C1622606A32A Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=kernelriot.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kernelriot.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=kernelriot.com header.i=@kernelriot.com header.a=rsa-sha256 header.s=kr2026 header.b=BHPMNR+e DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernelriot.com; s=kr2026; t=1796033862; bh=oRreBuFzyNXCHmScsDDF4V3YlQRUduSSNPkU9Ol3Sko=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version: Content-Transfer-Encoding:From; b=BHPMNR+eHEqV8BMUWrcyMJ4ZXvjj0ev0noDvyp/WC5Kubj+uvOaPcvn9MfVdv/k/I W7NcCiNzGSKEO76fhB1g82+oWdZejajv1dtt5wXH9Ijzgavg18KnX6lC3oaqq2Jtkz SkgFVWiWAompyxjQy0QbEebPtoYxzA1yH3sQgWAram79lEBYlX68IG7P2/VG/QmnFj rfLawkMFO74j05IVK8NU5+ORKwsKmmuXy+bMP8bwR6EislaeDZZFiLDlasWb/ILmRD zqLGoRoSFA2bvhnti3Y1E2vevbkbW018k0Yk9Q6+WAE3/p61axqGAYCVhx0ouD0cSz FxJoOk9t3juLA== Received: by mail.kernelriot.com (Postfix, from userid 995) id 5A02681B0C; Mon, 30 Nov 2026 10:17:42 +0000 (UTC) From: Magnus Leatti To: Yao Zi , Maxime Chevallier , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: Maxime Coquelin , Alexandre Torgue , Sai Krishna , Giuseppe Nespolino , netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next v3 0/2] net: stmmac: dwmac-motorcomm: shutdown hook and Wake-on-LAN from S5 Date: Mon, 30 Nov 2026 07:16:58 -0300 Message-ID: <20261130101700.1715598-1-magnusleatti@kernelriot.com> X-Mailer: git-send-email 2.56.1 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit YT6801 accepts "ethtool -s eth0 wol g" today, but ignores magic packets. This series makes S5 Wake-on-LAN work. My patches here touches only the glue. v1 called stmmac_suspend() from .shutdown and Yao rejected that [1]. This is the design proposed by Yao, remove the device at shutdown, reset the chip and let it arm itself. Patch 1 just wires .shutdown to the existing remove. Patch 2 arms WoL: after remove, it resets the chip, restores the cleared packet-wake bit, enables PME and drops to D3hot. Tested on a Celeron N3350 mini pc, NIC soldered, net-next at 6964ff21c5d8 with storm fix [2]. net-next wol g no wake, 3 of 3 patched wol g no wake on the address in use, wake on the eFuse address, 5 of 5 patched wol g, 15 min off same, 1 of 1 patched wol ug same, 1 of 1 patched wol u, unicast frames no wake, 1 of 1 patched wol d no wake, 1 of 1 patched wol g, interface down no wake, 1 of 1 patched wol g, wakeup disabled no wake, 1 of 1 patched wol g, reboot reboots, link back, 3 of 3 patched wol g, kexec new kernel, link back, 1 of 1 patched wol g, hibernate same, resumes, link back, 2 of 2 patched wol g, cable out, in no wake, 2 of 2 19 patched shutdowns, all clean. Hibernate on this box ends in a normal power-off (S4 is off in the BIOS), so it goes through .shutdown and arms the same way. The last row is a true power loss: So if power drops, it just won't wake. Meaning: It needs to be shut down cleanly through the driver again. FWIW the vendor driver does the same: wakes after a normal power-off, sleeps through everything after a power loss. So its a hardware thing and not something a driver can fix. BTW stmmac has an old bug here: if a resume fails, NAPI stays off, and then closing the interface just hangs in napi_disable(). Changes in v3: - Patch 1: added the Fixes tag (Yao). - Patch 2: dropped the test numbers from the commit message and two comments (Yao). - No code change. - Collected Reviewed-by from Maxime and Yao, Tested-by from Giuseppe. Changes in v2: - .shutdown no longer calls stmmac_suspend(). It removes the device. - A reset arms the chip, no more OOB WoL or MAC address writes. - D3hot at power-off, v1 stayed in D0. - Magic packet only, on the eFuse address. - The wake condition is read under RTNL. - Added Suggested-by Yao on both patches. v2: https://lore.kernel.org/netdev/20261120102754.778283-1-magnusleatti@kernelriot.com/ v1: https://lore.kernel.org/netdev/20261116091757.1656602-1-magnusleatti@kernelriot.com/ [1] https://lore.kernel.org/netdev/avsTEglKKD_wl_Fi@pie/ [2] https://lore.kernel.org/netdev/20261113103236.2184751-1-maxime.chevallier@bootlin.com/ Magnus Leatti (2): net: stmmac: dwmac-motorcomm: remove the device at shutdown net: stmmac: dwmac-motorcomm: support Wake-on-LAN from S5 .../ethernet/stmicro/stmmac/dwmac-motorcomm.c | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) base-commit: 81159a672c331993566a12ad8e07532b38355cba -- 2.56.1