From patchwork Wed Feb 21 13:04:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Romain Gantois X-Patchwork-Id: 13565575 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 B0C5EC48BF6 for ; Wed, 21 Feb 2024 13:04:24 +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:MIME-Version:Message-Id:Date: Subject:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=/+m57e62Rr1r2VKswWh28a/HUX1jcB+hy2W03dDWIG8=; b=hvRQeVzmwFlFot nLw6870dehCE17g80uR2Jt5L5WYPW0DVLbNuUEllOMoo+TpEExy7Pa4OY9HhfphnbgNcVqRjQZyDS e8mZmi1YHywt9QOoGiNalD0VLC0wZ8og9Qrpp0LdL5yMRdbn9EesNJjk9s9wY0PgWjat20be1hCmJ N/XypNPj5oj9X7e2p5tlvdGog6FGsHOHXhj+c+Lki5LYLWa4CoC1KiA1dwzEG9JaGj5XatmDu5Jsr jxzbTs9fLLG/aHhzs3xc058xOdCtNgn3u1CXqxFKBPaLFNg2y7MPlEG+j3Cnlj7YU8j9bM3JeBHBS mSWPXpHfYawZvb+e7RHA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rcmGb-00000000xAy-1VUy; Wed, 21 Feb 2024 13:04:05 +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 1rcmGX-00000000x8c-3yh7 for linux-arm-kernel@lists.infradead.org; Wed, 21 Feb 2024 13:04:03 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id 0488EE000A; Wed, 21 Feb 2024 13:03:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1708520638; 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=U/mNFUOk9QkXbNNdCkBT6ClRB51umlNcGDF8vmj5WAk=; b=PG+g/mXtmf8iIVdAlwYafoMc4v4JGL/b+sCdkvBP2KtieKTQyrSdcWF0riitqzfkokYstJ wyXO1lR8X0ln3Yrcn2M7TESB4iJ+QwdE5s8D14q3qfF2O3OCFU/bwgsn7+GLOHKkK5UaC/ /8kW2zvlaliND6Fla383E4WR63IGm6MnidNplXZKaHxGgncmpLm85iI+t5q1oquVpiVKy9 tEnzsxOeSI+JADNwIvON6nqmt8f8NADrAyNvDbE1E24pO/ZSboZ+eGsALhKY4ZEJZb90uD SfTXQYcJdKjPMN+QoJVtSJ0UqIPyem00Gq3lTDce93lK27k9G3cx/CtFQ9n8VQ== From: Romain Gantois Subject: [PATCH net-next v4 0/7] Fix missing PHY-to-MAC RX clock Date: Wed, 21 Feb 2024 14:04:17 +0100 Message-Id: <20240221-rxc_bugfix-v4-0-4883ee1cc7b1@bootlin.com> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIANL01WUC/1WPQW7DIBBFrxKxzkQwYDvpqveoogqcwUZqoAJiu Yp890ycRePlH+a9+dxFoRyoiI/dXWSaQgkpcjD7nehHGweCcOEsUKKRClvIc//tboMPM1xM57R TVnfGCwZ+M/F4lX2JSBUizVWc+cXndIU6ZrJvMqmVwSN2B9UeNSpQwFs2xMNgY02hfLqU6g/nP l2f+jGUmvLfWnXC9chLpOV7qwlBQkNtr9lLjZcbz7PNpP9hVLiBNcN08kiu5b/JZgsvy/IAz9u JezIBAAA= 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, Romain Gantois , Clark Wang 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_050402_437154_390F92B6 X-CRM114-Status: GOOD ( 17.92 ) 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 Hello everyone, This is version four of my series that addresses the issue with some MAC/PHY combinations. Notable changes in v4: - Modified miic_pre_init() to also set the default RMII conversion speed. Notable changes in v3: - Removed the "interface" argument from pcs_init(). - Added a kernel doc for pcs_init(). Notable changes in v2: - Introduced a pcs op for initializing hardware required for MAC initialization, instead of using phylink_validate() for this purpose. - Refactored stmmac to use a generic PCS reference in mac_device_info instead of a model-specific field. 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(-) --- 2.43.0 --- - Link to v2: https://lore.kernel.org/r/20240130-rxc_bugfix-v2-0-5e6c3168e5f0@bootlin.com --- - Link to v3: https://lore.kernel.org/r/20240212-rxc_bugfix-v3-0-e9f2eb6b3b05@bootlin.com --- Maxime Chevallier (1): net: stmmac: don't rely on lynx_pcs presence to check for a PHY Romain Gantois (4): net: phylink: add rxc_always_on flag to phylink_pcs net: stmmac: Support a generic PCS field in mac_device_info net: stmmac: Signal to PHY/PCS drivers to keep RX clock on net: pcs: rzn1-miic: Init RX clock early if MAC requires it Russell King (2): net: phylink: add PHY_F_RXC_ALWAYS_ON to PHY dev flags net: phy: qcom: at803x: Avoid hibernating if MAC requires RX clock drivers/net/ethernet/stmicro/stmmac/common.h | 2 +- .../net/ethernet/stmicro/stmmac/dwmac-socfpga.c | 8 ++--- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 15 ++++---- drivers/net/pcs/pcs-rzn1-miic.c | 28 +++++++++++++++ drivers/net/phy/phylink.c | 24 ++++++++++++- drivers/net/phy/qcom/at803x.c | 3 +- include/linux/phy.h | 1 + include/linux/phylink.h | 42 ++++++++++++++++++++++ 8 files changed, 110 insertions(+), 13 deletions(-) --- base-commit: 0f37666d87d2dea42ec21776c3d562b7cbd71612 change-id: 20240126-rxc_bugfix-d47b3b1a374f Best regards,