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: <20260125133606.1257ff61@kernel.org>
Date: Sun, 25 Jan 2026 13:36:06 -0800
From: Jakub Kicinski <kuba@...nel.org>
To: Joris Vaisvila <joey@...yisr.com>
Cc: netdev@...r.kernel.org, nbd@....name, sean.wang@...iatek.com,
 lorenzo@...nel.org, andrew+netdev@...n.ch, davem@...emloft.net,
 edumazet@...gle.com, pabeni@...hat.com
Subject: Re: [PATCH net-next v3] net: ethernet: mtk_eth_soc: avoid writing
 to ESW registers on MT7628

On Thu, 22 Jan 2026 20:58:08 +0200 Joris Vaisvila wrote:
> The MT7628 has a fixed-link PHY and does not expose MAC control
> registers. Writes to these registers only corrupt the ESW VLAN
> configuration.
> 
> This patch registers empty phylink_mac_ops for MT7628, as removing the
> invalid register accesses leaves nothing to do on this SoC.
> 
> Fixes: 296c9120752b ("net: ethernet: mediatek: Add MT7628/88 SoC support")

If we're going with net-next please drop the Fixes tag.
We don't need a backport. You can quote the commit if you prefer eg:

This code was introduced by commit 296c9120752b ("net: ethernet:
mediatek: Add MT7628/88 SoC support")

> +static void rt5350_mac_config(struct phylink_config *config, unsigned int mode,
> +				const struct phylink_link_state *state)
> +{
> +}
> +
> +static void rt5350_mac_link_down(struct phylink_config *config, unsigned int mode,
> +				phy_interface_t interface)
> +{
> +}
> +
> +static void rt5350_mac_link_up(struct phylink_config *config,
> +			    struct phy_device *phy,
> +			    unsigned int mode, phy_interface_t interface,
> +			    int speed, int duplex, bool tx_pause, bool rx_pause)
> +{
> +}

Is there any other driver that implements fixed link with phylink this
way? I know regrettably little about phylink. I'd think that mac up/down
usually would still do _something_.

> @@ -4779,6 +4801,7 @@ static int mtk_add_mac(struct mtk_eth *eth, struct device_node *np)
>  	int id, err;
>  	int txqs = 1;
>  	u32 val;
> +	const struct phylink_mac_ops *mac_ops = &mtk_phylink_ops;

nit: try to keep local variables ordered longest line to shortest

>  	if (!_id) {
>  		dev_err(eth->dev, "missing mac id\n");
> @@ -4906,9 +4929,15 @@ static int mtk_add_mac(struct mtk_eth *eth, struct device_node *np)
>  			  mac->phylink_config.supported_interfaces);
>  	}
>  
> +

nit: double new line

> +	if (MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628))
> +		mac_ops = &rt5350_phylink_ops;
> +
>  	phylink = phylink_create(&mac->phylink_config,
>  				 of_fwnode_handle(mac->of_node),
> -				 phy_mode, &mtk_phylink_ops);
> +				 phy_mode,
> +				 mac_ops);
> +

nit: please don't insert empty lines between function call and its
error check

>  	if (IS_ERR(phylink)) {
>  		err = PTR_ERR(phylink);
>  		goto free_netdev;
-- 
pw-bot: cr

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ