From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: Romain Gantois <romain.gantois@bootlin.com>
Cc: "Alexandre Torgue" <alexandre.torgue@foss.st.com>,
"Jose Abreu" <joabreu@synopsys.com>,
"Andrew Lunn" <andrew@lunn.ch>,
"Jakub Kicinski" <kuba@kernel.org>,
"Heiner Kallweit" <hkallweit1@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
"Eric Dumazet" <edumazet@google.com>,
"Paolo Abeni" <pabeni@redhat.com>,
"Maxime Coquelin" <mcoquelin.stm32@gmail.com>,
"Clément Léger" <clement.leger@bootlin.com>,
"Marek Vasut" <marex@denx.de>,
"Clark Wang" <xiaoning.wang@nxp.com>,
"Miquel Raynal" <miquel.raynal@bootlin.com>,
"Sylvain Girard" <sylvain.girard@se.com>,
"Pascal EBERHARD" <pascal.eberhard@se.com>,
netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com,
linux-arm-kernel@lists.infradead.org,
linux-renesas-soc@vger.kernel.org
Subject: Re: [PATCH net 5/5] net: pcs: rzn1-miic: Init RX clock early if MAC requires it
Date: Wed, 3 Jan 2024 15:01:07 +0000 [thread overview]
Message-ID: <ZZV2s/TGKanl76TI@shell.armlinux.org.uk> (raw)
In-Reply-To: <20240103142827.168321-6-romain.gantois@bootlin.com>
On Wed, Jan 03, 2024 at 03:28:25PM +0100, Romain Gantois wrote:
> The 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.
>
> Check the rxc_always_on pcs flag and enable the clock signal during the
> link validation phase.
However, validation is *not* supposed to change the configuration of
the hardware. Validation may fail. The "interface" that gets passed
to validation may never ever be selected. This change feels like
nothing more than a hack.
Since the MAC driver has to itself provide the PCS to phylink via the
mac_select_pcs() method, the MAC driver already has knowledge of which
PCS it is going to be using. Therefore, I think it may make sense
to do something like this:
int phylink_pcs_preconfig(struct phylink *pl, struct phylink_pcs *pcs)
{
if (pl->config->mac_requires_rxc)
pcs->rxc_always_on = true;
if (pcs->ops->preconfig)
pcs->ops->pcs_preconfig(pcs);
}
and have stmmac call phylink_pcs_preconfig() for each PCS that it will
be using during initialisation / resume paths?
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
WARNING: multiple messages have this Message-ID (diff)
From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: Romain Gantois <romain.gantois@bootlin.com>
Cc: "Alexandre Torgue" <alexandre.torgue@foss.st.com>,
"Jose Abreu" <joabreu@synopsys.com>,
"Andrew Lunn" <andrew@lunn.ch>,
"Jakub Kicinski" <kuba@kernel.org>,
"Heiner Kallweit" <hkallweit1@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
"Eric Dumazet" <edumazet@google.com>,
"Paolo Abeni" <pabeni@redhat.com>,
"Maxime Coquelin" <mcoquelin.stm32@gmail.com>,
"Clément Léger" <clement.leger@bootlin.com>,
"Marek Vasut" <marex@denx.de>,
"Clark Wang" <xiaoning.wang@nxp.com>,
"Miquel Raynal" <miquel.raynal@bootlin.com>,
"Sylvain Girard" <sylvain.girard@se.com>,
"Pascal EBERHARD" <pascal.eberhard@se.com>,
netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com,
linux-arm-kernel@lists.infradead.org,
linux-renesas-soc@vger.kernel.org
Subject: Re: [PATCH net 5/5] net: pcs: rzn1-miic: Init RX clock early if MAC requires it
Date: Wed, 3 Jan 2024 15:01:07 +0000 [thread overview]
Message-ID: <ZZV2s/TGKanl76TI@shell.armlinux.org.uk> (raw)
In-Reply-To: <20240103142827.168321-6-romain.gantois@bootlin.com>
On Wed, Jan 03, 2024 at 03:28:25PM +0100, Romain Gantois wrote:
> The 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.
>
> Check the rxc_always_on pcs flag and enable the clock signal during the
> link validation phase.
However, validation is *not* supposed to change the configuration of
the hardware. Validation may fail. The "interface" that gets passed
to validation may never ever be selected. This change feels like
nothing more than a hack.
Since the MAC driver has to itself provide the PCS to phylink via the
mac_select_pcs() method, the MAC driver already has knowledge of which
PCS it is going to be using. Therefore, I think it may make sense
to do something like this:
int phylink_pcs_preconfig(struct phylink *pl, struct phylink_pcs *pcs)
{
if (pl->config->mac_requires_rxc)
pcs->rxc_always_on = true;
if (pcs->ops->preconfig)
pcs->ops->pcs_preconfig(pcs);
}
and have stmmac call phylink_pcs_preconfig() for each PCS that it will
be using during initialisation / resume paths?
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2024-01-03 15:01 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-03 14:28 [PATCH net 0/5] Fix missing PHY-to-MAC RX clock Romain Gantois
2024-01-03 14:28 ` Romain Gantois
2024-01-03 14:28 ` [PATCH net 1/5] net: phy: add PHY_F_RXC_ALWAYS_ON to PHY dev flags Romain Gantois
2024-01-03 14:28 ` Romain Gantois
2024-01-03 14:28 ` [PATCH net 2/5] net: phy: add rxc_always_on flag to phylink_pcs Romain Gantois
2024-01-03 14:28 ` Romain Gantois
2024-01-03 14:28 ` [PATCH net 3/5] net: stmmac: Signal to PHY/PCS drivers to keep RX clock on Romain Gantois
2024-01-03 14:28 ` Romain Gantois
2024-01-03 14:28 ` [PATCH net 4/5] net: phy: at803x: Avoid hibernating if MAC requires RX clock Romain Gantois
2024-01-03 14:28 ` Romain Gantois
2024-01-03 14:28 ` [PATCH net 5/5] net: pcs: rzn1-miic: Init RX clock early if MAC requires it Romain Gantois
2024-01-03 14:28 ` Romain Gantois
2024-01-03 15:01 ` Russell King (Oracle) [this message]
2024-01-03 15:01 ` Russell King (Oracle)
2024-01-03 15:45 ` Romain Gantois
2024-01-03 15:45 ` Romain Gantois
2024-01-03 21:28 ` [PATCH net 0/5] Fix missing PHY-to-MAC RX clock Jakub Kicinski
2024-01-03 21:28 ` Jakub Kicinski
2024-01-04 8:01 ` Romain Gantois
2024-01-04 8:01 ` Romain Gantois
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZZV2s/TGKanl76TI@shell.armlinux.org.uk \
--to=linux@armlinux.org.uk \
--cc=alexandre.torgue@foss.st.com \
--cc=andrew@lunn.ch \
--cc=clement.leger@bootlin.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hkallweit1@gmail.com \
--cc=joabreu@synopsys.com \
--cc=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=marex@denx.de \
--cc=mcoquelin.stm32@gmail.com \
--cc=miquel.raynal@bootlin.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=pascal.eberhard@se.com \
--cc=romain.gantois@bootlin.com \
--cc=sylvain.girard@se.com \
--cc=xiaoning.wang@nxp.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.