Fix missing PHY-to-MAC RX clock
Subsystems (9)
v4 cover Fix missing PHY-to-MAC RX clock
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/[email protected]/
Clément Léger's report:
https://lore.kernel.org/linux-arm-kernel/[email protected]/
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/[email protected]
---
- Link to v3: https://lore.kernel.org/r/[email protected]
---
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,
Signature · 1 line
Romain Gantois <[email protected]>
PATCH v4 1/7 net: phylink: add PHY_F_RXC_ALWAYS_ON to PHY dev flags
From: Russell King <[email protected]>
Some MAC controllers (e.g. stmmac) require their connected PHY to continuously provide a receive clock signal. This can cause issues in two cases:
1. The clock signal hasn't been started yet by the time the MAC driver initializes its hardware. This can make the initialization fail, as in the case of the rzn1 GMAC1 driver.
2. The clock signal is cut during a power saving event. By the time the MAC is brought back up, the clock signal is still not active since phylink_start hasn't been called yet. This brings us back to case 1.
If a PHY driver reads this flag, it should ensure that the receive clock signal is started as soon as possible, and that it isn't brought down when the PHY goes into suspend.
--- drivers/net/phy/phylink.c | 10 +++++++++- include/linux/phy.h | 1 + include/linux/phylink.h | 4 ++++ 3 files changed, 14 insertions(+), 1 deletion(-)
drivers/net/phy/phylink.c +9 -1
@@ -1923,6 +1923,8 @@ static int phylink_bringup_phy(struct phylink *pl, struct phy_device *phy,static int phylink_attach_phy (struct phylink *pl,struct phy_device *phy,phy_interface_t interface) { +u32 flags =0 ; +if (WARN_ON (pl->cfg_link_an_mode ==MLO_AN_FIXED || (pl->cfg_link_an_mode ==MLO_AN_INBAND &&phy_interface_mode_is_8023z (interface) && !pl->sfp_bus)))
@@ -1931,7 +1933,10 @@ static int phylink_attach_phy(struct phylink *pl, struct phy_device *phy,if (pl->phydev)return -EBUSY ; -return phy_attach_direct (pl->netdev, phy,0 , interface); +if (pl->config->mac_requires_rxc) + flags |=PHY_F_RXC_ALWAYS_ON ; + +return phy_attach_direct (pl->netdev, phy, flags, interface); }/**
@@ -2034,6 +2039,9 @@ int phylink_fwnode_phy_connect(struct phylink *pl, pl->link_config.interface = pl->link_interface; } +if (pl->config->mac_requires_rxc) + flags |=PHY_F_RXC_ALWAYS_ON ; + ret =phy_attach_direct (pl->netdev, phy_dev, flags, pl->link_interface);phy_device_free (phy_dev);
include/linux/phy.h +1 -0
@@ -771,6 +771,7 @@ struct phy_device {/* Generic phy_device::dev_flags */ #define PHY_F_NO_IRQ 0x80000000 +#define PHY_F_RXC_ALWAYS_ON 0x40000000static inline struct phy_device *to_phy_device (const struct device *dev) {
include/linux/phylink.h +4 -0
@@ -138,6 +138,9 @@ enum phylink_op_type {* @poll_fixed_state: if true, starts link_poll, * if MAC link is at %MLO_AN_FIXED mode. * @mac_managed_pm: if true, indicate the MAC driver is responsible for PHY PM. +* @mac_requires_rxc: if true, the MAC always requires a receive clock from PHY. +* The PHY driver should start the clock signal as soon as +* possible and avoid stopping it during suspend events. * @ovr_an_inband: if true, override PCS to MLO_AN_INBAND * @get_fixed_state: callback to execute to determine the fixed link state, * if MAC link is at %MLO_AN_FIXED mode.
@@ -150,6 +153,7 @@ struct phylink_config {enum phylink_op_type type;bool poll_fixed_state;bool mac_managed_pm; +bool mac_requires_rxc;bool ovr_an_inband;void (*get_fixed_state)(struct phylink_config *config,struct phylink_link_state *state);
Signature · 1 line
2.43.0
PATCH v4 2/7 net: phylink: add rxc_always_on flag to phylink_pcs
In reply to Romain GantoisSome MAC drivers (e.g. stmmac) require a continuous receive clock signal to be generated by a PCS that is handled by a standalone PCS driver.
Such a PCS driver does not have access to a PHY device, thus cannot check the PHY_F_RXC_ALWAYS_ON flag. They cannot check max_requires_rxc in the phylink config either, since it is a private member. Therefore, a new flag is needed to signal to the PCS that it should keep the RX clock signal up at all times.
--- drivers/net/phy/phylink.c | 14 ++++++++++++++ include/linux/phylink.h | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+)
drivers/net/phy/phylink.c +14 -0
@@ -1042,6 +1042,20 @@ static void phylink_pcs_poll_start(struct phylink *pl)mod_timer (&pl->link_poll, jiffies +HZ ); } +int phylink_pcs_pre_init (struct phylink *pl,struct phylink_pcs *pcs) +{ +int ret =0 ; + +/* Signal to PCS driver that MAC requires RX clock for init */ +if (pl->config->mac_requires_rxc) + pcs->rxc_always_on = true; + +if (pcs->ops->pcs_pre_init) + ret = pcs->ops->pcs_pre_init (pcs); + +return ret; +} +static void phylink_mac_config (struct phylink *pl,const struct phylink_link_state *state) {
include/linux/phylink.h +38 -0
@@ -396,6 +396,10 @@ struct phylink_pcs_ops;* @phylink: pointer to &struct phylink_config * @neg_mode: provide PCS neg mode via "mode" argument * @poll: poll the PCS for link changes +* @rxc_always_on: The MAC driver requires the reference clock +* to always be on. Standalone PCS drivers which +* do not have access to a PHY device can check +* this instead of PHY_F_RXC_ALWAYS_ON. * * This structure is designed to be embedded within the PCS private data, * and will be passed between phylink and the PCS.
@@ -408,6 +412,7 @@ struct phylink_pcs {struct phylink *phylink;bool neg_mode;bool poll; +bool rxc_always_on; };/**
@@ -422,6 +427,8 @@ struct phylink_pcs {* @pcs_an_restart: restart 802.3z BaseX autonegotiation. * @pcs_link_up: program the PCS for the resolved link configuration * (where necessary). +* @pcs_pre_init: configure PCS components necessary for MAC hardware +* initialization e.g. RX clock for stmmac. */ struct phylink_pcs_ops { int (*pcs_validate)(struct phylink_pcs *pcs, unsigned long *supported,
@@ -441,6 +448,7 @@ struct phylink_pcs_ops {void (*pcs_an_restart)(struct phylink_pcs *pcs);void (*pcs_link_up)(struct phylink_pcs *pcs,unsigned int neg_mode,phy_interface_t interface,int speed,int duplex); +int (*pcs_pre_init)(struct phylink_pcs *pcs); };#if 0 /* For kernel-doc purposes only. */
@@ -549,6 +557,34 @@ void pcs_an_restart(struct phylink_pcs *pcs);*/ void pcs_link_up (struct phylink_pcs *pcs,unsigned int neg_mode,phy_interface_t interface,int speed,int duplex); + +/** +* pcs_pre_init() - Configure PCS components necessary for MAC initialization +* @pcs: a pointer to a &struct phylink_pcs. +* +* This function can be called by MAC drivers through the +* phylink_pcs_pre_init() wrapper, before their hardware is initialized. It +* should not be called after the link is brought up, as reconfiguring the PCS +* at this point could break the link. +* +* Some MAC devices require specific hardware initialization to be performed by +* their associated PCS device before they can properly initialize their own +* hardware. An example of this is the initialization of stmmac controllers, +* which requires an active REF_CLK signal to be provided by the PHY/PCS. +* +* By calling phylink_pcs_pre_init(), MAC drivers can ensure that the PCS is +* setup in a way that allows for successful hardware initialization. +* +* The specific configuration performed by pcs_pre_init() is dependent on the +* model of PCS and the requirements of the MAC device attached to it. PCS +* driver authors should consider whether their target device is to be used in +* conjunction with a MAC device whose driver calls phylink_pcs_pre_init(). MAC +* driver authors should document their requirements for the PCS +* pre-initialization. +* +*/ +int pcs_config (struct phylink_pcs *pcs); +#endif struct phylink *phylink_create(struct phylink_config *,
@@ -568,6 +604,8 @@ void phylink_disconnect_phy(struct phylink *);void phylink_mac_change (struct phylink *,bool up);void phylink_pcs_change (struct phylink_pcs *,bool up); +int phylink_pcs_pre_init (struct phylink *pl,struct phylink_pcs *pcs); +void phylink_start (struct phylink *);void phylink_stop (struct phylink *);
Signature · 1 line
2.43.0
PATCH v4 3/7 net: stmmac: don't rely on lynx_pcs presence to check for a PHY
In reply to Romain GantoisFrom: Maxime Chevallier <[email protected]>
When initializing attached PHYs, there are some cases where we don't expect any PHY to be connected. The logic uses conditions based on various local PCS configuration, but also calls-in phylink_expects_phy() via stmmac_init_phy(), which is enough to ensure we don't try to initialize a PHY when using a Lynx PCS, as long as we have the phy_interface set to a 802.3z mode and are using inband negociation.
Drop the lynx check, making the stmmac generic code more pcs_lynx-agnostic.
--- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +1 -2
@@ -3959,8 +3959,7 @@ static int __stmmac_open(struct net_device *dev,if (priv->hw->pcs !=STMMAC_PCS_TBI && priv->hw->pcs !=STMMAC_PCS_RTBI && (!priv->hw->xpcs || -xpcs_get_an_mode (priv->hw->xpcs, mode) !=DW_AN_C73 ) && - !priv->hw->lynx_pcs) { +xpcs_get_an_mode (priv->hw->xpcs, mode) !=DW_AN_C73 )) { ret =stmmac_init_phy (dev);if (ret) { netdev_err(priv->dev,
Signature · 1 line
2.43.0
PATCH v4 4/7 net: stmmac: Support a generic PCS field in mac_device_info
In reply to Romain GantoisGlobal stmmac support for early initialization of PCS devices requires a generic PCS reference that can be passed to phylink_pcs_pre_init(). Currently, the mac_device_info struct contains only one PCS field, which is specific to the Lynx model.
As PCS models are hardware-specific, it is more appropriate to have a generic PCS field in the mac_device_info struct.
Refactor the lynx_pcs field into a generic phylink_pcs field.
--- drivers/net/ethernet/stmicro/stmmac/common.h | 2 +- drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c | 8 ++++---- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 5 +---- 3 files changed, 6 insertions(+), 9 deletions(-)
drivers/net/ethernet/stmicro/stmmac/common.h +1 -1
@@ -593,7 +593,7 @@ struct mac_device_info {const struct stmmac_mmc_ops *mmc;const struct stmmac_est_ops *est;struct dw_xpcs *xpcs; -struct phylink_pcs *lynx_pcs;/* Lynx external PCS */ +struct phylink_pcs *phylink_pcs;struct mii_regs mii;/* MII register Addresses */ struct mac_link link;void __iomem *pcsr;/* vpointer to device CSRs */
drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c +4 -4
@@ -479,9 +479,9 @@ static int socfpga_dwmac_probe(struct platform_device *pdev) goto err_dvr_remove; } - stpriv->hw->lynx_pcs =lynx_pcs_create_mdiodev (pcs_bus,0 ); -if (IS_ERR (stpriv->hw->lynx_pcs)) { - ret =PTR_ERR (stpriv->hw->lynx_pcs); + stpriv->hw->phylink_pcs =lynx_pcs_create_mdiodev (pcs_bus,0 ); +if (IS_ERR (stpriv->hw->phylink_pcs)) { + ret =PTR_ERR (stpriv->hw->phylink_pcs); goto err_dvr_remove; } }
@@ -498,7 +498,7 @@ static void socfpga_dwmac_remove(struct platform_device *pdev) {struct net_device *ndev =platform_get_drvdata (pdev);struct stmmac_priv *priv =netdev_priv (ndev); -struct phylink_pcs *pcs = priv->hw->lynx_pcs; +struct phylink_pcs *pcs = priv->hw->phylink_pcs;stmmac_pltfr_remove (pdev);
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +1 -4
@@ -944,10 +944,7 @@ static struct phylink_pcs *stmmac_mac_select_pcs(struct phylink_config *config,if (priv->hw->xpcs)return &priv->hw->xpcs->pcs; -if (priv->hw->lynx_pcs) -return priv->hw->lynx_pcs; - -return NULL ; +return priv->hw->phylink_pcs; } static void stmmac_mac_config(struct phylink_config *config, unsigned int mode,
Signature · 1 line
2.43.0
PATCH v4 5/7 net: stmmac: Signal to PHY/PCS drivers to keep RX clock on
In reply to Romain GantoisThere is a reocurring issue with stmmac controllers where the MAC fails to initialize its hardware if an RX clock signal isn't provided on the MAC/PHY link.
This causes issues when PHY or PCS devices either go into suspend while cutting the RX clock or do not bring the clock signal up early enough for the MAC to initialize successfully.
Set the mac_requires_rxc flag in the stmmac phylink config so that PHY/PCS drivers know to keep the RX clock up at all times.
--- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +7 -0
@@ -1218,6 +1218,9 @@ static int stmmac_phy_setup(struct stmmac_priv *priv) priv->phylink_config.type =PHYLINK_NETDEV ; priv->phylink_config.mac_managed_pm = true; +/* Stmmac always requires an RX clock for hardware initialization */ + priv->phylink_config.mac_requires_rxc = true; + mdio_bus_data = priv->plat->mdio_bus_data;if (mdio_bus_data) priv->phylink_config.ovr_an_inband =
@@ -3407,6 +3410,10 @@ static int stmmac_hw_setup(struct net_device *dev, bool ptp_register)u32 chan;int ret; +/* Make sure RX clock is enabled */ +if (priv->hw->phylink_pcs) +phylink_pcs_pre_init (priv->phylink, priv->hw->phylink_pcs); +/* DMA initialization and SW reset */ ret =stmmac_init_dma_engine (priv);if (ret <0 ) {
Signature · 1 line
2.43.0
PATCH v4 6/7 net: phy: qcom: at803x: Avoid hibernating if MAC requires RX clock
In reply to Romain GantoisFrom: Russell King <[email protected]>
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.
--- drivers/net/phy/qcom/at803x.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/phy/qcom/at803x.c +2 -1
@@ -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,
Signature · 1 line
2.43.0
PATCH v4 7/7 net: pcs: rzn1-miic: Init RX clock early if MAC requires it
In reply to Romain GantoisThe GMAC1 controller in the RZN1 IP requires the RX MII clock signal to be started before it initializes its own hardware, thus before it calls phylink_start.
Implement the pcs_pre_init() callback so that the RX clock signal can be enabled early if necessary.
--- drivers/net/pcs/pcs-rzn1-miic.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+)
drivers/net/pcs/pcs-rzn1-miic.c +28 -0
@@ -279,10 +279,38 @@ static int miic_validate(struct phylink_pcs *pcs, unsigned long *supported,return -EINVAL ; } +static int miic_pre_init (struct phylink_pcs *pcs) +{ +struct miic_port *miic_port =phylink_pcs_to_miic_port (pcs); +struct miic *miic = miic_port->miic; +u32 val, mask; + +/* Start RX clock if required */ +if (pcs->rxc_always_on) { +/* In MII through mode, the clock signals will be driven by the +* external PHY, which might not be initialized yet. Set RMII +* as default mode to ensure that a reference clock signal is +* generated. +*/ + miic_port->interface =PHY_INTERFACE_MODE_RMII ; + + val =FIELD_PREP (MIIC_CONVCTRL_CONV_MODE ,CONV_MODE_RMII ) | +FIELD_PREP (MIIC_CONVCTRL_CONV_SPEED ,CONV_MODE_100MBPS ); + mask =MIIC_CONVCTRL_CONV_MODE |MIIC_CONVCTRL_CONV_SPEED ; + +miic_reg_rmw (miic,MIIC_CONVCTRL (miic_port->port), mask, val); + +miic_converter_enable (miic, miic_port->port,1 ); + } + +return 0 ; +} +static const struct phylink_pcs_ops miic_phylink_ops = { .pcs_validate = miic_validate, .pcs_config = miic_config, .pcs_link_up = miic_link_up, + .pcs_pre_init = miic_pre_init, };struct phylink_pcs *miic_create (struct device *dev,struct device_node *np)
Signature · 1 line
2.43.0
Simon Horman
reviewerRe: [PATCH net-next v4 2/7] net: phylink: add rxc_always_on flag to phylink_pcs
In reply to Romain GantoisQuoted 11 lines · Romain Gantois
Some MAC drivers (e.g. stmmac) require a continuous receive clock signal to be generated by a PCS that is handled by a standalone PCS driver.
Such a PCS driver does not have access to a PHY device, thus cannot check the
PHY_F_RXC_ALWAYS_ONflag. They cannot checkmax_requires_rxcin the phylink config either, since it is a private member. Therefore, a new flag is needed to signal to the PCS that it should keep the RX clock signal up at all times.Suggested-by Russell King <[email protected]>Signed-off-by Romain Gantois <[email protected]>
...
Quoted 21 lines
include/linux/phylink.h +17
-0@@ -549,6 +557,34 @@ void pcs_an_restart(struct phylink_pcs *pcs);*/ void pcs_link_up (struct phylink_pcs *pcs,unsigned int neg_mode,phy_interface_t interface,int speed,int duplex); + +/** +* pcs_pre_init() - Configure PCS components necessary for MAC initialization +* @pcs: a pointer to a &struct phylink_pcs. +* +* This function can be called by MAC drivers through the +* phylink_pcs_pre_init() wrapper, before their hardware is initialized. It +* should not be called after the link is brought up, as reconfiguring the PCS +* at this point could break the link. +* +* Some MAC devices require specific hardware initialization to be performed by +* their associated PCS device before they can properly initialize their own +* hardware. An example of this is the initialization of stmmac controllers, +* which requires an active REF_CLK signal to be provided by the PHY/PCS. +* +* By calling phylink_pcs_pre_init(), MAC drivers can ensure that the PCS is +* setup in a way that allows for successful hardware initialization.
include/linux/phylink.h void pcs_an_restart(struct phylink_pcs *pcs); · line 586
Quoted 10 lines
include/linux/phylink.h +10
-0+* +* The specific configuration performed by pcs_pre_init() is dependent on the +* model of PCS and the requirements of the MAC device attached to it. PCS +* driver authors should consider whether their target device is to be used in +* conjunction with a MAC device whose driver calls phylink_pcs_pre_init(). MAC +* driver authors should document their requirements for the PCS +* pre-initialization. +* +*/ +int pcs_config (struct phylink_pcs *pcs);
Hi Romain,
Should this be pcs_pre_init instead of pcs_config?
Quoted 4 lines
include/linux/phylink.h +1
-0+#endif struct phylink *phylink_create(struct phylink_config *,
...
Jakub Kicinski
maintainerRe: [PATCH net-next v4 5/7] net: stmmac: Signal to PHY/PCS drivers to keep RX clock on
In reply to Romain GantoisQuoted 11 lines · On Wed, 21 Feb 2024 14:04:22 +0100 Romain Gantois wrote:
There is a reocurring issue with stmmac controllers where the MAC fails to initialize its hardware if an RX clock signal isn't provided on the MAC/PHY link.
This causes issues when PHY or PCS devices either go into suspend while cutting the RX clock or do not bring the clock signal up early enough for the MAC to initialize successfully.
Set the
mac_requires_rxcflag in the stmmac phylink config so that PHY/PCS drivers know to keep the RX clock up at all times.
Quoted 6 lines
Reported-by Clark Wang <[email protected]>Reported-by Clément Léger <[email protected]>Suggested-by Russell King <[email protected]>Signed-off-by Romain Gantois <[email protected]>
breaks allmodconfig:
ERROR: modpost: "phylink_pcs_pre_init" [drivers/net/ethernet/stmicro/stmmac/stmmac.ko] undefined!
Signature · 1 line
pw-bot: cr
Re: [PATCH net-next v4 2/7] net: phylink: add rxc_always_on flag to phylink_pcs
In reply to Simon HormanHello Simon,
Quoted 7 lines · Simon Horman
Quoted 7 lines
+ * driver authors should consider whether their target device is to be used in
+ * conjunction with a MAC device whose driver callsphylink_pcs_pre_init(). MAC
+ * driver authors should document their requirements for the PCS
+ * pre-initialization.
+ *
+ */
+intpcs_config(struct phylink_pcs *pcs);
Yes it should, thank you for pointing that out.
Best Regards,
Signature · 3 lines
Romain Gantois, Bootlin Embedded Linux and Kernel engineering https://bootlin.com