All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Golle <daniel@makrotopia.org>
To: "A. Sverdlin" <alexander.sverdlin@siemens.com>
Cc: netdev@vger.kernel.org, Hauke Mehrtens <hauke@hauke-m.de>,
	Andrew Lunn <andrew@lunn.ch>, Vladimir Oltean <olteanv@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next 2/2] net: dsa: mxl-gsw1xx: Support R(G)MII slew rate configuration
Date: Mon, 15 Dec 2025 15:50:17 +0000	[thread overview]
Message-ID: <aUAuObAoaNVOTYdR@makrotopia.org> (raw)
In-Reply-To: <20251212204557.2082890-3-alexander.sverdlin@siemens.com>

Hi Alexander,

On Fri, Dec 12, 2025 at 09:45:53PM +0100, A. Sverdlin wrote:
> From: Alexander Sverdlin <alexander.sverdlin@siemens.com>
> 
> Support newly introduced maxlinear,mii-slew-rate-slow device tree property
> to configure R(G)MII interface pins slew rate into "slow" mode. It might be
> used to reduce the radiated emissions.
> 
> Signed-off-by: Alexander Sverdlin <alexander.sverdlin@siemens.com>
> ---
>  drivers/net/dsa/lantiq/mxl-gsw1xx.c | 6 ++++++
>  drivers/net/dsa/lantiq/mxl-gsw1xx.h | 2 ++
>  2 files changed, 8 insertions(+)
> 
> diff --git a/drivers/net/dsa/lantiq/mxl-gsw1xx.c b/drivers/net/dsa/lantiq/mxl-gsw1xx.c
> index 0816c61a47f12..ec7b92f62dcb5 100644
> --- a/drivers/net/dsa/lantiq/mxl-gsw1xx.c
> +++ b/drivers/net/dsa/lantiq/mxl-gsw1xx.c
> @@ -526,6 +526,12 @@ static struct phylink_pcs *gsw1xx_phylink_mac_select_pcs(struct phylink_config *
>  	switch (dp->index) {
>  	case GSW1XX_SGMII_PORT:
>  		return &gsw1xx_priv->pcs;
> +	case GSW1XX_MII_PORT:
> +		if (of_property_read_bool(dp->dn, "maxlinear,mii-slew-rate-slow"))
> +			regmap_set_bits(gsw1xx_priv->shell,
> +					RGMII_SLEW_CFG_DRV_TXD | RGMII_SLEW_CFG_DRV_TXC,
> +					GSW1XX_SHELL_RGMII_SLEW_CFG);
> +		return NULL;

Please apply this setting once in the probe function before calling
gswip_probe_common(). You will have to traverse the device tree to
the node of the port, but imho this is still better because there is
no need to apply it every time mac_select_pcs() is called. And while
it is not strictly speaking wrong to do it there, in my understanding
the purpose of .mac_select_pcs is to return the PCS and maybe setup
muxes, but not to apply low-level settings.

Apart from that, please program the register also in the 'else' case.

      parent reply	other threads:[~2025-12-15 15:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-12 20:45 [PATCH net-next 0/2] dsa: mxl-gsw1xx: Support R(G)MII slew rate configuration A. Sverdlin
2025-12-12 20:45 ` [PATCH net-next 1/2] dt-bindings: net: dsa: lantiq,gswip: add MaxLinear R(G)MII slew rate A. Sverdlin
2025-12-12 20:45 ` [PATCH net-next 2/2] net: dsa: mxl-gsw1xx: Support R(G)MII slew rate configuration A. Sverdlin
2025-12-12 20:53   ` Andrew Lunn
2025-12-15 15:50   ` Daniel Golle [this message]

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=aUAuObAoaNVOTYdR@makrotopia.org \
    --to=daniel@makrotopia.org \
    --cc=alexander.sverdlin@siemens.com \
    --cc=andrew@lunn.ch \
    --cc=conor+dt@kernel.org \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=edumazet@google.com \
    --cc=hauke@hauke-m.de \
    --cc=krzk+dt@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=pabeni@redhat.com \
    --cc=robh@kernel.org \
    /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.