From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 06EC1C55184 for ; Mon, 3 Aug 2026 10:37:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=+pdokkPVzgPFBzVdRB85NfTsXK5/pNBC/XNgzhJoYlo=; b=p96vda2gyr1HBd5Fl9Hqqj6age D5+hNp0bw6g+6UiX2JbxDcZ6dYqpzGotqr1qyhn4OimjIBP0pMg4TdMYvV1q9fX/905yvws2AnJR9 BhEwg/JmpugaTCRLW4/eWebdt6kfLLN+tTN9cJVv0Z62uFfUK8XEplVgbyHLXx5tGJpmAB/L23Llf 8CMr4gDBqcGMH01k5eNYqIXhRb1j5uucBAubiG895gSrf3TWwZf9AbNcxuh63jn49PPHPr+P0CLmI O0Qdtib+4zzQYhBU067DOdpDjmdPsP1uEnim/eHCdbsFwwY2vzslF5OjoT0OAt7dLFSpisHj44dmB fUNaqElQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1wqq2J-0000000GsKn-1eRU; Mon, 03 Aug 2026 10:36:47 +0000 Received: from smtpout-02.galae.net ([185.246.84.56]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1wqq2G-0000000GsJv-07Ve for linux-arm-kernel@lists.infradead.org; Mon, 03 Aug 2026 10:36:46 +0000 Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id CDC971A13C0; Mon, 3 Aug 2026 10:36:39 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 90A816029B; Mon, 3 Aug 2026 10:36:39 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id A6A9911C17E07; Mon, 3 Aug 2026 12:36:27 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1785753394; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:content-language:in-reply-to:references; bh=+pdokkPVzgPFBzVdRB85NfTsXK5/pNBC/XNgzhJoYlo=; b=HMueVvALhJHd5ndRo/XSDiXdonqgg5k98nlCnQacw04wIeUmHw1X6yB9AuFmFIVTfGkde6 WdGRRZOXZ2W57wU+enL62tPzG7IB/CxopJSGvhh/I6mLpRd/oc2ko9eJhM8ahLUCV4cmxl CH59sXV3sdNO4ADx4Tw6xRq/cuB2OFU7CvLlfg9bTRV168TII8VJtoKNRviis9Q2ZywtHT n8vLmD1de1EYltdHXVSrxwJDANJ5aXNfhoU7U/hy6fKreaQF+4ntLk1TryWIhVKT3vMN1A x64VphkxJI7uuf7ZPbcY/hfQxWKkbYEEoltuwmuiGz58gVIS3HEtc+fb5hIwcg== Message-ID: <2d2cdcea-4ae2-41e2-afcf-713c569da0d8@bootlin.com> Date: Mon, 3 Aug 2026 12:36:26 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH net v3] net: stmmac: resume PHY before hardware setup when opening the interface To: Stefan Agner , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Andrew Lunn Cc: "Russell King (Oracle)" , Jakub Raczynski , Alexander Stein , Ovidiu Panait , Maxime Coquelin , Alexandre Torgue , netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, regressions@lists.linux.dev References: <20260803095156.132827-1-stefan@agner.ch> From: Maxime Chevallier Content-Language: en-US In-Reply-To: <20260803095156.132827-1-stefan@agner.ch> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Last-TLS-Session-Version: TLSv1.3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260803_033644_213615_F0FAA75A X-CRM114-Status: GOOD ( 15.39 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Stefan, On 8/3/26 11:51, Stefan Agner wrote: > Since the referenced commit, changing the MTU on a running interface no > longer disconnects and reconnects the PHY; __stmmac_release() merely > stops phylink, which also suspends the PHY (BMCR power-down) when WoL > is not enabled. __stmmac_open() then performs the DMA software reset in > stmmac_hw_setup() before phylink_start() resumes the PHY again. > > IEEE 802.3 22.2.4.1.5 allows a PHY to stop its receive clock while > powered down, and stmmac requires a running receive clock for the DMA > software reset to complete (the phylink config sets mac_requires_rxc). > On such setups, e.g. the RK3566-based Home Assistant Green with an > RTL8211F-VD PHY in RGMII mode, any runtime MTU change now times out and > leaves the interface dead: > > rk_gmac-dwmac fe010000.ethernet end0: Failed to reset the dma > rk_gmac-dwmac fe010000.ethernet end0: stmmac_hw_setup: DMA engine initialization failed > rk_gmac-dwmac fe010000.ethernet end0: __stmmac_open: Hw setup failed > rk_gmac-dwmac fe010000.ethernet end0: failed reopening the interface after MTU change > > In the field this is triggered by NetworkManager applying an MTU while > activating the connection, breaking networking entirely. The same > regression has also been reported on i.MX8MP and reproduced on SoCFPGA > based systems. > > Resume the PHY in __stmmac_open() before the hardware setup, making it > the counterpart of the phylink_stop() in __stmmac_release(), like > stmmac_resume() already does for the same reason. phylink_start() also > resumes the PHY, but only after stmmac_hw_setup(), and it cannot be > moved before the hardware setup since it may bring the link up > immediately from a workqueue, racing with the initialization (see the > comment in stmmac_resume()). For the regular ndo_open path the PHY has > just been attached and is not suspended, in which case > phylink_prepare_resume() does nothing. > > Fixes: db299a0c09e9 ("net: stmmac: move PHY handling out of __stmmac_open()/release()") > Link: https://github.com/home-assistant/operating-system/issues/4858 > Tested-by: Alexander Stein > Assisted-by: Claude:claude-fable-5 > Signed-off-by: Stefan Agner Tested-by: Maxime Chevallier Reviewed-by: Maxime Chevallier Do you feel confident following-up with the phylink renames, or should I add that to my todolist ? Thanks Maxime