lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <cc90a3d2-4a6a-7274-4ede-cf6ff2f9db17@bootlin.com>
Date: Wed, 21 Feb 2024 10:40:06 +0100 (CET)
From: Romain Gantois <romain.gantois@...tlin.com>
To: Maxime Chevallier <maxime.chevallier@...tlin.com>
cc: Romain Gantois <romain.gantois@...tlin.com>, 
    Russell King <linux@...linux.org.uk>, Andrew Lunn <andrew@...n.ch>, 
    Heiner Kallweit <hkallweit1@...il.com>, 
    "David S. Miller" <davem@...emloft.net>, 
    Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>, 
    Paolo Abeni <pabeni@...hat.com>, 
    Alexandre Torgue <alexandre.torgue@...s.st.com>, 
    Jose Abreu <joabreu@...opsys.com>, 
    Maxime Coquelin <mcoquelin.stm32@...il.com>, 
    Clément Léger <clement.leger@...tlin.com>, 
    Miquel Raynal <miquel.raynal@...tlin.com>, 
    Thomas Petazzoni <thomas.petazzoni@...tlin.com>, netdev@...r.kernel.org, 
    linux-stm32@...md-mailman.stormreply.com, 
    linux-arm-kernel@...ts.infradead.org, linux-renesas-soc@...r.kernel.org
Subject: Re: [PATCH net-next v3 7/7] net: pcs: rzn1-miic: Init RX clock early
 if MAC requires it

Hi Maxime,

On Mon, 12 Feb 2024, Maxime Chevallier wrote:

> > +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;
> > +
> > +	/* 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;
> 
> There's this check in miic_config :
> 
> 	if (interface != miic_port->interface) {
> 		val |= FIELD_PREP(MIIC_CONVCTRL_CONV_SPEED, speed);
> 		mask |= MIIC_CONVCTRL_CONV_SPEED;
> 		miic_port->interface = interface;
> 	}
> 
> As you set the interface to RMII and set the CONV_MODE below without
> really looking at the speed, is there any risk of a mismatch between
> the configured mode and the speed ?
Good point, it is probably necessary to set the default RMII speed in 
miic_pre_init(), since miic_config will not do it if the link mode hasn't 
changed in the meantime. However, this is only an issue if the link isn't 
already up when miic_config() is called. If the link is up, then that means that 
miic_link_up() has already been called and has set the appropriate speed anyway.

Thanks,

-- 
Romain Gantois, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ