From patchwork Wed Jan 3 14:28:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Romain Gantois X-Patchwork-Id: 13510119 Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 54B911A593; Wed, 3 Jan 2024 14:28:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="iH1S52sn" Received: by mail.gandi.net (Postfix) with ESMTPSA id 9118B6000B; Wed, 3 Jan 2024 14:28:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1704292097; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hvLf6X7arkWKrAg0bOzGbRODnsEc8AoO5SrOQLUmCf4=; b=iH1S52snSfEZ8ml8P1b6j/7LdhT8pQ4yFVgPdBFGFWBQ2CEfqVxVcI9qX82CN7wdJbWys+ 9fextKtPZWIJ9eRET2/uL5T47EZuVCfHwP4smCagk/uHkIJVSorlVMc9r4LKGY3TH2tfMB oagykw1YUdSiWi4HCl8/KVPuPe/m2X7eRR72ZBDxhwP02t5buiI+m9iO/LxBUvBV5GXC/L ysfNfo2lMHw1sawjjJd6adu0rBVs1o8SFC5Fmu65LmEp4cm4zdBEIVnWAe4OBOCOANDtdM C6cnLSWLMyZoxzqZA4upZm6u4MATGnawmjHMpLbqnTnMmu9G3/zZuQcBocJ1Sw== From: Romain Gantois To: Alexandre Torgue , Jose Abreu , Russell King , Andrew Lunn , Jakub Kicinski , Heiner Kallweit Cc: Romain Gantois , "David S. Miller" , Eric Dumazet , Paolo Abeni , Maxime Coquelin , =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= , Marek Vasut , Clark Wang , Miquel Raynal , Sylvain Girard , Pascal EBERHARD , netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-renesas-soc@vger.kernel.org Subject: [PATCH net 0/5] Fix missing PHY-to-MAC RX clock Date: Wed, 3 Jan 2024 15:28:20 +0100 Message-ID: <20240103142827.168321-1-romain.gantois@bootlin.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-GND-Sasl: romain.gantois@bootlin.com X-Patchwork-Delegate: kuba@kernel.org Hello everyone, There is an issue with some stmmac/PHY combinations that has been reported some time ago in a couple of different series: Clark Wang's report: https://lore.kernel.org/all/20230202081559.3553637-1-xiaoning.wang@nxp.com/ Clément Léger's report: https://lore.kernel.org/linux-arm-kernel/20230116103926.276869-4-clement.leger@bootlin.com/ Stmmac controllers require an RX clock signal from the MII bus to perform their hardware initialization successfully. This causes issues with some PHY/PCS devices. If these devices do not bring the clock signal up before the MAC driver initializes its hardware, then said initialization will fail. This can happen at probe time or when the system wakes up from a suspended state. This series introduces new flags for phy_device and phylink_pcs. These flags allow MAC drivers to signal to PHY/PCS drivers that the RX clock signal should be enabled as soon as possible, and that it should always stay enabled. I have included specific uses of these flags that fix the RZN1 GMAC1 stmmac driver that I am currently working on and that is not yet upstream. I have also included changes to the at803x PHY driver that should fix the issue that Clark Wang was having. Clark, could you please confirm that this series fixes your issue with the at803x PHY? Best Regards, Romain Romain Gantois (2): net: phy: add rxc_always_on flag to phylink_pcs net: pcs: rzn1-miic: Init RX clock early if MAC requires it Russell King (3): net: phy: add PHY_F_RXC_ALWAYS_ON to PHY dev flags net: stmmac: Signal to PHY/PCS drivers to keep RX clock on net: phy: at803x: Avoid hibernating if MAC requires RX clock .../net/ethernet/stmicro/stmmac/stmmac_main.c | 5 +++++ drivers/net/pcs/pcs-rzn1-miic.c | 18 +++++++++++++----- drivers/net/phy/at803x.c | 3 ++- drivers/net/phy/phylink.c | 13 ++++++++++++- include/linux/phy.h | 1 + include/linux/phylink.h | 9 +++++++++ 6 files changed, 42 insertions(+), 7 deletions(-)