From patchwork Wed Feb 21 13:04:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Romain Gantois X-Patchwork-Id: 13565578 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 DEC4BC48BC3 for ; Wed, 21 Feb 2024 13:05:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=TDKr/jTyImlUCStV+11NakJy5TCdZoGAaDc9XRHGRxU=; b=eQMAVvUePsvzuF lkKslrN/uOT4pWaqd61rf0uO2yQNCCPfg63WTZGSOwuMZk6gpcO4UrEtfA4/vCLur+bY1RtikTV3S z1WFivmov6FIL7ZhyyjpSbMQ07RGAe4NlaBSFXLbguYekWK4cjo9PylFfYKDOE4uD8Vn/wS52MHU9 cfG7c9xHy8HvIzeHmLS5K0BPYYzzbr4vYW0qppNZWSv8qxvBfpavpn6WR/RvX/B8kSi/jWz5MEMQz LE4qSaBQDTm1yEjkm5D2XOs64I+lvpFR85tf3Q5J1I5KHucrTn9beRo+wj6bIjTDgZXhD/S/vVY1r YQ3FIeVZSj8dKWeazzug==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rcmHN-00000000xbV-2Nul; Wed, 21 Feb 2024 13:04:53 +0000 Received: from relay4-d.mail.gandi.net ([217.70.183.196]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rcmGb-00000000xAb-2ZnM for linux-arm-kernel@lists.infradead.org; Wed, 21 Feb 2024 13:04:07 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id 5CF2CE0018; Wed, 21 Feb 2024 13:04:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1708520644; 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: in-reply-to:in-reply-to:references:references; bh=nTYOICYJuQ5UIisiBLtAqZAhBd/IR4LXyUg6LvrTYmk=; b=IoHri9sxwMNAnWPqnA3xstbMYeRTaDORCIVdTDIdWSOOY46N5X0Q2/MueHepcQ6lBoZGsL tsgnufiv/ay44+kVWJvL3yNReTvtp9ZVowD0+F2qBUJXaa5Cc9uj+4SUMl0xwtMi03MhYe VjXtL55U7QvKlyMeDPdCKFzFV1ev3I2XX3pxgIVx/cCxkT7MDoyglrC8ZNlsEk0Vcz3qHB p8WFzaGRcjyijkCMn8G/JQVrWK5DsvTYhhyglASWI5OlVKPy/x+iG0xRB/EILqytIGz+lw 8+h4Qbe1M/ixyZHEARSTlE873B8Z3bLRvuMunsyjfyms2KcwtVAYXU56U2GwjQ== From: Romain Gantois Date: Wed, 21 Feb 2024 14:04:23 +0100 Subject: [PATCH net-next v4 6/7] net: phy: qcom: at803x: Avoid hibernating if MAC requires RX clock MIME-Version: 1.0 Message-Id: <20240221-rxc_bugfix-v4-6-4883ee1cc7b1@bootlin.com> References: <20240221-rxc_bugfix-v4-0-4883ee1cc7b1@bootlin.com> In-Reply-To: <20240221-rxc_bugfix-v4-0-4883ee1cc7b1@bootlin.com> To: Russell King , Andrew Lunn , Heiner Kallweit , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Alexandre Torgue , Jose Abreu , Maxime Coquelin , =?utf-8?b?Q2zDqW1lbnQgTMOp?= =?utf-8?b?Z2Vy?= Cc: Maxime Chevallier , Miquel Raynal , Thomas Petazzoni , netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-renesas-soc@vger.kernel.org, Clark Wang , Romain Gantois X-Mailer: b4 0.12.4 X-GND-Sasl: romain.gantois@bootlin.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240221_050405_831513_99A21BA3 X-CRM114-Status: GOOD ( 13.15 ) 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 From: Russell King Stmmac controllers connected to an at803x PHY cannot resume properly after suspend when WoL is enabled. This happens because the MAC requires an RX clock generated by the PHY to initialize its hardware properly. But the RX clock is cut when the PHY suspends and isn't brought up until the MAC driver resumes the phylink. Prevent the at803x PHY driver from going into suspend if the attached MAC driver always requires an RX clock signal. Reported-by: Clark Wang Link: https://lore.kernel.org/all/20230202081559.3553637-1-xiaoning.wang@nxp.com/ Signed-off-by: Russell King [rgantois: commit log] Signed-off-by: Romain Gantois --- drivers/net/phy/qcom/at803x.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/phy/qcom/at803x.c b/drivers/net/phy/qcom/at803x.c index 4717c59d51d0..2a221b81cf37 100644 --- a/drivers/net/phy/qcom/at803x.c +++ b/drivers/net/phy/qcom/at803x.c @@ -426,7 +426,8 @@ static int at803x_hibernation_mode_config(struct phy_device *phydev) /* The default after hardware reset is hibernation mode enabled. After * software reset, the value is retained. */ - if (!(priv->flags & AT803X_DISABLE_HIBERNATION_MODE)) + if (!(priv->flags & AT803X_DISABLE_HIBERNATION_MODE) && + !(phydev->dev_flags & PHY_F_RXC_ALWAYS_ON)) return 0; return at803x_debug_reg_mask(phydev, AT803X_DEBUG_REG_HIB_CTRL,