kernel: bump 5.15 to 5.15.157
Removed because they are upstream: generic/backport-5.15/741-v6.9-01-netfilter-flowtable-validate-pppoe-header.patch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-5.15.y&id=d06977b9a4109f8738bb276125eb6a0b772bc433 Removed because they are upstream: generic/backport-5.15/741-v6.9-02-netfilter-flowtable-incorrect-pppoe-tuple.patch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-5.15.y&id=e719b52d0c56989b0f3475a03a6d64f182c85b56 Manual adapted the following patches: generic/pending-5.15/700-netfilter-nft_flow_offload-handle-netdevice-events-f.patch generic/pending-5.15/723-net-mt7531-ensure-all-MACs-are-powered-down-before-r.patch Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
This commit is contained in:
		| @@ -1,2 +1,2 @@ | |||||||
| LINUX_VERSION-5.15 = .156 | LINUX_VERSION-5.15 = .157 | ||||||
| LINUX_KERNEL_HASH-5.15.156 = 9f0465d14c93691056f5f94de647601f94f083ad8ce2e5d306564394b13e7778 | LINUX_KERNEL_HASH-5.15.157 = aff22351d34d69a16762dcf1fd51fe228da55d4b96b67247bdd598a86cc7a414 | ||||||
|   | |||||||
| @@ -124,7 +124,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> | |||||||
|  	list_del(&dst->list); |  	list_del(&dst->list); | ||||||
|  	kfree(dst); |  	kfree(dst); | ||||||
|  } |  } | ||||||
| @@ -805,7 +809,7 @@ static int dsa_switch_setup_tag_protocol | @@ -827,7 +831,7 @@ static int dsa_switch_setup_tag_protocol | ||||||
|  	int port, err; |  	int port, err; | ||||||
|   |   | ||||||
|  	if (tag_ops->proto == dst->default_proto) |  	if (tag_ops->proto == dst->default_proto) | ||||||
| @@ -133,7 +133,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> | |||||||
|   |   | ||||||
|  	for (port = 0; port < ds->num_ports; port++) { |  	for (port = 0; port < ds->num_ports; port++) { | ||||||
|  		if (!dsa_is_cpu_port(ds, port)) |  		if (!dsa_is_cpu_port(ds, port)) | ||||||
| @@ -821,6 +825,17 @@ static int dsa_switch_setup_tag_protocol | @@ -843,6 +847,17 @@ static int dsa_switch_setup_tag_protocol | ||||||
|  		} |  		} | ||||||
|  	} |  	} | ||||||
|   |   | ||||||
| @@ -151,7 +151,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> | |||||||
|  	return 0; |  	return 0; | ||||||
|  } |  } | ||||||
|   |   | ||||||
| @@ -1132,6 +1147,46 @@ static void dsa_tree_teardown(struct dsa | @@ -1154,6 +1169,46 @@ static void dsa_tree_teardown(struct dsa | ||||||
|  	dst->setup = false; |  	dst->setup = false; | ||||||
|  } |  } | ||||||
|   |   | ||||||
| @@ -198,7 +198,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> | |||||||
|  /* Since the dsa/tagging sysfs device attribute is per master, the assumption |  /* Since the dsa/tagging sysfs device attribute is per master, the assumption | ||||||
|   * is that all DSA switches within a tree share the same tagger, otherwise |   * is that all DSA switches within a tree share the same tagger, otherwise | ||||||
|   * they would have formed disjoint trees (different "dsa,member" values). |   * they would have formed disjoint trees (different "dsa,member" values). | ||||||
| @@ -1164,12 +1219,15 @@ int dsa_tree_change_tag_proto(struct dsa | @@ -1186,12 +1241,15 @@ int dsa_tree_change_tag_proto(struct dsa | ||||||
|  			goto out_unlock; |  			goto out_unlock; | ||||||
|  	} |  	} | ||||||
|   |   | ||||||
| @@ -216,7 +216,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> | |||||||
|   |   | ||||||
|  	rtnl_unlock(); |  	rtnl_unlock(); | ||||||
|   |   | ||||||
| @@ -1257,6 +1315,7 @@ static int dsa_port_parse_cpu(struct dsa | @@ -1279,6 +1337,7 @@ static int dsa_port_parse_cpu(struct dsa | ||||||
|  	struct dsa_switch *ds = dp->ds; |  	struct dsa_switch *ds = dp->ds; | ||||||
|  	struct dsa_switch_tree *dst = ds->dst; |  	struct dsa_switch_tree *dst = ds->dst; | ||||||
|  	enum dsa_tag_protocol default_proto; |  	enum dsa_tag_protocol default_proto; | ||||||
| @@ -224,7 +224,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> | |||||||
|   |   | ||||||
|  	/* Find out which protocol the switch would prefer. */ |  	/* Find out which protocol the switch would prefer. */ | ||||||
|  	default_proto = dsa_get_tag_protocol(dp, master); |  	default_proto = dsa_get_tag_protocol(dp, master); | ||||||
| @@ -1311,6 +1370,12 @@ static int dsa_port_parse_cpu(struct dsa | @@ -1333,6 +1392,12 @@ static int dsa_port_parse_cpu(struct dsa | ||||||
|  		 */ |  		 */ | ||||||
|  		dsa_tag_driver_put(tag_ops); |  		dsa_tag_driver_put(tag_ops); | ||||||
|  	} else { |  	} else { | ||||||
|   | |||||||
| @@ -101,7 +101,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> | |||||||
|  	list_del(&dst->list); |  	list_del(&dst->list); | ||||||
|  	kfree(dst); |  	kfree(dst); | ||||||
|  } |  } | ||||||
| @@ -826,17 +822,29 @@ static int dsa_switch_setup_tag_protocol | @@ -848,17 +844,29 @@ static int dsa_switch_setup_tag_protocol | ||||||
|  	} |  	} | ||||||
|   |   | ||||||
|  connect: |  connect: | ||||||
| @@ -132,7 +132,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> | |||||||
|  } |  } | ||||||
|   |   | ||||||
|  static int dsa_switch_setup(struct dsa_switch *ds) |  static int dsa_switch_setup(struct dsa_switch *ds) | ||||||
| @@ -1156,13 +1164,6 @@ static int dsa_tree_bind_tag_proto(struc | @@ -1178,13 +1186,6 @@ static int dsa_tree_bind_tag_proto(struc | ||||||
|   |   | ||||||
|  	dst->tag_ops = tag_ops; |  	dst->tag_ops = tag_ops; | ||||||
|   |   | ||||||
| @@ -146,7 +146,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> | |||||||
|  	/* Notify the switches from this tree about the connection |  	/* Notify the switches from this tree about the connection | ||||||
|  	 * to the new tagger |  	 * to the new tagger | ||||||
|  	 */ |  	 */ | ||||||
| @@ -1172,16 +1173,14 @@ static int dsa_tree_bind_tag_proto(struc | @@ -1194,16 +1195,14 @@ static int dsa_tree_bind_tag_proto(struc | ||||||
|  		goto out_disconnect; |  		goto out_disconnect; | ||||||
|   |   | ||||||
|  	/* Notify the old tagger about the disconnection from this tree */ |  	/* Notify the old tagger about the disconnection from this tree */ | ||||||
| @@ -167,7 +167,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> | |||||||
|  	dst->tag_ops = old_tag_ops; |  	dst->tag_ops = old_tag_ops; | ||||||
|   |   | ||||||
|  	return err; |  	return err; | ||||||
| @@ -1315,7 +1314,6 @@ static int dsa_port_parse_cpu(struct dsa | @@ -1337,7 +1336,6 @@ static int dsa_port_parse_cpu(struct dsa | ||||||
|  	struct dsa_switch *ds = dp->ds; |  	struct dsa_switch *ds = dp->ds; | ||||||
|  	struct dsa_switch_tree *dst = ds->dst; |  	struct dsa_switch_tree *dst = ds->dst; | ||||||
|  	enum dsa_tag_protocol default_proto; |  	enum dsa_tag_protocol default_proto; | ||||||
| @@ -175,7 +175,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> | |||||||
|   |   | ||||||
|  	/* Find out which protocol the switch would prefer. */ |  	/* Find out which protocol the switch would prefer. */ | ||||||
|  	default_proto = dsa_get_tag_protocol(dp, master); |  	default_proto = dsa_get_tag_protocol(dp, master); | ||||||
| @@ -1370,12 +1368,6 @@ static int dsa_port_parse_cpu(struct dsa | @@ -1392,12 +1390,6 @@ static int dsa_port_parse_cpu(struct dsa | ||||||
|  		 */ |  		 */ | ||||||
|  		dsa_tag_driver_put(tag_ops); |  		dsa_tag_driver_put(tag_ops); | ||||||
|  	} else { |  	} else { | ||||||
|   | |||||||
| @@ -21,7 +21,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org> | |||||||
|  |  | ||||||
| --- a/drivers/net/dsa/mt7530.c | --- a/drivers/net/dsa/mt7530.c | ||||||
| +++ b/drivers/net/dsa/mt7530.c | +++ b/drivers/net/dsa/mt7530.c | ||||||
| @@ -1404,27 +1404,31 @@ static int | @@ -1425,27 +1425,31 @@ static int | ||||||
|  mt7530_port_bridge_join(struct dsa_switch *ds, int port, |  mt7530_port_bridge_join(struct dsa_switch *ds, int port, | ||||||
|  			struct net_device *bridge) |  			struct net_device *bridge) | ||||||
|  { |  { | ||||||
| @@ -65,7 +65,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org> | |||||||
|  	} |  	} | ||||||
|   |   | ||||||
|  	/* Add the all other ports to this port matrix. */ |  	/* Add the all other ports to this port matrix. */ | ||||||
| @@ -1529,24 +1533,28 @@ static void | @@ -1550,24 +1554,28 @@ static void | ||||||
|  mt7530_port_bridge_leave(struct dsa_switch *ds, int port, |  mt7530_port_bridge_leave(struct dsa_switch *ds, int port, | ||||||
|  			 struct net_device *bridge) |  			 struct net_device *bridge) | ||||||
|  { |  { | ||||||
|   | |||||||
| @@ -23,7 +23,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com> | |||||||
|  |  | ||||||
| --- a/drivers/net/dsa/mt7530.c | --- a/drivers/net/dsa/mt7530.c | ||||||
| +++ b/drivers/net/dsa/mt7530.c | +++ b/drivers/net/dsa/mt7530.c | ||||||
| @@ -2660,6 +2660,32 @@ mt7531_setup(struct dsa_switch *ds) | @@ -2687,6 +2687,32 @@ mt7531_setup(struct dsa_switch *ds) | ||||||
|  	return 0; |  	return 0; | ||||||
|  } |  } | ||||||
|   |   | ||||||
| @@ -56,7 +56,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com> | |||||||
|  static bool |  static bool | ||||||
|  mt7530_phy_mode_supported(struct dsa_switch *ds, int port, |  mt7530_phy_mode_supported(struct dsa_switch *ds, int port, | ||||||
|  			  const struct phylink_link_state *state) |  			  const struct phylink_link_state *state) | ||||||
| @@ -2696,6 +2722,37 @@ static bool mt7531_is_rgmii_port(struct | @@ -2723,6 +2749,37 @@ static bool mt7531_is_rgmii_port(struct | ||||||
|  	return (port == 5) && (priv->p5_intf_sel != P5_INTF_SEL_GMAC5_SGMII); |  	return (port == 5) && (priv->p5_intf_sel != P5_INTF_SEL_GMAC5_SGMII); | ||||||
|  } |  } | ||||||
|   |   | ||||||
| @@ -94,7 +94,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com> | |||||||
|  static bool |  static bool | ||||||
|  mt7531_phy_mode_supported(struct dsa_switch *ds, int port, |  mt7531_phy_mode_supported(struct dsa_switch *ds, int port, | ||||||
|  			  const struct phylink_link_state *state) |  			  const struct phylink_link_state *state) | ||||||
| @@ -3172,6 +3229,18 @@ mt7531_cpu_port_config(struct dsa_switch | @@ -3199,6 +3256,18 @@ mt7531_cpu_port_config(struct dsa_switch | ||||||
|  	return 0; |  	return 0; | ||||||
|  } |  } | ||||||
|   |   | ||||||
| @@ -113,7 +113,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com> | |||||||
|  static void |  static void | ||||||
|  mt7530_mac_port_validate(struct dsa_switch *ds, int port, |  mt7530_mac_port_validate(struct dsa_switch *ds, int port, | ||||||
|  			 unsigned long *supported) |  			 unsigned long *supported) | ||||||
| @@ -3407,6 +3476,7 @@ static const struct dsa_switch_ops mt753 | @@ -3435,6 +3504,7 @@ static const struct dsa_switch_ops mt753 | ||||||
|  	.port_vlan_del		= mt7530_port_vlan_del, |  	.port_vlan_del		= mt7530_port_vlan_del, | ||||||
|  	.port_mirror_add	= mt753x_port_mirror_add, |  	.port_mirror_add	= mt753x_port_mirror_add, | ||||||
|  	.port_mirror_del	= mt753x_port_mirror_del, |  	.port_mirror_del	= mt753x_port_mirror_del, | ||||||
| @@ -121,7 +121,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com> | |||||||
|  	.phylink_validate	= mt753x_phylink_validate, |  	.phylink_validate	= mt753x_phylink_validate, | ||||||
|  	.phylink_mac_link_state	= mt753x_phylink_mac_link_state, |  	.phylink_mac_link_state	= mt753x_phylink_mac_link_state, | ||||||
|  	.phylink_mac_config	= mt753x_phylink_mac_config, |  	.phylink_mac_config	= mt753x_phylink_mac_config, | ||||||
| @@ -3424,6 +3494,7 @@ static const struct mt753x_info mt753x_t | @@ -3452,6 +3522,7 @@ static const struct mt753x_info mt753x_t | ||||||
|  		.phy_read = mt7530_phy_read, |  		.phy_read = mt7530_phy_read, | ||||||
|  		.phy_write = mt7530_phy_write, |  		.phy_write = mt7530_phy_write, | ||||||
|  		.pad_setup = mt7530_pad_clk_setup, |  		.pad_setup = mt7530_pad_clk_setup, | ||||||
| @@ -129,7 +129,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com> | |||||||
|  		.phy_mode_supported = mt7530_phy_mode_supported, |  		.phy_mode_supported = mt7530_phy_mode_supported, | ||||||
|  		.mac_port_validate = mt7530_mac_port_validate, |  		.mac_port_validate = mt7530_mac_port_validate, | ||||||
|  		.mac_port_get_state = mt7530_phylink_mac_link_state, |  		.mac_port_get_state = mt7530_phylink_mac_link_state, | ||||||
| @@ -3435,6 +3506,7 @@ static const struct mt753x_info mt753x_t | @@ -3463,6 +3534,7 @@ static const struct mt753x_info mt753x_t | ||||||
|  		.phy_read = mt7530_phy_read, |  		.phy_read = mt7530_phy_read, | ||||||
|  		.phy_write = mt7530_phy_write, |  		.phy_write = mt7530_phy_write, | ||||||
|  		.pad_setup = mt7530_pad_clk_setup, |  		.pad_setup = mt7530_pad_clk_setup, | ||||||
| @@ -137,7 +137,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com> | |||||||
|  		.phy_mode_supported = mt7530_phy_mode_supported, |  		.phy_mode_supported = mt7530_phy_mode_supported, | ||||||
|  		.mac_port_validate = mt7530_mac_port_validate, |  		.mac_port_validate = mt7530_mac_port_validate, | ||||||
|  		.mac_port_get_state = mt7530_phylink_mac_link_state, |  		.mac_port_get_state = mt7530_phylink_mac_link_state, | ||||||
| @@ -3447,6 +3519,7 @@ static const struct mt753x_info mt753x_t | @@ -3475,6 +3547,7 @@ static const struct mt753x_info mt753x_t | ||||||
|  		.phy_write = mt7531_ind_phy_write, |  		.phy_write = mt7531_ind_phy_write, | ||||||
|  		.pad_setup = mt7531_pad_setup, |  		.pad_setup = mt7531_pad_setup, | ||||||
|  		.cpu_port_config = mt7531_cpu_port_config, |  		.cpu_port_config = mt7531_cpu_port_config, | ||||||
| @@ -145,7 +145,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com> | |||||||
|  		.phy_mode_supported = mt7531_phy_mode_supported, |  		.phy_mode_supported = mt7531_phy_mode_supported, | ||||||
|  		.mac_port_validate = mt7531_mac_port_validate, |  		.mac_port_validate = mt7531_mac_port_validate, | ||||||
|  		.mac_port_get_state = mt7531_phylink_mac_link_state, |  		.mac_port_get_state = mt7531_phylink_mac_link_state, | ||||||
| @@ -3509,6 +3582,7 @@ mt7530_probe(struct mdio_device *mdiodev | @@ -3537,6 +3610,7 @@ mt7530_probe(struct mdio_device *mdiodev | ||||||
|  	 */ |  	 */ | ||||||
|  	if (!priv->info->sw_setup || !priv->info->pad_setup || |  	if (!priv->info->sw_setup || !priv->info->pad_setup || | ||||||
|  	    !priv->info->phy_read || !priv->info->phy_write || |  	    !priv->info->phy_read || !priv->info->phy_write || | ||||||
| @@ -155,7 +155,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com> | |||||||
|  	    !priv->info->mac_port_get_state || !priv->info->mac_port_config) |  	    !priv->info->mac_port_get_state || !priv->info->mac_port_config) | ||||||
| --- a/drivers/net/dsa/mt7530.h | --- a/drivers/net/dsa/mt7530.h | ||||||
| +++ b/drivers/net/dsa/mt7530.h | +++ b/drivers/net/dsa/mt7530.h | ||||||
| @@ -801,6 +801,8 @@ struct mt753x_info { | @@ -807,6 +807,8 @@ struct mt753x_info { | ||||||
|  	int (*phy_write)(struct mt7530_priv *priv, int port, int regnum, u16 val); |  	int (*phy_write)(struct mt7530_priv *priv, int port, int regnum, u16 val); | ||||||
|  	int (*pad_setup)(struct dsa_switch *ds, phy_interface_t interface); |  	int (*pad_setup)(struct dsa_switch *ds, phy_interface_t interface); | ||||||
|  	int (*cpu_port_config)(struct dsa_switch *ds, int port); |  	int (*cpu_port_config)(struct dsa_switch *ds, int port); | ||||||
|   | |||||||
| @@ -21,7 +21,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com> | |||||||
|  |  | ||||||
| --- a/drivers/net/dsa/mt7530.c | --- a/drivers/net/dsa/mt7530.c | ||||||
| +++ b/drivers/net/dsa/mt7530.c | +++ b/drivers/net/dsa/mt7530.c | ||||||
| @@ -2686,37 +2686,6 @@ static void mt7530_mac_port_get_caps(str | @@ -2713,37 +2713,6 @@ static void mt7530_mac_port_get_caps(str | ||||||
|  	} |  	} | ||||||
|  } |  } | ||||||
|   |   | ||||||
| @@ -59,7 +59,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com> | |||||||
|  static bool mt7531_is_rgmii_port(struct mt7530_priv *priv, u32 port) |  static bool mt7531_is_rgmii_port(struct mt7530_priv *priv, u32 port) | ||||||
|  { |  { | ||||||
|  	return (port == 5) && (priv->p5_intf_sel != P5_INTF_SEL_GMAC5_SGMII); |  	return (port == 5) && (priv->p5_intf_sel != P5_INTF_SEL_GMAC5_SGMII); | ||||||
| @@ -2753,44 +2722,6 @@ static void mt7531_mac_port_get_caps(str | @@ -2780,44 +2749,6 @@ static void mt7531_mac_port_get_caps(str | ||||||
|  	} |  	} | ||||||
|  } |  } | ||||||
|   |   | ||||||
| @@ -104,7 +104,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com> | |||||||
|  static int |  static int | ||||||
|  mt753x_pad_setup(struct dsa_switch *ds, const struct phylink_link_state *state) |  mt753x_pad_setup(struct dsa_switch *ds, const struct phylink_link_state *state) | ||||||
|  { |  { | ||||||
| @@ -3045,9 +2976,6 @@ mt753x_phylink_mac_config(struct dsa_swi | @@ -3072,9 +3003,6 @@ mt753x_phylink_mac_config(struct dsa_swi | ||||||
|  	struct mt7530_priv *priv = ds->priv; |  	struct mt7530_priv *priv = ds->priv; | ||||||
|  	u32 mcr_cur, mcr_new; |  	u32 mcr_cur, mcr_new; | ||||||
|   |   | ||||||
| @@ -114,7 +114,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com> | |||||||
|  	switch (port) { |  	switch (port) { | ||||||
|  	case 0 ... 4: /* Internal phy */ |  	case 0 ... 4: /* Internal phy */ | ||||||
|  		if (state->interface != PHY_INTERFACE_MODE_GMII) |  		if (state->interface != PHY_INTERFACE_MODE_GMII) | ||||||
| @@ -3263,12 +3191,6 @@ mt753x_phylink_validate(struct dsa_switc | @@ -3290,12 +3218,6 @@ mt753x_phylink_validate(struct dsa_switc | ||||||
|  	__ETHTOOL_DECLARE_LINK_MODE_MASK(mask) = { 0, }; |  	__ETHTOOL_DECLARE_LINK_MODE_MASK(mask) = { 0, }; | ||||||
|  	struct mt7530_priv *priv = ds->priv; |  	struct mt7530_priv *priv = ds->priv; | ||||||
|   |   | ||||||
| @@ -127,7 +127,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com> | |||||||
|  	phylink_set_port_modes(mask); |  	phylink_set_port_modes(mask); | ||||||
|   |   | ||||||
|  	if (state->interface != PHY_INTERFACE_MODE_TRGMII && |  	if (state->interface != PHY_INTERFACE_MODE_TRGMII && | ||||||
| @@ -3495,7 +3417,6 @@ static const struct mt753x_info mt753x_t | @@ -3523,7 +3445,6 @@ static const struct mt753x_info mt753x_t | ||||||
|  		.phy_write = mt7530_phy_write, |  		.phy_write = mt7530_phy_write, | ||||||
|  		.pad_setup = mt7530_pad_clk_setup, |  		.pad_setup = mt7530_pad_clk_setup, | ||||||
|  		.mac_port_get_caps = mt7530_mac_port_get_caps, |  		.mac_port_get_caps = mt7530_mac_port_get_caps, | ||||||
| @@ -135,7 +135,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com> | |||||||
|  		.mac_port_validate = mt7530_mac_port_validate, |  		.mac_port_validate = mt7530_mac_port_validate, | ||||||
|  		.mac_port_get_state = mt7530_phylink_mac_link_state, |  		.mac_port_get_state = mt7530_phylink_mac_link_state, | ||||||
|  		.mac_port_config = mt7530_mac_config, |  		.mac_port_config = mt7530_mac_config, | ||||||
| @@ -3507,7 +3428,6 @@ static const struct mt753x_info mt753x_t | @@ -3535,7 +3456,6 @@ static const struct mt753x_info mt753x_t | ||||||
|  		.phy_write = mt7530_phy_write, |  		.phy_write = mt7530_phy_write, | ||||||
|  		.pad_setup = mt7530_pad_clk_setup, |  		.pad_setup = mt7530_pad_clk_setup, | ||||||
|  		.mac_port_get_caps = mt7530_mac_port_get_caps, |  		.mac_port_get_caps = mt7530_mac_port_get_caps, | ||||||
| @@ -143,7 +143,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com> | |||||||
|  		.mac_port_validate = mt7530_mac_port_validate, |  		.mac_port_validate = mt7530_mac_port_validate, | ||||||
|  		.mac_port_get_state = mt7530_phylink_mac_link_state, |  		.mac_port_get_state = mt7530_phylink_mac_link_state, | ||||||
|  		.mac_port_config = mt7530_mac_config, |  		.mac_port_config = mt7530_mac_config, | ||||||
| @@ -3520,7 +3440,6 @@ static const struct mt753x_info mt753x_t | @@ -3548,7 +3468,6 @@ static const struct mt753x_info mt753x_t | ||||||
|  		.pad_setup = mt7531_pad_setup, |  		.pad_setup = mt7531_pad_setup, | ||||||
|  		.cpu_port_config = mt7531_cpu_port_config, |  		.cpu_port_config = mt7531_cpu_port_config, | ||||||
|  		.mac_port_get_caps = mt7531_mac_port_get_caps, |  		.mac_port_get_caps = mt7531_mac_port_get_caps, | ||||||
| @@ -151,7 +151,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com> | |||||||
|  		.mac_port_validate = mt7531_mac_port_validate, |  		.mac_port_validate = mt7531_mac_port_validate, | ||||||
|  		.mac_port_get_state = mt7531_phylink_mac_link_state, |  		.mac_port_get_state = mt7531_phylink_mac_link_state, | ||||||
|  		.mac_port_config = mt7531_mac_config, |  		.mac_port_config = mt7531_mac_config, | ||||||
| @@ -3583,7 +3502,6 @@ mt7530_probe(struct mdio_device *mdiodev | @@ -3611,7 +3530,6 @@ mt7530_probe(struct mdio_device *mdiodev | ||||||
|  	if (!priv->info->sw_setup || !priv->info->pad_setup || |  	if (!priv->info->sw_setup || !priv->info->pad_setup || | ||||||
|  	    !priv->info->phy_read || !priv->info->phy_write || |  	    !priv->info->phy_read || !priv->info->phy_write || | ||||||
|  	    !priv->info->mac_port_get_caps || |  	    !priv->info->mac_port_get_caps || | ||||||
| @@ -161,7 +161,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com> | |||||||
|  		return -EINVAL; |  		return -EINVAL; | ||||||
| --- a/drivers/net/dsa/mt7530.h | --- a/drivers/net/dsa/mt7530.h | ||||||
| +++ b/drivers/net/dsa/mt7530.h | +++ b/drivers/net/dsa/mt7530.h | ||||||
| @@ -803,8 +803,6 @@ struct mt753x_info { | @@ -809,8 +809,6 @@ struct mt753x_info { | ||||||
|  	int (*cpu_port_config)(struct dsa_switch *ds, int port); |  	int (*cpu_port_config)(struct dsa_switch *ds, int port); | ||||||
|  	void (*mac_port_get_caps)(struct dsa_switch *ds, int port, |  	void (*mac_port_get_caps)(struct dsa_switch *ds, int port, | ||||||
|  				  struct phylink_config *config); |  				  struct phylink_config *config); | ||||||
|   | |||||||
| @@ -20,7 +20,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com> | |||||||
|  |  | ||||||
| --- a/drivers/net/dsa/mt7530.c | --- a/drivers/net/dsa/mt7530.c | ||||||
| +++ b/drivers/net/dsa/mt7530.c | +++ b/drivers/net/dsa/mt7530.c | ||||||
| @@ -3215,11 +3215,6 @@ mt753x_phylink_validate(struct dsa_switc | @@ -3242,11 +3242,6 @@ mt753x_phylink_validate(struct dsa_switc | ||||||
|   |   | ||||||
|  	linkmode_and(supported, supported, mask); |  	linkmode_and(supported, supported, mask); | ||||||
|  	linkmode_and(state->advertising, state->advertising, mask); |  	linkmode_and(state->advertising, state->advertising, mask); | ||||||
|   | |||||||
| @@ -23,7 +23,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com> | |||||||
|  |  | ||||||
| --- a/drivers/net/dsa/mt7530.c | --- a/drivers/net/dsa/mt7530.c | ||||||
| +++ b/drivers/net/dsa/mt7530.c | +++ b/drivers/net/dsa/mt7530.c | ||||||
| @@ -2793,12 +2793,13 @@ static int mt7531_rgmii_setup(struct mt7 | @@ -2820,12 +2820,13 @@ static int mt7531_rgmii_setup(struct mt7 | ||||||
|  } |  } | ||||||
|   |   | ||||||
|  static void mt7531_sgmii_validate(struct mt7530_priv *priv, int port, |  static void mt7531_sgmii_validate(struct mt7530_priv *priv, int port, | ||||||
| @@ -38,7 +38,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com> | |||||||
|  		phylink_set(supported, 2500baseX_Full); |  		phylink_set(supported, 2500baseX_Full); | ||||||
|  		phylink_set(supported, 2500baseT_Full); |  		phylink_set(supported, 2500baseT_Full); | ||||||
|  	} |  	} | ||||||
| @@ -3171,16 +3172,18 @@ static void mt753x_phylink_get_caps(stru | @@ -3198,16 +3199,18 @@ static void mt753x_phylink_get_caps(stru | ||||||
|   |   | ||||||
|  static void |  static void | ||||||
|  mt7530_mac_port_validate(struct dsa_switch *ds, int port, |  mt7530_mac_port_validate(struct dsa_switch *ds, int port, | ||||||
| @@ -58,7 +58,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com> | |||||||
|  } |  } | ||||||
|   |   | ||||||
|  static void |  static void | ||||||
| @@ -3203,12 +3206,13 @@ mt753x_phylink_validate(struct dsa_switc | @@ -3230,12 +3233,13 @@ mt753x_phylink_validate(struct dsa_switc | ||||||
|  	} |  	} | ||||||
|   |   | ||||||
|  	/* This switch only supports 1G full-duplex. */ |  	/* This switch only supports 1G full-duplex. */ | ||||||
| @@ -76,7 +76,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com> | |||||||
|  	phylink_set(mask, Asym_Pause); |  	phylink_set(mask, Asym_Pause); | ||||||
| --- a/drivers/net/dsa/mt7530.h | --- a/drivers/net/dsa/mt7530.h | ||||||
| +++ b/drivers/net/dsa/mt7530.h | +++ b/drivers/net/dsa/mt7530.h | ||||||
| @@ -804,6 +804,7 @@ struct mt753x_info { | @@ -810,6 +810,7 @@ struct mt753x_info { | ||||||
|  	void (*mac_port_get_caps)(struct dsa_switch *ds, int port, |  	void (*mac_port_get_caps)(struct dsa_switch *ds, int port, | ||||||
|  				  struct phylink_config *config); |  				  struct phylink_config *config); | ||||||
|  	void (*mac_port_validate)(struct dsa_switch *ds, int port, |  	void (*mac_port_validate)(struct dsa_switch *ds, int port, | ||||||
|   | |||||||
| @@ -20,7 +20,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com> | |||||||
|  |  | ||||||
| --- a/drivers/net/dsa/mt7530.c | --- a/drivers/net/dsa/mt7530.c | ||||||
| +++ b/drivers/net/dsa/mt7530.c | +++ b/drivers/net/dsa/mt7530.c | ||||||
| @@ -2792,19 +2792,6 @@ static int mt7531_rgmii_setup(struct mt7 | @@ -2819,19 +2819,6 @@ static int mt7531_rgmii_setup(struct mt7 | ||||||
|  	return 0; |  	return 0; | ||||||
|  } |  } | ||||||
|   |   | ||||||
| @@ -40,7 +40,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com> | |||||||
|  static void |  static void | ||||||
|  mt7531_sgmii_link_up_force(struct dsa_switch *ds, int port, |  mt7531_sgmii_link_up_force(struct dsa_switch *ds, int port, | ||||||
|  			   unsigned int mode, phy_interface_t interface, |  			   unsigned int mode, phy_interface_t interface, | ||||||
| @@ -3171,51 +3158,21 @@ static void mt753x_phylink_get_caps(stru | @@ -3198,51 +3185,21 @@ static void mt753x_phylink_get_caps(stru | ||||||
|  } |  } | ||||||
|   |   | ||||||
|  static void |  static void | ||||||
| @@ -97,7 +97,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com> | |||||||
|   |   | ||||||
|  	linkmode_and(supported, supported, mask); |  	linkmode_and(supported, supported, mask); | ||||||
|  	linkmode_and(state->advertising, state->advertising, mask); |  	linkmode_and(state->advertising, state->advertising, mask); | ||||||
| @@ -3416,7 +3373,6 @@ static const struct mt753x_info mt753x_t | @@ -3444,7 +3401,6 @@ static const struct mt753x_info mt753x_t | ||||||
|  		.phy_write = mt7530_phy_write, |  		.phy_write = mt7530_phy_write, | ||||||
|  		.pad_setup = mt7530_pad_clk_setup, |  		.pad_setup = mt7530_pad_clk_setup, | ||||||
|  		.mac_port_get_caps = mt7530_mac_port_get_caps, |  		.mac_port_get_caps = mt7530_mac_port_get_caps, | ||||||
| @@ -105,7 +105,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com> | |||||||
|  		.mac_port_get_state = mt7530_phylink_mac_link_state, |  		.mac_port_get_state = mt7530_phylink_mac_link_state, | ||||||
|  		.mac_port_config = mt7530_mac_config, |  		.mac_port_config = mt7530_mac_config, | ||||||
|  	}, |  	}, | ||||||
| @@ -3427,7 +3383,6 @@ static const struct mt753x_info mt753x_t | @@ -3455,7 +3411,6 @@ static const struct mt753x_info mt753x_t | ||||||
|  		.phy_write = mt7530_phy_write, |  		.phy_write = mt7530_phy_write, | ||||||
|  		.pad_setup = mt7530_pad_clk_setup, |  		.pad_setup = mt7530_pad_clk_setup, | ||||||
|  		.mac_port_get_caps = mt7530_mac_port_get_caps, |  		.mac_port_get_caps = mt7530_mac_port_get_caps, | ||||||
| @@ -113,7 +113,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com> | |||||||
|  		.mac_port_get_state = mt7530_phylink_mac_link_state, |  		.mac_port_get_state = mt7530_phylink_mac_link_state, | ||||||
|  		.mac_port_config = mt7530_mac_config, |  		.mac_port_config = mt7530_mac_config, | ||||||
|  	}, |  	}, | ||||||
| @@ -3439,7 +3394,6 @@ static const struct mt753x_info mt753x_t | @@ -3467,7 +3422,6 @@ static const struct mt753x_info mt753x_t | ||||||
|  		.pad_setup = mt7531_pad_setup, |  		.pad_setup = mt7531_pad_setup, | ||||||
|  		.cpu_port_config = mt7531_cpu_port_config, |  		.cpu_port_config = mt7531_cpu_port_config, | ||||||
|  		.mac_port_get_caps = mt7531_mac_port_get_caps, |  		.mac_port_get_caps = mt7531_mac_port_get_caps, | ||||||
| @@ -121,7 +121,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com> | |||||||
|  		.mac_port_get_state = mt7531_phylink_mac_link_state, |  		.mac_port_get_state = mt7531_phylink_mac_link_state, | ||||||
|  		.mac_port_config = mt7531_mac_config, |  		.mac_port_config = mt7531_mac_config, | ||||||
|  		.mac_pcs_an_restart = mt7531_sgmii_restart_an, |  		.mac_pcs_an_restart = mt7531_sgmii_restart_an, | ||||||
| @@ -3501,7 +3455,6 @@ mt7530_probe(struct mdio_device *mdiodev | @@ -3529,7 +3483,6 @@ mt7530_probe(struct mdio_device *mdiodev | ||||||
|  	if (!priv->info->sw_setup || !priv->info->pad_setup || |  	if (!priv->info->sw_setup || !priv->info->pad_setup || | ||||||
|  	    !priv->info->phy_read || !priv->info->phy_write || |  	    !priv->info->phy_read || !priv->info->phy_write || | ||||||
|  	    !priv->info->mac_port_get_caps || |  	    !priv->info->mac_port_get_caps || | ||||||
|   | |||||||
| @@ -33,7 +33,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com> | |||||||
|  /* String, offset, and register size in bytes if different from 4 bytes */ |  /* String, offset, and register size in bytes if different from 4 bytes */ | ||||||
|  static const struct mt7530_mib_desc mt7530_mib[] = { |  static const struct mt7530_mib_desc mt7530_mib[] = { | ||||||
|  	MIB_DESC(1, 0x00, "TxDrop"), |  	MIB_DESC(1, 0x00, "TxDrop"), | ||||||
| @@ -2792,12 +2797,11 @@ static int mt7531_rgmii_setup(struct mt7 | @@ -2819,12 +2824,11 @@ static int mt7531_rgmii_setup(struct mt7 | ||||||
|  	return 0; |  	return 0; | ||||||
|  } |  } | ||||||
|   |   | ||||||
| @@ -50,7 +50,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com> | |||||||
|  	unsigned int val; |  	unsigned int val; | ||||||
|   |   | ||||||
|  	/* For adjusting speed and duplex of SGMII force mode. */ |  	/* For adjusting speed and duplex of SGMII force mode. */ | ||||||
| @@ -2823,6 +2827,9 @@ mt7531_sgmii_link_up_force(struct dsa_sw | @@ -2850,6 +2854,9 @@ mt7531_sgmii_link_up_force(struct dsa_sw | ||||||
|   |   | ||||||
|  	/* MT7531 SGMII 1G force mode can only work in full duplex mode, |  	/* MT7531 SGMII 1G force mode can only work in full duplex mode, | ||||||
|  	 * no matter MT7531_SGMII_FORCE_HALF_DUPLEX is set or not. |  	 * no matter MT7531_SGMII_FORCE_HALF_DUPLEX is set or not. | ||||||
| @@ -60,7 +60,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com> | |||||||
|  	 */ |  	 */ | ||||||
|  	if ((speed == SPEED_10 || speed == SPEED_100) && |  	if ((speed == SPEED_10 || speed == SPEED_100) && | ||||||
|  	    duplex != DUPLEX_FULL) |  	    duplex != DUPLEX_FULL) | ||||||
| @@ -2898,9 +2905,10 @@ static int mt7531_sgmii_setup_mode_an(st | @@ -2925,9 +2932,10 @@ static int mt7531_sgmii_setup_mode_an(st | ||||||
|  	return 0; |  	return 0; | ||||||
|  } |  } | ||||||
|   |   | ||||||
| @@ -73,7 +73,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com> | |||||||
|  	u32 val; |  	u32 val; | ||||||
|   |   | ||||||
|  	/* Only restart AN when AN is enabled */ |  	/* Only restart AN when AN is enabled */ | ||||||
| @@ -2957,6 +2965,24 @@ mt753x_mac_config(struct dsa_switch *ds, | @@ -2984,6 +2992,24 @@ mt753x_mac_config(struct dsa_switch *ds, | ||||||
|  	return priv->info->mac_port_config(ds, port, mode, state->interface); |  	return priv->info->mac_port_config(ds, port, mode, state->interface); | ||||||
|  } |  } | ||||||
|   |   | ||||||
| @@ -98,7 +98,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com> | |||||||
|  static void |  static void | ||||||
|  mt753x_phylink_mac_config(struct dsa_switch *ds, int port, unsigned int mode, |  mt753x_phylink_mac_config(struct dsa_switch *ds, int port, unsigned int mode, | ||||||
|  			  const struct phylink_link_state *state) |  			  const struct phylink_link_state *state) | ||||||
| @@ -3018,17 +3044,6 @@ unsupported: | @@ -3045,17 +3071,6 @@ unsupported: | ||||||
|  		mt7530_write(priv, MT7530_PMCR_P(port), mcr_new); |  		mt7530_write(priv, MT7530_PMCR_P(port), mcr_new); | ||||||
|  } |  } | ||||||
|   |   | ||||||
| @@ -116,7 +116,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com> | |||||||
|  static void mt753x_phylink_mac_link_down(struct dsa_switch *ds, int port, |  static void mt753x_phylink_mac_link_down(struct dsa_switch *ds, int port, | ||||||
|  					 unsigned int mode, |  					 unsigned int mode, | ||||||
|  					 phy_interface_t interface) |  					 phy_interface_t interface) | ||||||
| @@ -3038,16 +3053,13 @@ static void mt753x_phylink_mac_link_down | @@ -3065,16 +3080,13 @@ static void mt753x_phylink_mac_link_down | ||||||
|  	mt7530_clear(priv, MT7530_PMCR_P(port), PMCR_LINK_SETTINGS_MASK); |  	mt7530_clear(priv, MT7530_PMCR_P(port), PMCR_LINK_SETTINGS_MASK); | ||||||
|  } |  } | ||||||
|   |   | ||||||
| @@ -139,7 +139,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com> | |||||||
|  } |  } | ||||||
|   |   | ||||||
|  static void mt753x_phylink_mac_link_up(struct dsa_switch *ds, int port, |  static void mt753x_phylink_mac_link_up(struct dsa_switch *ds, int port, | ||||||
| @@ -3060,8 +3072,6 @@ static void mt753x_phylink_mac_link_up(s | @@ -3087,8 +3099,6 @@ static void mt753x_phylink_mac_link_up(s | ||||||
|  	struct mt7530_priv *priv = ds->priv; |  	struct mt7530_priv *priv = ds->priv; | ||||||
|  	u32 mcr; |  	u32 mcr; | ||||||
|   |   | ||||||
| @@ -148,7 +148,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com> | |||||||
|  	mcr = PMCR_RX_EN | PMCR_TX_EN | PMCR_FORCE_LNK; |  	mcr = PMCR_RX_EN | PMCR_TX_EN | PMCR_FORCE_LNK; | ||||||
|   |   | ||||||
|  	/* MT753x MAC works in 1G full duplex mode for all up-clocked |  	/* MT753x MAC works in 1G full duplex mode for all up-clocked | ||||||
| @@ -3139,6 +3149,8 @@ mt7531_cpu_port_config(struct dsa_switch | @@ -3166,6 +3176,8 @@ mt7531_cpu_port_config(struct dsa_switch | ||||||
|  		return ret; |  		return ret; | ||||||
|  	mt7530_write(priv, MT7530_PMCR_P(port), |  	mt7530_write(priv, MT7530_PMCR_P(port), | ||||||
|  		     PMCR_CPU_PORT_SETTING(priv->id)); |  		     PMCR_CPU_PORT_SETTING(priv->id)); | ||||||
| @@ -157,7 +157,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com> | |||||||
|  	mt753x_phylink_mac_link_up(ds, port, MLO_AN_FIXED, interface, NULL, |  	mt753x_phylink_mac_link_up(ds, port, MLO_AN_FIXED, interface, NULL, | ||||||
|  				   speed, DUPLEX_FULL, true, true); |  				   speed, DUPLEX_FULL, true, true); | ||||||
|   |   | ||||||
| @@ -3178,16 +3190,13 @@ mt753x_phylink_validate(struct dsa_switc | @@ -3205,16 +3217,13 @@ mt753x_phylink_validate(struct dsa_switc | ||||||
|  	linkmode_and(state->advertising, state->advertising, mask); |  	linkmode_and(state->advertising, state->advertising, mask); | ||||||
|  } |  } | ||||||
|   |   | ||||||
| @@ -178,7 +178,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com> | |||||||
|  	pmsr = mt7530_read(priv, MT7530_PMSR_P(port)); |  	pmsr = mt7530_read(priv, MT7530_PMSR_P(port)); | ||||||
|   |   | ||||||
|  	state->link = (pmsr & PMSR_LINK); |  	state->link = (pmsr & PMSR_LINK); | ||||||
| @@ -3214,8 +3223,6 @@ mt7530_phylink_mac_link_state(struct dsa | @@ -3241,8 +3250,6 @@ mt7530_phylink_mac_link_state(struct dsa | ||||||
|  		state->pause |= MLO_PAUSE_RX; |  		state->pause |= MLO_PAUSE_RX; | ||||||
|  	if (pmsr & PMSR_TX_FC) |  	if (pmsr & PMSR_TX_FC) | ||||||
|  		state->pause |= MLO_PAUSE_TX; |  		state->pause |= MLO_PAUSE_TX; | ||||||
| @@ -187,7 +187,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com> | |||||||
|  } |  } | ||||||
|   |   | ||||||
|  static int |  static int | ||||||
| @@ -3257,32 +3264,49 @@ mt7531_sgmii_pcs_get_state_an(struct mt7 | @@ -3284,32 +3291,49 @@ mt7531_sgmii_pcs_get_state_an(struct mt7 | ||||||
|  	return 0; |  	return 0; | ||||||
|  } |  } | ||||||
|   |   | ||||||
| @@ -249,7 +249,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com> | |||||||
|   |   | ||||||
|  	if (ret) |  	if (ret) | ||||||
|  		return ret; |  		return ret; | ||||||
| @@ -3295,6 +3319,13 @@ mt753x_setup(struct dsa_switch *ds) | @@ -3322,6 +3346,13 @@ mt753x_setup(struct dsa_switch *ds) | ||||||
|  	if (ret && priv->irq) |  	if (ret && priv->irq) | ||||||
|  		mt7530_free_irq_common(priv); |  		mt7530_free_irq_common(priv); | ||||||
|   |   | ||||||
| @@ -263,7 +263,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com> | |||||||
|  	return ret; |  	return ret; | ||||||
|  } |  } | ||||||
|   |   | ||||||
| @@ -3356,9 +3387,8 @@ static const struct dsa_switch_ops mt753 | @@ -3384,9 +3415,8 @@ static const struct dsa_switch_ops mt753 | ||||||
|  	.port_mirror_del	= mt753x_port_mirror_del, |  	.port_mirror_del	= mt753x_port_mirror_del, | ||||||
|  	.phylink_get_caps	= mt753x_phylink_get_caps, |  	.phylink_get_caps	= mt753x_phylink_get_caps, | ||||||
|  	.phylink_validate	= mt753x_phylink_validate, |  	.phylink_validate	= mt753x_phylink_validate, | ||||||
| @@ -274,7 +274,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com> | |||||||
|  	.phylink_mac_link_down	= mt753x_phylink_mac_link_down, |  	.phylink_mac_link_down	= mt753x_phylink_mac_link_down, | ||||||
|  	.phylink_mac_link_up	= mt753x_phylink_mac_link_up, |  	.phylink_mac_link_up	= mt753x_phylink_mac_link_up, | ||||||
|  	.get_mac_eee		= mt753x_get_mac_eee, |  	.get_mac_eee		= mt753x_get_mac_eee, | ||||||
| @@ -3368,36 +3398,34 @@ static const struct dsa_switch_ops mt753 | @@ -3396,36 +3426,34 @@ static const struct dsa_switch_ops mt753 | ||||||
|  static const struct mt753x_info mt753x_table[] = { |  static const struct mt753x_info mt753x_table[] = { | ||||||
|  	[ID_MT7621] = { |  	[ID_MT7621] = { | ||||||
|  		.id = ID_MT7621, |  		.id = ID_MT7621, | ||||||
| @@ -314,7 +314,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com> | |||||||
|  	}, |  	}, | ||||||
|  }; |  }; | ||||||
|   |   | ||||||
| @@ -3455,7 +3483,7 @@ mt7530_probe(struct mdio_device *mdiodev | @@ -3483,7 +3511,7 @@ mt7530_probe(struct mdio_device *mdiodev | ||||||
|  	if (!priv->info->sw_setup || !priv->info->pad_setup || |  	if (!priv->info->sw_setup || !priv->info->pad_setup || | ||||||
|  	    !priv->info->phy_read || !priv->info->phy_write || |  	    !priv->info->phy_read || !priv->info->phy_write || | ||||||
|  	    !priv->info->mac_port_get_caps || |  	    !priv->info->mac_port_get_caps || | ||||||
| @@ -325,7 +325,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com> | |||||||
|  	priv->id = priv->info->id; |  	priv->id = priv->info->id; | ||||||
| --- a/drivers/net/dsa/mt7530.h | --- a/drivers/net/dsa/mt7530.h | ||||||
| +++ b/drivers/net/dsa/mt7530.h | +++ b/drivers/net/dsa/mt7530.h | ||||||
| @@ -773,6 +773,12 @@ static const char *p5_intf_modes(unsigne | @@ -779,6 +779,12 @@ static const char *p5_intf_modes(unsigne | ||||||
|   |   | ||||||
|  struct mt7530_priv; |  struct mt7530_priv; | ||||||
|   |   | ||||||
| @@ -338,7 +338,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com> | |||||||
|  /* struct mt753x_info -	This is the main data structure for holding the specific |  /* struct mt753x_info -	This is the main data structure for holding the specific | ||||||
|   *			part for each supported device |   *			part for each supported device | ||||||
|   * @sw_setup:		Holding the handler to a device initialization |   * @sw_setup:		Holding the handler to a device initialization | ||||||
| @@ -784,18 +790,14 @@ struct mt7530_priv; | @@ -790,18 +796,14 @@ struct mt7530_priv; | ||||||
|   *			port |   *			port | ||||||
|   * @mac_port_validate:	Holding the way to set addition validate type for a |   * @mac_port_validate:	Holding the way to set addition validate type for a | ||||||
|   *			certan MAC port |   *			certan MAC port | ||||||
| @@ -359,7 +359,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com> | |||||||
|  	int (*sw_setup)(struct dsa_switch *ds); |  	int (*sw_setup)(struct dsa_switch *ds); | ||||||
|  	int (*phy_read)(struct mt7530_priv *priv, int port, int regnum); |  	int (*phy_read)(struct mt7530_priv *priv, int port, int regnum); | ||||||
|  	int (*phy_write)(struct mt7530_priv *priv, int port, int regnum, u16 val); |  	int (*phy_write)(struct mt7530_priv *priv, int port, int regnum, u16 val); | ||||||
| @@ -806,15 +808,9 @@ struct mt753x_info { | @@ -812,15 +814,9 @@ struct mt753x_info { | ||||||
|  	void (*mac_port_validate)(struct dsa_switch *ds, int port, |  	void (*mac_port_validate)(struct dsa_switch *ds, int port, | ||||||
|  				  phy_interface_t interface, |  				  phy_interface_t interface, | ||||||
|  				  unsigned long *supported); |  				  unsigned long *supported); | ||||||
| @@ -375,7 +375,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com> | |||||||
|  }; |  }; | ||||||
|   |   | ||||||
|  /* struct mt7530_priv -	This is the main data structure for holding the state |  /* struct mt7530_priv -	This is the main data structure for holding the state | ||||||
| @@ -856,6 +852,7 @@ struct mt7530_priv { | @@ -862,6 +858,7 @@ struct mt7530_priv { | ||||||
|  	u8			mirror_tx; |  	u8			mirror_tx; | ||||||
|   |   | ||||||
|  	struct mt7530_port	ports[MT7530_NUM_PORTS]; |  	struct mt7530_port	ports[MT7530_NUM_PORTS]; | ||||||
|   | |||||||
| @@ -20,7 +20,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com> | |||||||
|  |  | ||||||
| --- a/drivers/net/dsa/mt7530.c | --- a/drivers/net/dsa/mt7530.c | ||||||
| +++ b/drivers/net/dsa/mt7530.c | +++ b/drivers/net/dsa/mt7530.c | ||||||
| @@ -3169,25 +3169,16 @@ static void mt753x_phylink_get_caps(stru | @@ -3196,25 +3196,16 @@ static void mt753x_phylink_get_caps(stru | ||||||
|  	priv->info->mac_port_get_caps(ds, port, config); |  	priv->info->mac_port_get_caps(ds, port, config); | ||||||
|  } |  } | ||||||
|   |   | ||||||
| @@ -55,7 +55,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com> | |||||||
|  } |  } | ||||||
|   |   | ||||||
|  static void mt7530_pcs_get_state(struct phylink_pcs *pcs, |  static void mt7530_pcs_get_state(struct phylink_pcs *pcs, | ||||||
| @@ -3289,12 +3280,14 @@ static void mt7530_pcs_an_restart(struct | @@ -3316,12 +3307,14 @@ static void mt7530_pcs_an_restart(struct | ||||||
|  } |  } | ||||||
|   |   | ||||||
|  static const struct phylink_pcs_ops mt7530_pcs_ops = { |  static const struct phylink_pcs_ops mt7530_pcs_ops = { | ||||||
| @@ -70,7 +70,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com> | |||||||
|  	.pcs_get_state = mt7531_pcs_get_state, |  	.pcs_get_state = mt7531_pcs_get_state, | ||||||
|  	.pcs_config = mt753x_pcs_config, |  	.pcs_config = mt753x_pcs_config, | ||||||
|  	.pcs_an_restart = mt7531_pcs_an_restart, |  	.pcs_an_restart = mt7531_pcs_an_restart, | ||||||
| @@ -3386,7 +3379,6 @@ static const struct dsa_switch_ops mt753 | @@ -3414,7 +3407,6 @@ static const struct dsa_switch_ops mt753 | ||||||
|  	.port_mirror_add	= mt753x_port_mirror_add, |  	.port_mirror_add	= mt753x_port_mirror_add, | ||||||
|  	.port_mirror_del	= mt753x_port_mirror_del, |  	.port_mirror_del	= mt753x_port_mirror_del, | ||||||
|  	.phylink_get_caps	= mt753x_phylink_get_caps, |  	.phylink_get_caps	= mt753x_phylink_get_caps, | ||||||
|   | |||||||
| @@ -19,7 +19,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com> | |||||||
|  |  | ||||||
| --- a/drivers/net/dsa/mt7530.c | --- a/drivers/net/dsa/mt7530.c | ||||||
| +++ b/drivers/net/dsa/mt7530.c | +++ b/drivers/net/dsa/mt7530.c | ||||||
| @@ -3166,6 +3166,12 @@ static void mt753x_phylink_get_caps(stru | @@ -3193,6 +3193,12 @@ static void mt753x_phylink_get_caps(stru | ||||||
|  	config->mac_capabilities = MAC_ASYM_PAUSE | MAC_SYM_PAUSE | |  	config->mac_capabilities = MAC_ASYM_PAUSE | MAC_SYM_PAUSE | | ||||||
|  				   MAC_10 | MAC_100 | MAC_1000FD; |  				   MAC_10 | MAC_100 | MAC_1000FD; | ||||||
|   |   | ||||||
|   | |||||||
| @@ -81,7 +81,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org> | |||||||
|  |  | ||||||
| --- a/drivers/net/dsa/mt7530.c | --- a/drivers/net/dsa/mt7530.c | ||||||
| +++ b/drivers/net/dsa/mt7530.c | +++ b/drivers/net/dsa/mt7530.c | ||||||
| @@ -3304,9 +3304,16 @@ static int | @@ -3331,9 +3331,16 @@ static int | ||||||
|  mt753x_setup(struct dsa_switch *ds) |  mt753x_setup(struct dsa_switch *ds) | ||||||
|  { |  { | ||||||
|  	struct mt7530_priv *priv = ds->priv; |  	struct mt7530_priv *priv = ds->priv; | ||||||
| @@ -100,7 +100,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org> | |||||||
|  	if (ret) |  	if (ret) | ||||||
|  		return ret; |  		return ret; | ||||||
|   |   | ||||||
| @@ -3318,13 +3325,6 @@ mt753x_setup(struct dsa_switch *ds) | @@ -3345,13 +3352,6 @@ mt753x_setup(struct dsa_switch *ds) | ||||||
|  	if (ret && priv->irq) |  	if (ret && priv->irq) | ||||||
|  		mt7530_free_irq_common(priv); |  		mt7530_free_irq_common(priv); | ||||||
|   |   | ||||||
|   | |||||||
| @@ -26,7 +26,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org> | |||||||
|  |  | ||||||
| --- a/drivers/net/dsa/mt7530.c | --- a/drivers/net/dsa/mt7530.c | ||||||
| +++ b/drivers/net/dsa/mt7530.c | +++ b/drivers/net/dsa/mt7530.c | ||||||
| @@ -1750,11 +1750,11 @@ static void | @@ -1771,11 +1771,11 @@ static void | ||||||
|  mt7530_hw_vlan_add(struct mt7530_priv *priv, |  mt7530_hw_vlan_add(struct mt7530_priv *priv, | ||||||
|  		   struct mt7530_hw_vlan_entry *entry) |  		   struct mt7530_hw_vlan_entry *entry) | ||||||
|  { |  { | ||||||
| @@ -40,7 +40,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org> | |||||||
|   |   | ||||||
|  	/* Validate the entry with independent learning, create egress tag per |  	/* Validate the entry with independent learning, create egress tag per | ||||||
|  	 * VLAN and joining the port as one of the port members. |  	 * VLAN and joining the port as one of the port members. | ||||||
| @@ -1765,22 +1765,20 @@ mt7530_hw_vlan_add(struct mt7530_priv *p | @@ -1786,22 +1786,20 @@ mt7530_hw_vlan_add(struct mt7530_priv *p | ||||||
|   |   | ||||||
|  	/* Decide whether adding tag or not for those outgoing packets from the |  	/* Decide whether adding tag or not for those outgoing packets from the | ||||||
|  	 * port inside the VLAN. |  	 * port inside the VLAN. | ||||||
| @@ -72,7 +72,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org> | |||||||
|  } |  } | ||||||
|   |   | ||||||
|  static void |  static void | ||||||
| @@ -1799,11 +1797,7 @@ mt7530_hw_vlan_del(struct mt7530_priv *p | @@ -1820,11 +1818,7 @@ mt7530_hw_vlan_del(struct mt7530_priv *p | ||||||
|  		return; |  		return; | ||||||
|  	} |  	} | ||||||
|   |   | ||||||
|   | |||||||
| @@ -21,7 +21,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org> | |||||||
|  |  | ||||||
| --- a/drivers/net/dsa/mt7530.c | --- a/drivers/net/dsa/mt7530.c | ||||||
| +++ b/drivers/net/dsa/mt7530.c | +++ b/drivers/net/dsa/mt7530.c | ||||||
| @@ -1254,6 +1254,7 @@ static int | @@ -1275,6 +1275,7 @@ static int | ||||||
|  mt7530_port_enable(struct dsa_switch *ds, int port, |  mt7530_port_enable(struct dsa_switch *ds, int port, | ||||||
|  		   struct phy_device *phy) |  		   struct phy_device *phy) | ||||||
|  { |  { | ||||||
| @@ -29,7 +29,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org> | |||||||
|  	struct mt7530_priv *priv = ds->priv; |  	struct mt7530_priv *priv = ds->priv; | ||||||
|   |   | ||||||
|  	mutex_lock(&priv->reg_mutex); |  	mutex_lock(&priv->reg_mutex); | ||||||
| @@ -1262,7 +1263,11 @@ mt7530_port_enable(struct dsa_switch *ds | @@ -1283,7 +1284,11 @@ mt7530_port_enable(struct dsa_switch *ds | ||||||
|  	 * restore the port matrix if the port is the member of a certain |  	 * restore the port matrix if the port is the member of a certain | ||||||
|  	 * bridge. |  	 * bridge. | ||||||
|  	 */ |  	 */ | ||||||
| @@ -42,7 +42,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org> | |||||||
|  	priv->ports[port].enable = true; |  	priv->ports[port].enable = true; | ||||||
|  	mt7530_rmw(priv, MT7530_PCR_P(port), PCR_MATRIX_MASK, |  	mt7530_rmw(priv, MT7530_PCR_P(port), PCR_MATRIX_MASK, | ||||||
|  		   priv->ports[port].pm); |  		   priv->ports[port].pm); | ||||||
| @@ -1410,7 +1415,8 @@ mt7530_port_bridge_join(struct dsa_switc | @@ -1431,7 +1436,8 @@ mt7530_port_bridge_join(struct dsa_switc | ||||||
|  			struct net_device *bridge) |  			struct net_device *bridge) | ||||||
|  { |  { | ||||||
|  	struct dsa_port *dp = dsa_to_port(ds, port), *other_dp; |  	struct dsa_port *dp = dsa_to_port(ds, port), *other_dp; | ||||||
| @@ -52,7 +52,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org> | |||||||
|  	struct mt7530_priv *priv = ds->priv; |  	struct mt7530_priv *priv = ds->priv; | ||||||
|   |   | ||||||
|  	mutex_lock(&priv->reg_mutex); |  	mutex_lock(&priv->reg_mutex); | ||||||
| @@ -1487,9 +1493,12 @@ mt7530_port_set_vlan_unaware(struct dsa_ | @@ -1508,9 +1514,12 @@ mt7530_port_set_vlan_unaware(struct dsa_ | ||||||
|  	 * the CPU port get out of VLAN filtering mode. |  	 * the CPU port get out of VLAN filtering mode. | ||||||
|  	 */ |  	 */ | ||||||
|  	if (all_user_ports_removed) { |  	if (all_user_ports_removed) { | ||||||
| @@ -67,7 +67,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org> | |||||||
|  			     | PVC_EG_TAG(MT7530_VLAN_EG_CONSISTENT)); |  			     | PVC_EG_TAG(MT7530_VLAN_EG_CONSISTENT)); | ||||||
|  	} |  	} | ||||||
|  } |  } | ||||||
| @@ -1539,6 +1548,7 @@ mt7530_port_bridge_leave(struct dsa_swit | @@ -1560,6 +1569,7 @@ mt7530_port_bridge_leave(struct dsa_swit | ||||||
|  			 struct net_device *bridge) |  			 struct net_device *bridge) | ||||||
|  { |  { | ||||||
|  	struct dsa_port *dp = dsa_to_port(ds, port), *other_dp; |  	struct dsa_port *dp = dsa_to_port(ds, port), *other_dp; | ||||||
| @@ -75,7 +75,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org> | |||||||
|  	struct mt7530_priv *priv = ds->priv; |  	struct mt7530_priv *priv = ds->priv; | ||||||
|   |   | ||||||
|  	mutex_lock(&priv->reg_mutex); |  	mutex_lock(&priv->reg_mutex); | ||||||
| @@ -1567,8 +1577,8 @@ mt7530_port_bridge_leave(struct dsa_swit | @@ -1588,8 +1598,8 @@ mt7530_port_bridge_leave(struct dsa_swit | ||||||
|  	 */ |  	 */ | ||||||
|  	if (priv->ports[port].enable) |  	if (priv->ports[port].enable) | ||||||
|  		mt7530_rmw(priv, MT7530_PCR_P(port), PCR_MATRIX_MASK, |  		mt7530_rmw(priv, MT7530_PCR_P(port), PCR_MATRIX_MASK, | ||||||
| @@ -86,7 +86,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org> | |||||||
|   |   | ||||||
|  	/* When a port is removed from the bridge, the port would be set up |  	/* When a port is removed from the bridge, the port would be set up | ||||||
|  	 * back to the default as is at initial boot which is a VLAN-unaware |  	 * back to the default as is at initial boot which is a VLAN-unaware | ||||||
| @@ -1731,6 +1741,9 @@ static int | @@ -1752,6 +1762,9 @@ static int | ||||||
|  mt7530_port_vlan_filtering(struct dsa_switch *ds, int port, bool vlan_filtering, |  mt7530_port_vlan_filtering(struct dsa_switch *ds, int port, bool vlan_filtering, | ||||||
|  			   struct netlink_ext_ack *extack) |  			   struct netlink_ext_ack *extack) | ||||||
|  { |  { | ||||||
| @@ -96,7 +96,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org> | |||||||
|  	if (vlan_filtering) { |  	if (vlan_filtering) { | ||||||
|  		/* The port is being kept as VLAN-unaware port when bridge is |  		/* The port is being kept as VLAN-unaware port when bridge is | ||||||
|  		 * set up with vlan_filtering not being set, Otherwise, the |  		 * set up with vlan_filtering not being set, Otherwise, the | ||||||
| @@ -1738,7 +1751,7 @@ mt7530_port_vlan_filtering(struct dsa_sw | @@ -1759,7 +1772,7 @@ mt7530_port_vlan_filtering(struct dsa_sw | ||||||
|  		 * for becoming a VLAN-aware port. |  		 * for becoming a VLAN-aware port. | ||||||
|  		 */ |  		 */ | ||||||
|  		mt7530_port_set_vlan_aware(ds, port); |  		mt7530_port_set_vlan_aware(ds, port); | ||||||
|   | |||||||
| @@ -1,85 +0,0 @@ | |||||||
| From: Pablo Neira Ayuso <pablo@netfilter.org> |  | ||||||
| Date: Thu, 11 Apr 2024 13:28:59 +0200 |  | ||||||
| Subject: [PATCH] netfilter: flowtable: validate pppoe header |  | ||||||
|  |  | ||||||
| Ensure there is sufficient room to access the protocol field of the |  | ||||||
| PPPoe header. Validate it once before the flowtable lookup, then use a |  | ||||||
| helper function to access protocol field. |  | ||||||
|  |  | ||||||
| Reported-by: syzbot+b6f07e1c07ef40199081@syzkaller.appspotmail.com |  | ||||||
| Fixes: 72efd585f714 ("netfilter: flowtable: add pppoe support") |  | ||||||
| Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> |  | ||||||
| --- |  | ||||||
|  |  | ||||||
| --- a/include/net/netfilter/nf_flow_table.h |  | ||||||
| +++ b/include/net/netfilter/nf_flow_table.h |  | ||||||
| @@ -318,7 +318,7 @@ int nf_flow_rule_route_ipv6(struct net * |  | ||||||
|  int nf_flow_table_offload_init(void); |  | ||||||
|  void nf_flow_table_offload_exit(void); |  | ||||||
|   |  | ||||||
| -static inline __be16 nf_flow_pppoe_proto(const struct sk_buff *skb) |  | ||||||
| +static inline __be16 __nf_flow_pppoe_proto(const struct sk_buff *skb) |  | ||||||
|  { |  | ||||||
|  	__be16 proto; |  | ||||||
|   |  | ||||||
| @@ -334,4 +334,14 @@ static inline __be16 nf_flow_pppoe_proto |  | ||||||
|  	return 0; |  | ||||||
|  } |  | ||||||
|   |  | ||||||
| +static inline bool nf_flow_pppoe_proto(struct sk_buff *skb, __be16 *inner_proto) |  | ||||||
| +{ |  | ||||||
| +	if (!pskb_may_pull(skb, PPPOE_SES_HLEN)) |  | ||||||
| +		return false; |  | ||||||
| + |  | ||||||
| +	*inner_proto = __nf_flow_pppoe_proto(skb); |  | ||||||
| + |  | ||||||
| +	return true; |  | ||||||
| +} |  | ||||||
| + |  | ||||||
|  #endif /* _NF_FLOW_TABLE_H */ |  | ||||||
| --- a/net/netfilter/nf_flow_table_inet.c |  | ||||||
| +++ b/net/netfilter/nf_flow_table_inet.c |  | ||||||
| @@ -21,7 +21,8 @@ nf_flow_offload_inet_hook(void *priv, st |  | ||||||
|  		proto = veth->h_vlan_encapsulated_proto; |  | ||||||
|  		break; |  | ||||||
|  	case htons(ETH_P_PPP_SES): |  | ||||||
| -		proto = nf_flow_pppoe_proto(skb); |  | ||||||
| +		if (!nf_flow_pppoe_proto(skb, &proto)) |  | ||||||
| +			return NF_ACCEPT; |  | ||||||
|  		break; |  | ||||||
|  	default: |  | ||||||
|  		proto = skb->protocol; |  | ||||||
| --- a/net/netfilter/nf_flow_table_ip.c |  | ||||||
| +++ b/net/netfilter/nf_flow_table_ip.c |  | ||||||
| @@ -246,10 +246,11 @@ static unsigned int nf_flow_xmit_xfrm(st |  | ||||||
|  	return NF_STOLEN; |  | ||||||
|  } |  | ||||||
|   |  | ||||||
| -static bool nf_flow_skb_encap_protocol(const struct sk_buff *skb, __be16 proto, |  | ||||||
| +static bool nf_flow_skb_encap_protocol(struct sk_buff *skb, __be16 proto, |  | ||||||
|  				       u32 *offset) |  | ||||||
|  { |  | ||||||
|  	struct vlan_ethhdr *veth; |  | ||||||
| +	__be16 inner_proto; |  | ||||||
|   |  | ||||||
|  	switch (skb->protocol) { |  | ||||||
|  	case htons(ETH_P_8021Q): |  | ||||||
| @@ -260,7 +261,8 @@ static bool nf_flow_skb_encap_protocol(c |  | ||||||
|  		} |  | ||||||
|  		break; |  | ||||||
|  	case htons(ETH_P_PPP_SES): |  | ||||||
| -		if (nf_flow_pppoe_proto(skb) == proto) { |  | ||||||
| +		if (nf_flow_pppoe_proto(skb, &inner_proto) && |  | ||||||
| +		    inner_proto == proto) { |  | ||||||
|  			*offset += PPPOE_SES_HLEN; |  | ||||||
|  			return true; |  | ||||||
|  		} |  | ||||||
| @@ -289,7 +291,7 @@ static void nf_flow_encap_pop(struct sk_ |  | ||||||
|  			skb_reset_network_header(skb); |  | ||||||
|  			break; |  | ||||||
|  		case htons(ETH_P_PPP_SES): |  | ||||||
| -			skb->protocol = nf_flow_pppoe_proto(skb); |  | ||||||
| +			skb->protocol = __nf_flow_pppoe_proto(skb); |  | ||||||
|  			skb_pull(skb, PPPOE_SES_HLEN); |  | ||||||
|  			skb_reset_network_header(skb); |  | ||||||
|  			break; |  | ||||||
| @@ -1,24 +0,0 @@ | |||||||
| From: Pablo Neira Ayuso <pablo@netfilter.org> |  | ||||||
| Date: Thu, 11 Apr 2024 13:29:00 +0200 |  | ||||||
| Subject: [PATCH] netfilter: flowtable: incorrect pppoe tuple |  | ||||||
|  |  | ||||||
| pppoe traffic reaching ingress path does not match the flowtable entry |  | ||||||
| because the pppoe header is expected to be at the network header offset. |  | ||||||
| This bug causes a mismatch in the flow table lookup, so pppoe packets |  | ||||||
| enter the classical forwarding path. |  | ||||||
|  |  | ||||||
| Fixes: 72efd585f714 ("netfilter: flowtable: add pppoe support") |  | ||||||
| Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> |  | ||||||
| --- |  | ||||||
|  |  | ||||||
| --- a/net/netfilter/nf_flow_table_ip.c |  | ||||||
| +++ b/net/netfilter/nf_flow_table_ip.c |  | ||||||
| @@ -156,7 +156,7 @@ static void nf_flow_tuple_encap(struct s |  | ||||||
|  		tuple->encap[i].proto = skb->protocol; |  | ||||||
|  		break; |  | ||||||
|  	case htons(ETH_P_PPP_SES): |  | ||||||
| -		phdr = (struct pppoe_hdr *)skb_mac_header(skb); |  | ||||||
| +		phdr = (struct pppoe_hdr *)skb_network_header(skb); |  | ||||||
|  		tuple->encap[i].id = ntohs(phdr->sid); |  | ||||||
|  		tuple->encap[i].proto = skb->protocol; |  | ||||||
|  		break; |  | ||||||
| @@ -30,7 +30,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> | |||||||
|  |  | ||||||
| --- a/net/dsa/dsa2.c | --- a/net/dsa/dsa2.c | ||||||
| +++ b/net/dsa/dsa2.c | +++ b/net/dsa/dsa2.c | ||||||
| @@ -1034,6 +1034,8 @@ static int dsa_tree_setup_master(struct | @@ -1056,6 +1056,8 @@ static int dsa_tree_setup_master(struct | ||||||
|  	struct dsa_port *dp; |  	struct dsa_port *dp; | ||||||
|  	int err; |  	int err; | ||||||
|   |   | ||||||
| @@ -39,7 +39,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> | |||||||
|  	list_for_each_entry(dp, &dst->ports, list) { |  	list_for_each_entry(dp, &dst->ports, list) { | ||||||
|  		if (dsa_port_is_cpu(dp)) { |  		if (dsa_port_is_cpu(dp)) { | ||||||
|  			err = dsa_master_setup(dp->master, dp); |  			err = dsa_master_setup(dp->master, dp); | ||||||
| @@ -1042,6 +1044,8 @@ static int dsa_tree_setup_master(struct | @@ -1064,6 +1066,8 @@ static int dsa_tree_setup_master(struct | ||||||
|  		} |  		} | ||||||
|  	} |  	} | ||||||
|   |   | ||||||
| @@ -48,7 +48,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> | |||||||
|  	return 0; |  	return 0; | ||||||
|  } |  } | ||||||
|   |   | ||||||
| @@ -1049,9 +1053,13 @@ static void dsa_tree_teardown_master(str | @@ -1071,9 +1075,13 @@ static void dsa_tree_teardown_master(str | ||||||
|  { |  { | ||||||
|  	struct dsa_port *dp; |  	struct dsa_port *dp; | ||||||
|   |   | ||||||
|   | |||||||
| @@ -27,7 +27,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> | |||||||
|  |  | ||||||
| --- a/net/dsa/dsa2.c | --- a/net/dsa/dsa2.c | ||||||
| +++ b/net/dsa/dsa2.c | +++ b/net/dsa/dsa2.c | ||||||
| @@ -999,23 +999,28 @@ static void dsa_tree_teardown_switches(s | @@ -1021,23 +1021,28 @@ static void dsa_tree_teardown_switches(s | ||||||
|  		dsa_switch_teardown(dp->ds); |  		dsa_switch_teardown(dp->ds); | ||||||
|  } |  } | ||||||
|   |   | ||||||
| @@ -66,7 +66,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> | |||||||
|  		} |  		} | ||||||
|  	} |  	} | ||||||
|   |   | ||||||
| @@ -1024,7 +1029,21 @@ static int dsa_tree_setup_switches(struc | @@ -1046,7 +1051,21 @@ static int dsa_tree_setup_switches(struc | ||||||
|  teardown: |  teardown: | ||||||
|  	dsa_tree_teardown_ports(dst); |  	dsa_tree_teardown_ports(dst); | ||||||
|   |   | ||||||
| @@ -89,7 +89,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> | |||||||
|   |   | ||||||
|  	return err; |  	return err; | ||||||
|  } |  } | ||||||
| @@ -1111,10 +1130,14 @@ static int dsa_tree_setup(struct dsa_swi | @@ -1133,10 +1152,14 @@ static int dsa_tree_setup(struct dsa_swi | ||||||
|  	if (err) |  	if (err) | ||||||
|  		goto teardown_cpu_ports; |  		goto teardown_cpu_ports; | ||||||
|   |   | ||||||
| @@ -105,7 +105,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> | |||||||
|  	err = dsa_tree_setup_lags(dst); |  	err = dsa_tree_setup_lags(dst); | ||||||
|  	if (err) |  	if (err) | ||||||
|  		goto teardown_master; |  		goto teardown_master; | ||||||
| @@ -1127,8 +1150,9 @@ static int dsa_tree_setup(struct dsa_swi | @@ -1149,8 +1172,9 @@ static int dsa_tree_setup(struct dsa_swi | ||||||
|   |   | ||||||
|  teardown_master: |  teardown_master: | ||||||
|  	dsa_tree_teardown_master(dst); |  	dsa_tree_teardown_master(dst); | ||||||
|   | |||||||
| @@ -43,7 +43,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> | |||||||
|  |  | ||||||
| --- a/net/dsa/dsa2.c | --- a/net/dsa/dsa2.c | ||||||
| +++ b/net/dsa/dsa2.c | +++ b/net/dsa/dsa2.c | ||||||
| @@ -545,6 +545,7 @@ static void dsa_port_teardown(struct dsa | @@ -567,6 +567,7 @@ static void dsa_port_teardown(struct dsa | ||||||
|  	struct devlink_port *dlp = &dp->devlink_port; |  	struct devlink_port *dlp = &dp->devlink_port; | ||||||
|  	struct dsa_switch *ds = dp->ds; |  	struct dsa_switch *ds = dp->ds; | ||||||
|  	struct dsa_mac_addr *a, *tmp; |  	struct dsa_mac_addr *a, *tmp; | ||||||
| @@ -51,7 +51,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> | |||||||
|   |   | ||||||
|  	if (!dp->setup) |  	if (!dp->setup) | ||||||
|  		return; |  		return; | ||||||
| @@ -566,9 +567,11 @@ static void dsa_port_teardown(struct dsa | @@ -588,9 +589,11 @@ static void dsa_port_teardown(struct dsa | ||||||
|  		dsa_port_link_unregister_of(dp); |  		dsa_port_link_unregister_of(dp); | ||||||
|  		break; |  		break; | ||||||
|  	case DSA_PORT_TYPE_USER: |  	case DSA_PORT_TYPE_USER: | ||||||
| @@ -65,7 +65,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> | |||||||
|  		} |  		} | ||||||
|  		break; |  		break; | ||||||
|  	} |  	} | ||||||
| @@ -1130,17 +1133,17 @@ static int dsa_tree_setup(struct dsa_swi | @@ -1152,17 +1155,17 @@ static int dsa_tree_setup(struct dsa_swi | ||||||
|  	if (err) |  	if (err) | ||||||
|  		goto teardown_cpu_ports; |  		goto teardown_cpu_ports; | ||||||
|   |   | ||||||
| @@ -87,7 +87,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> | |||||||
|   |   | ||||||
|  	dst->setup = true; |  	dst->setup = true; | ||||||
|   |   | ||||||
| @@ -1148,10 +1151,10 @@ static int dsa_tree_setup(struct dsa_swi | @@ -1170,10 +1173,10 @@ static int dsa_tree_setup(struct dsa_swi | ||||||
|   |   | ||||||
|  	return 0; |  	return 0; | ||||||
|   |   | ||||||
| @@ -100,7 +100,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> | |||||||
|  teardown_switches: |  teardown_switches: | ||||||
|  	dsa_tree_teardown_switches(dst); |  	dsa_tree_teardown_switches(dst); | ||||||
|  teardown_cpu_ports: |  teardown_cpu_ports: | ||||||
| @@ -1169,10 +1172,10 @@ static void dsa_tree_teardown(struct dsa | @@ -1191,10 +1194,10 @@ static void dsa_tree_teardown(struct dsa | ||||||
|   |   | ||||||
|  	dsa_tree_teardown_lags(dst); |  	dsa_tree_teardown_lags(dst); | ||||||
|   |   | ||||||
|   | |||||||
| @@ -68,7 +68,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> | |||||||
|  static inline bool dsa_is_unused_port(struct dsa_switch *ds, int p) |  static inline bool dsa_is_unused_port(struct dsa_switch *ds, int p) | ||||||
|  { |  { | ||||||
|  	return dsa_to_port(ds, p)->type == DSA_PORT_TYPE_UNUSED; |  	return dsa_to_port(ds, p)->type == DSA_PORT_TYPE_UNUSED; | ||||||
| @@ -949,6 +959,13 @@ struct dsa_switch_ops { | @@ -957,6 +967,13 @@ struct dsa_switch_ops { | ||||||
|  	int	(*tag_8021q_vlan_add)(struct dsa_switch *ds, int port, u16 vid, |  	int	(*tag_8021q_vlan_add)(struct dsa_switch *ds, int port, u16 vid, | ||||||
|  				      u16 flags); |  				      u16 flags); | ||||||
|  	int	(*tag_8021q_vlan_del)(struct dsa_switch *ds, int port, u16 vid); |  	int	(*tag_8021q_vlan_del)(struct dsa_switch *ds, int port, u16 vid); | ||||||
| @@ -84,7 +84,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> | |||||||
|  #define DSA_DEVLINK_PARAM_DRIVER(_id, _name, _type, _cmodes)		\ |  #define DSA_DEVLINK_PARAM_DRIVER(_id, _name, _type, _cmodes)		\ | ||||||
| --- a/net/dsa/dsa2.c | --- a/net/dsa/dsa2.c | ||||||
| +++ b/net/dsa/dsa2.c | +++ b/net/dsa/dsa2.c | ||||||
| @@ -1275,6 +1275,52 @@ out_unlock: | @@ -1297,6 +1297,52 @@ out_unlock: | ||||||
|  	return err; |  	return err; | ||||||
|  } |  } | ||||||
|   |   | ||||||
|   | |||||||
| @@ -44,7 +44,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> | |||||||
|   |   | ||||||
|  #include "dsa_priv.h" |  #include "dsa_priv.h" | ||||||
|   |   | ||||||
| @@ -1060,9 +1061,18 @@ static int dsa_tree_setup_master(struct | @@ -1082,9 +1083,18 @@ static int dsa_tree_setup_master(struct | ||||||
|   |   | ||||||
|  	list_for_each_entry(dp, &dst->ports, list) { |  	list_for_each_entry(dp, &dst->ports, list) { | ||||||
|  		if (dsa_port_is_cpu(dp)) { |  		if (dsa_port_is_cpu(dp)) { | ||||||
| @@ -64,7 +64,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> | |||||||
|  		} |  		} | ||||||
|  	} |  	} | ||||||
|   |   | ||||||
| @@ -1077,9 +1087,19 @@ static void dsa_tree_teardown_master(str | @@ -1099,9 +1109,19 @@ static void dsa_tree_teardown_master(str | ||||||
|   |   | ||||||
|  	rtnl_lock(); |  	rtnl_lock(); | ||||||
|   |   | ||||||
|   | |||||||
| @@ -19,7 +19,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> | |||||||
|  |  | ||||||
| --- a/drivers/net/dsa/mt7530.c | --- a/drivers/net/dsa/mt7530.c | ||||||
| +++ b/drivers/net/dsa/mt7530.c | +++ b/drivers/net/dsa/mt7530.c | ||||||
| @@ -2952,9 +2952,6 @@ mt7531_mac_config(struct dsa_switch *ds, | @@ -2979,9 +2979,6 @@ mt7531_mac_config(struct dsa_switch *ds, | ||||||
|  	case PHY_INTERFACE_MODE_NA: |  	case PHY_INTERFACE_MODE_NA: | ||||||
|  	case PHY_INTERFACE_MODE_1000BASEX: |  	case PHY_INTERFACE_MODE_1000BASEX: | ||||||
|  	case PHY_INTERFACE_MODE_2500BASEX: |  	case PHY_INTERFACE_MODE_2500BASEX: | ||||||
| @@ -29,7 +29,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> | |||||||
|  		return mt7531_sgmii_setup_mode_force(priv, port, interface); |  		return mt7531_sgmii_setup_mode_force(priv, port, interface); | ||||||
|  	default: |  	default: | ||||||
|  		return -EINVAL; |  		return -EINVAL; | ||||||
| @@ -3030,13 +3027,6 @@ unsupported: | @@ -3057,13 +3054,6 @@ unsupported: | ||||||
|  		return; |  		return; | ||||||
|  	} |  	} | ||||||
|   |   | ||||||
| @@ -43,7 +43,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> | |||||||
|  	mcr_cur = mt7530_read(priv, MT7530_PMCR_P(port)); |  	mcr_cur = mt7530_read(priv, MT7530_PMCR_P(port)); | ||||||
|  	mcr_new = mcr_cur; |  	mcr_new = mcr_cur; | ||||||
|  	mcr_new &= ~PMCR_LINK_SETTINGS_MASK; |  	mcr_new &= ~PMCR_LINK_SETTINGS_MASK; | ||||||
| @@ -3173,6 +3163,9 @@ static void mt753x_phylink_get_caps(stru | @@ -3200,6 +3190,9 @@ static void mt753x_phylink_get_caps(stru | ||||||
|  	config->mac_capabilities = MAC_ASYM_PAUSE | MAC_SYM_PAUSE | |  	config->mac_capabilities = MAC_ASYM_PAUSE | MAC_SYM_PAUSE | | ||||||
|  				   MAC_10 | MAC_100 | MAC_1000FD; |  				   MAC_10 | MAC_100 | MAC_1000FD; | ||||||
|   |   | ||||||
| @@ -53,7 +53,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> | |||||||
|  	/* This driver does not make use of the speed, duplex, pause or the |  	/* This driver does not make use of the speed, duplex, pause or the | ||||||
|  	 * advertisement in its mac_config, so it is safe to mark this driver |  	 * advertisement in its mac_config, so it is safe to mark this driver | ||||||
|  	 * as non-legacy. |  	 * as non-legacy. | ||||||
| @@ -3238,6 +3231,7 @@ mt7531_sgmii_pcs_get_state_an(struct mt7 | @@ -3265,6 +3258,7 @@ mt7531_sgmii_pcs_get_state_an(struct mt7 | ||||||
|   |   | ||||||
|  	status = mt7530_read(priv, MT7531_PCS_CONTROL_1(port)); |  	status = mt7530_read(priv, MT7531_PCS_CONTROL_1(port)); | ||||||
|  	state->link = !!(status & MT7531_SGMII_LINK_STATUS); |  	state->link = !!(status & MT7531_SGMII_LINK_STATUS); | ||||||
| @@ -61,7 +61,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> | |||||||
|  	if (state->interface == PHY_INTERFACE_MODE_SGMII && |  	if (state->interface == PHY_INTERFACE_MODE_SGMII && | ||||||
|  	    (status & MT7531_SGMII_AN_ENABLE)) { |  	    (status & MT7531_SGMII_AN_ENABLE)) { | ||||||
|  		val = mt7530_read(priv, MT7531_PCS_SPEED_ABILITY(port)); |  		val = mt7530_read(priv, MT7531_PCS_SPEED_ABILITY(port)); | ||||||
| @@ -3268,16 +3262,44 @@ mt7531_sgmii_pcs_get_state_an(struct mt7 | @@ -3295,16 +3289,44 @@ mt7531_sgmii_pcs_get_state_an(struct mt7 | ||||||
|  	return 0; |  	return 0; | ||||||
|  } |  } | ||||||
|   |   | ||||||
| @@ -109,7 +109,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> | |||||||
|  } |  } | ||||||
|   |   | ||||||
|  static int mt753x_pcs_config(struct phylink_pcs *pcs, unsigned int mode, |  static int mt753x_pcs_config(struct phylink_pcs *pcs, unsigned int mode, | ||||||
| @@ -3318,6 +3340,8 @@ mt753x_setup(struct dsa_switch *ds) | @@ -3345,6 +3367,8 @@ mt753x_setup(struct dsa_switch *ds) | ||||||
|  		priv->pcs[i].pcs.ops = priv->info->pcs_ops; |  		priv->pcs[i].pcs.ops = priv->info->pcs_ops; | ||||||
|  		priv->pcs[i].priv = priv; |  		priv->pcs[i].priv = priv; | ||||||
|  		priv->pcs[i].port = i; |  		priv->pcs[i].port = i; | ||||||
| @@ -120,7 +120,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> | |||||||
|  	ret = priv->info->sw_setup(ds); |  	ret = priv->info->sw_setup(ds); | ||||||
| --- a/drivers/net/dsa/mt7530.h | --- a/drivers/net/dsa/mt7530.h | ||||||
| +++ b/drivers/net/dsa/mt7530.h | +++ b/drivers/net/dsa/mt7530.h | ||||||
| @@ -405,6 +405,7 @@ enum mt7530_vlan_port_acc_frm { | @@ -410,6 +410,7 @@ enum mt7530_vlan_port_acc_frm { | ||||||
|  #define  MT7531_SGMII_LINK_STATUS	BIT(18) |  #define  MT7531_SGMII_LINK_STATUS	BIT(18) | ||||||
|  #define  MT7531_SGMII_AN_ENABLE		BIT(12) |  #define  MT7531_SGMII_AN_ENABLE		BIT(12) | ||||||
|  #define  MT7531_SGMII_AN_RESTART	BIT(9) |  #define  MT7531_SGMII_AN_RESTART	BIT(9) | ||||||
|   | |||||||
| @@ -81,7 +81,7 @@ Tested-by: Frank Wunderlich <frank-w@public-files.de> | |||||||
|  #include <linux/phylink.h> |  #include <linux/phylink.h> | ||||||
|  #include <linux/regmap.h> |  #include <linux/regmap.h> | ||||||
|  #include <linux/regulator/consumer.h> |  #include <linux/regulator/consumer.h> | ||||||
| @@ -2804,128 +2805,11 @@ static int mt7531_rgmii_setup(struct mt7 | @@ -2831,128 +2832,11 @@ static int mt7531_rgmii_setup(struct mt7 | ||||||
|  	return 0; |  	return 0; | ||||||
|  } |  } | ||||||
|   |   | ||||||
| @@ -210,7 +210,7 @@ Tested-by: Frank Wunderlich <frank-w@public-files.de> | |||||||
|  static int |  static int | ||||||
|  mt7531_mac_config(struct dsa_switch *ds, int port, unsigned int mode, |  mt7531_mac_config(struct dsa_switch *ds, int port, unsigned int mode, | ||||||
|  		  phy_interface_t interface) |  		  phy_interface_t interface) | ||||||
| @@ -2948,11 +2832,11 @@ mt7531_mac_config(struct dsa_switch *ds, | @@ -2975,11 +2859,11 @@ mt7531_mac_config(struct dsa_switch *ds, | ||||||
|  		phydev = dp->slave->phydev; |  		phydev = dp->slave->phydev; | ||||||
|  		return mt7531_rgmii_setup(priv, port, interface, phydev); |  		return mt7531_rgmii_setup(priv, port, interface, phydev); | ||||||
|  	case PHY_INTERFACE_MODE_SGMII: |  	case PHY_INTERFACE_MODE_SGMII: | ||||||
| @@ -224,7 +224,7 @@ Tested-by: Frank Wunderlich <frank-w@public-files.de> | |||||||
|  	default: |  	default: | ||||||
|  		return -EINVAL; |  		return -EINVAL; | ||||||
|  	} |  	} | ||||||
| @@ -2977,11 +2861,11 @@ mt753x_phylink_mac_select_pcs(struct dsa | @@ -3004,11 +2888,11 @@ mt753x_phylink_mac_select_pcs(struct dsa | ||||||
|   |   | ||||||
|  	switch (interface) { |  	switch (interface) { | ||||||
|  	case PHY_INTERFACE_MODE_TRGMII: |  	case PHY_INTERFACE_MODE_TRGMII: | ||||||
| @@ -238,7 +238,7 @@ Tested-by: Frank Wunderlich <frank-w@public-files.de> | |||||||
|  	default: |  	default: | ||||||
|  		return NULL; |  		return NULL; | ||||||
|  	} |  	} | ||||||
| @@ -3222,86 +3106,6 @@ static void mt7530_pcs_get_state(struct | @@ -3249,86 +3133,6 @@ static void mt7530_pcs_get_state(struct | ||||||
|  		state->pause |= MLO_PAUSE_TX; |  		state->pause |= MLO_PAUSE_TX; | ||||||
|  } |  } | ||||||
|   |   | ||||||
| @@ -325,7 +325,7 @@ Tested-by: Frank Wunderlich <frank-w@public-files.de> | |||||||
|  static int mt753x_pcs_config(struct phylink_pcs *pcs, unsigned int mode, |  static int mt753x_pcs_config(struct phylink_pcs *pcs, unsigned int mode, | ||||||
|  			     phy_interface_t interface, |  			     phy_interface_t interface, | ||||||
|  			     const unsigned long *advertising, |  			     const unsigned long *advertising, | ||||||
| @@ -3321,18 +3125,57 @@ static const struct phylink_pcs_ops mt75 | @@ -3348,18 +3152,57 @@ static const struct phylink_pcs_ops mt75 | ||||||
|  	.pcs_an_restart = mt7530_pcs_an_restart, |  	.pcs_an_restart = mt7530_pcs_an_restart, | ||||||
|  }; |  }; | ||||||
|   |   | ||||||
| @@ -389,7 +389,7 @@ Tested-by: Frank Wunderlich <frank-w@public-files.de> | |||||||
|  	int i, ret; |  	int i, ret; | ||||||
|   |   | ||||||
|  	/* Initialise the PCS devices */ |  	/* Initialise the PCS devices */ | ||||||
| @@ -3340,8 +3183,6 @@ mt753x_setup(struct dsa_switch *ds) | @@ -3367,8 +3210,6 @@ mt753x_setup(struct dsa_switch *ds) | ||||||
|  		priv->pcs[i].pcs.ops = priv->info->pcs_ops; |  		priv->pcs[i].pcs.ops = priv->info->pcs_ops; | ||||||
|  		priv->pcs[i].priv = priv; |  		priv->pcs[i].priv = priv; | ||||||
|  		priv->pcs[i].port = i; |  		priv->pcs[i].port = i; | ||||||
| @@ -398,7 +398,7 @@ Tested-by: Frank Wunderlich <frank-w@public-files.de> | |||||||
|  	} |  	} | ||||||
|   |   | ||||||
|  	ret = priv->info->sw_setup(ds); |  	ret = priv->info->sw_setup(ds); | ||||||
| @@ -3356,6 +3197,16 @@ mt753x_setup(struct dsa_switch *ds) | @@ -3383,6 +3224,16 @@ mt753x_setup(struct dsa_switch *ds) | ||||||
|  	if (ret && priv->irq) |  	if (ret && priv->irq) | ||||||
|  		mt7530_free_irq_common(priv); |  		mt7530_free_irq_common(priv); | ||||||
|   |   | ||||||
| @@ -415,7 +415,7 @@ Tested-by: Frank Wunderlich <frank-w@public-files.de> | |||||||
|  	return ret; |  	return ret; | ||||||
|  } |  } | ||||||
|   |   | ||||||
| @@ -3447,7 +3298,7 @@ static const struct mt753x_info mt753x_t | @@ -3475,7 +3326,7 @@ static const struct mt753x_info mt753x_t | ||||||
|  	}, |  	}, | ||||||
|  	[ID_MT7531] = { |  	[ID_MT7531] = { | ||||||
|  		.id = ID_MT7531, |  		.id = ID_MT7531, | ||||||
| @@ -424,7 +424,7 @@ Tested-by: Frank Wunderlich <frank-w@public-files.de> | |||||||
|  		.sw_setup = mt7531_setup, |  		.sw_setup = mt7531_setup, | ||||||
|  		.phy_read = mt7531_ind_phy_read, |  		.phy_read = mt7531_ind_phy_read, | ||||||
|  		.phy_write = mt7531_ind_phy_write, |  		.phy_write = mt7531_ind_phy_write, | ||||||
| @@ -3555,7 +3406,7 @@ static void | @@ -3583,7 +3434,7 @@ static void | ||||||
|  mt7530_remove(struct mdio_device *mdiodev) |  mt7530_remove(struct mdio_device *mdiodev) | ||||||
|  { |  { | ||||||
|  	struct mt7530_priv *priv = dev_get_drvdata(&mdiodev->dev); |  	struct mt7530_priv *priv = dev_get_drvdata(&mdiodev->dev); | ||||||
| @@ -433,7 +433,7 @@ Tested-by: Frank Wunderlich <frank-w@public-files.de> | |||||||
|   |   | ||||||
|  	if (!priv) |  	if (!priv) | ||||||
|  		return; |  		return; | ||||||
| @@ -3574,6 +3425,10 @@ mt7530_remove(struct mdio_device *mdiode | @@ -3602,6 +3453,10 @@ mt7530_remove(struct mdio_device *mdiode | ||||||
|  		mt7530_free_irq(priv); |  		mt7530_free_irq(priv); | ||||||
|   |   | ||||||
|  	dsa_unregister_switch(priv->ds); |  	dsa_unregister_switch(priv->ds); | ||||||
| @@ -446,7 +446,7 @@ Tested-by: Frank Wunderlich <frank-w@public-files.de> | |||||||
|  	dev_set_drvdata(&mdiodev->dev, NULL); |  	dev_set_drvdata(&mdiodev->dev, NULL); | ||||||
| --- a/drivers/net/dsa/mt7530.h | --- a/drivers/net/dsa/mt7530.h | ||||||
| +++ b/drivers/net/dsa/mt7530.h | +++ b/drivers/net/dsa/mt7530.h | ||||||
| @@ -396,47 +396,8 @@ enum mt7530_vlan_port_acc_frm { | @@ -401,47 +401,8 @@ enum mt7530_vlan_port_acc_frm { | ||||||
|  					 CCR_TX_OCT_CNT_BAD) |  					 CCR_TX_OCT_CNT_BAD) | ||||||
|   |   | ||||||
|  /* MT7531 SGMII register group */ |  /* MT7531 SGMII register group */ | ||||||
| @@ -496,7 +496,7 @@ Tested-by: Frank Wunderlich <frank-w@public-files.de> | |||||||
|   |   | ||||||
|  /* Register for system reset */ |  /* Register for system reset */ | ||||||
|  #define MT7530_SYS_CTRL			0x7000 |  #define MT7530_SYS_CTRL			0x7000 | ||||||
| @@ -735,13 +696,13 @@ struct mt7530_fdb { | @@ -741,13 +702,13 @@ struct mt7530_fdb { | ||||||
|   * @pm:		The matrix used to show all connections with the port. |   * @pm:		The matrix used to show all connections with the port. | ||||||
|   * @pvid:	The VLAN specified is to be considered a PVID at ingress.  Any |   * @pvid:	The VLAN specified is to be considered a PVID at ingress.  Any | ||||||
|   *		untagged frames will be assigned to the related VLAN. |   *		untagged frames will be assigned to the related VLAN. | ||||||
|   | |||||||
| @@ -18,7 +18,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> | |||||||
|  |  | ||||||
| --- a/drivers/net/dsa/mt7530.c | --- a/drivers/net/dsa/mt7530.c | ||||||
| +++ b/drivers/net/dsa/mt7530.c | +++ b/drivers/net/dsa/mt7530.c | ||||||
| @@ -3157,26 +3157,56 @@ static const struct regmap_bus mt7531_re | @@ -3184,26 +3184,56 @@ static const struct regmap_bus mt7531_re | ||||||
|  	.reg_update_bits = mt7530_regmap_update_bits, |  	.reg_update_bits = mt7530_regmap_update_bits, | ||||||
|  }; |  }; | ||||||
|   |   | ||||||
| @@ -88,7 +88,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> | |||||||
|  	int i, ret; |  	int i, ret; | ||||||
|   |   | ||||||
|  	/* Initialise the PCS devices */ |  	/* Initialise the PCS devices */ | ||||||
| @@ -3198,15 +3228,11 @@ mt753x_setup(struct dsa_switch *ds) | @@ -3225,15 +3255,11 @@ mt753x_setup(struct dsa_switch *ds) | ||||||
|  	if (ret && priv->irq) |  	if (ret && priv->irq) | ||||||
|  		mt7530_free_irq_common(priv); |  		mt7530_free_irq_common(priv); | ||||||
|   |   | ||||||
|   | |||||||
| @@ -19,7 +19,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> | |||||||
|  |  | ||||||
| --- a/drivers/net/dsa/mt7530.c | --- a/drivers/net/dsa/mt7530.c | ||||||
| +++ b/drivers/net/dsa/mt7530.c | +++ b/drivers/net/dsa/mt7530.c | ||||||
| @@ -3130,7 +3130,7 @@ static int mt7530_regmap_read(void *cont | @@ -3157,7 +3157,7 @@ static int mt7530_regmap_read(void *cont | ||||||
|  { |  { | ||||||
|  	struct mt7530_priv *priv = context; |  	struct mt7530_priv *priv = context; | ||||||
|   |   | ||||||
| @@ -28,7 +28,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> | |||||||
|  	return 0; |  	return 0; | ||||||
|  }; |  }; | ||||||
|   |   | ||||||
| @@ -3138,23 +3138,25 @@ static int mt7530_regmap_write(void *con | @@ -3165,23 +3165,25 @@ static int mt7530_regmap_write(void *con | ||||||
|  { |  { | ||||||
|  	struct mt7530_priv *priv = context; |  	struct mt7530_priv *priv = context; | ||||||
|   |   | ||||||
| @@ -62,7 +62,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> | |||||||
|  }; |  }; | ||||||
|   |   | ||||||
|  static int |  static int | ||||||
| @@ -3180,6 +3182,9 @@ mt7531_create_sgmii(struct mt7530_priv * | @@ -3207,6 +3209,9 @@ mt7531_create_sgmii(struct mt7530_priv * | ||||||
|  		mt7531_pcs_config[i]->reg_stride = 4; |  		mt7531_pcs_config[i]->reg_stride = 4; | ||||||
|  		mt7531_pcs_config[i]->reg_base = MT7531_SGMII_REG_BASE(5 + i); |  		mt7531_pcs_config[i]->reg_base = MT7531_SGMII_REG_BASE(5 + i); | ||||||
|  		mt7531_pcs_config[i]->max_register = 0x17c; |  		mt7531_pcs_config[i]->max_register = 0x17c; | ||||||
|   | |||||||
| @@ -133,7 +133,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> | |||||||
|  } |  } | ||||||
|   |   | ||||||
|  static void |  static void | ||||||
| @@ -3126,22 +3147,6 @@ static const struct phylink_pcs_ops mt75 | @@ -3153,22 +3174,6 @@ static const struct phylink_pcs_ops mt75 | ||||||
|  	.pcs_an_restart = mt7530_pcs_an_restart, |  	.pcs_an_restart = mt7530_pcs_an_restart, | ||||||
|  }; |  }; | ||||||
|   |   | ||||||
| @@ -156,7 +156,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> | |||||||
|  static void |  static void | ||||||
|  mt7530_mdio_regmap_lock(void *mdio_lock) |  mt7530_mdio_regmap_lock(void *mdio_lock) | ||||||
|  { |  { | ||||||
| @@ -3154,7 +3159,7 @@ mt7530_mdio_regmap_unlock(void *mdio_loc | @@ -3181,7 +3186,7 @@ mt7530_mdio_regmap_unlock(void *mdio_loc | ||||||
|  	mutex_unlock(mdio_lock); |  	mutex_unlock(mdio_lock); | ||||||
|  } |  } | ||||||
|   |   | ||||||
| @@ -165,7 +165,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> | |||||||
|  	.reg_write = mt7530_regmap_write, |  	.reg_write = mt7530_regmap_write, | ||||||
|  	.reg_read = mt7530_regmap_read, |  	.reg_read = mt7530_regmap_read, | ||||||
|  }; |  }; | ||||||
| @@ -3187,7 +3192,7 @@ mt7531_create_sgmii(struct mt7530_priv * | @@ -3214,7 +3219,7 @@ mt7531_create_sgmii(struct mt7530_priv * | ||||||
|  		mt7531_pcs_config[i]->lock_arg = &priv->bus->mdio_lock; |  		mt7531_pcs_config[i]->lock_arg = &priv->bus->mdio_lock; | ||||||
|   |   | ||||||
|  		regmap = devm_regmap_init(priv->dev, |  		regmap = devm_regmap_init(priv->dev, | ||||||
| @@ -174,7 +174,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> | |||||||
|  					  mt7531_pcs_config[i]); |  					  mt7531_pcs_config[i]); | ||||||
|  		if (IS_ERR(regmap)) { |  		if (IS_ERR(regmap)) { | ||||||
|  			ret = PTR_ERR(regmap); |  			ret = PTR_ERR(regmap); | ||||||
| @@ -3352,6 +3357,7 @@ MODULE_DEVICE_TABLE(of, mt7530_of_match) | @@ -3380,6 +3385,7 @@ MODULE_DEVICE_TABLE(of, mt7530_of_match) | ||||||
|  static int |  static int | ||||||
|  mt7530_probe(struct mdio_device *mdiodev) |  mt7530_probe(struct mdio_device *mdiodev) | ||||||
|  { |  { | ||||||
| @@ -182,7 +182,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> | |||||||
|  	struct mt7530_priv *priv; |  	struct mt7530_priv *priv; | ||||||
|  	struct device_node *dn; |  	struct device_node *dn; | ||||||
|   |   | ||||||
| @@ -3431,6 +3437,21 @@ mt7530_probe(struct mdio_device *mdiodev | @@ -3459,6 +3465,21 @@ mt7530_probe(struct mdio_device *mdiodev | ||||||
|  	mutex_init(&priv->reg_mutex); |  	mutex_init(&priv->reg_mutex); | ||||||
|  	dev_set_drvdata(&mdiodev->dev, priv); |  	dev_set_drvdata(&mdiodev->dev, priv); | ||||||
|   |   | ||||||
| @@ -206,7 +206,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> | |||||||
|   |   | ||||||
| --- a/drivers/net/dsa/mt7530.h | --- a/drivers/net/dsa/mt7530.h | ||||||
| +++ b/drivers/net/dsa/mt7530.h | +++ b/drivers/net/dsa/mt7530.h | ||||||
| @@ -779,6 +779,7 @@ struct mt753x_info { | @@ -785,6 +785,7 @@ struct mt753x_info { | ||||||
|   * @dev:		The device pointer |   * @dev:		The device pointer | ||||||
|   * @ds:			The pointer to the dsa core structure |   * @ds:			The pointer to the dsa core structure | ||||||
|   * @bus:		The bus used for the device and built-in PHY |   * @bus:		The bus used for the device and built-in PHY | ||||||
| @@ -214,7 +214,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> | |||||||
|   * @rstc:		The pointer to reset control used by MCM |   * @rstc:		The pointer to reset control used by MCM | ||||||
|   * @core_pwr:		The power supplied into the core |   * @core_pwr:		The power supplied into the core | ||||||
|   * @io_pwr:		The power supplied into the I/O |   * @io_pwr:		The power supplied into the I/O | ||||||
| @@ -799,6 +800,7 @@ struct mt7530_priv { | @@ -805,6 +806,7 @@ struct mt7530_priv { | ||||||
|  	struct device		*dev; |  	struct device		*dev; | ||||||
|  	struct dsa_switch	*ds; |  	struct dsa_switch	*ds; | ||||||
|  	struct mii_bus		*bus; |  	struct mii_bus		*bus; | ||||||
|   | |||||||
| @@ -18,7 +18,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> | |||||||
|  |  | ||||||
| --- a/drivers/net/dsa/mt7530.c | --- a/drivers/net/dsa/mt7530.c | ||||||
| +++ b/drivers/net/dsa/mt7530.c | +++ b/drivers/net/dsa/mt7530.c | ||||||
| @@ -3238,12 +3238,6 @@ mt753x_setup(struct dsa_switch *ds) | @@ -3265,12 +3265,6 @@ mt753x_setup(struct dsa_switch *ds) | ||||||
|  	if (ret && priv->irq) |  	if (ret && priv->irq) | ||||||
|  		mt7530_free_irq_common(priv); |  		mt7530_free_irq_common(priv); | ||||||
|   |   | ||||||
| @@ -31,7 +31,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> | |||||||
|  	return ret; |  	return ret; | ||||||
|  } |  } | ||||||
|   |   | ||||||
| @@ -3360,6 +3354,7 @@ mt7530_probe(struct mdio_device *mdiodev | @@ -3388,6 +3382,7 @@ mt7530_probe(struct mdio_device *mdiodev | ||||||
|  	static struct regmap_config *regmap_config; |  	static struct regmap_config *regmap_config; | ||||||
|  	struct mt7530_priv *priv; |  	struct mt7530_priv *priv; | ||||||
|  	struct device_node *dn; |  	struct device_node *dn; | ||||||
| @@ -39,7 +39,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> | |||||||
|   |   | ||||||
|  	dn = mdiodev->dev.of_node; |  	dn = mdiodev->dev.of_node; | ||||||
|   |   | ||||||
| @@ -3452,6 +3447,12 @@ mt7530_probe(struct mdio_device *mdiodev | @@ -3480,6 +3475,12 @@ mt7530_probe(struct mdio_device *mdiodev | ||||||
|  	if (IS_ERR(priv->regmap)) |  	if (IS_ERR(priv->regmap)) | ||||||
|  		return PTR_ERR(priv->regmap); |  		return PTR_ERR(priv->regmap); | ||||||
|   |   | ||||||
|   | |||||||
| @@ -114,7 +114,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> | |||||||
|  } |  } | ||||||
|   |   | ||||||
|  static void |  static void | ||||||
| @@ -646,14 +650,13 @@ static int | @@ -660,14 +664,13 @@ static int | ||||||
|  mt7531_ind_c45_phy_read(struct mt7530_priv *priv, int port, int devad, |  mt7531_ind_c45_phy_read(struct mt7530_priv *priv, int port, int devad, | ||||||
|  			int regnum) |  			int regnum) | ||||||
|  { |  { | ||||||
| @@ -130,7 +130,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> | |||||||
|   |   | ||||||
|  	ret = readx_poll_timeout(_mt7530_unlocked_read, &p, val, |  	ret = readx_poll_timeout(_mt7530_unlocked_read, &p, val, | ||||||
|  				 !(val & MT7531_PHY_ACS_ST), 20, 100000); |  				 !(val & MT7531_PHY_ACS_ST), 20, 100000); | ||||||
| @@ -686,7 +689,7 @@ mt7531_ind_c45_phy_read(struct mt7530_pr | @@ -700,7 +703,7 @@ mt7531_ind_c45_phy_read(struct mt7530_pr | ||||||
|   |   | ||||||
|  	ret = val & MT7531_MDIO_RW_DATA_MASK; |  	ret = val & MT7531_MDIO_RW_DATA_MASK; | ||||||
|  out: |  out: | ||||||
| @@ -139,7 +139,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> | |||||||
|   |   | ||||||
|  	return ret; |  	return ret; | ||||||
|  } |  } | ||||||
| @@ -695,14 +698,13 @@ static int | @@ -709,14 +712,13 @@ static int | ||||||
|  mt7531_ind_c45_phy_write(struct mt7530_priv *priv, int port, int devad, |  mt7531_ind_c45_phy_write(struct mt7530_priv *priv, int port, int devad, | ||||||
|  			 int regnum, u32 data) |  			 int regnum, u32 data) | ||||||
|  { |  { | ||||||
| @@ -155,7 +155,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> | |||||||
|   |   | ||||||
|  	ret = readx_poll_timeout(_mt7530_unlocked_read, &p, val, |  	ret = readx_poll_timeout(_mt7530_unlocked_read, &p, val, | ||||||
|  				 !(val & MT7531_PHY_ACS_ST), 20, 100000); |  				 !(val & MT7531_PHY_ACS_ST), 20, 100000); | ||||||
| @@ -734,7 +736,7 @@ mt7531_ind_c45_phy_write(struct mt7530_p | @@ -748,7 +750,7 @@ mt7531_ind_c45_phy_write(struct mt7530_p | ||||||
|  	} |  	} | ||||||
|   |   | ||||||
|  out: |  out: | ||||||
| @@ -164,7 +164,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> | |||||||
|   |   | ||||||
|  	return ret; |  	return ret; | ||||||
|  } |  } | ||||||
| @@ -742,14 +744,13 @@ out: | @@ -756,14 +758,13 @@ out: | ||||||
|  static int |  static int | ||||||
|  mt7531_ind_c22_phy_read(struct mt7530_priv *priv, int port, int regnum) |  mt7531_ind_c22_phy_read(struct mt7530_priv *priv, int port, int regnum) | ||||||
|  { |  { | ||||||
| @@ -180,7 +180,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> | |||||||
|   |   | ||||||
|  	ret = readx_poll_timeout(_mt7530_unlocked_read, &p, val, |  	ret = readx_poll_timeout(_mt7530_unlocked_read, &p, val, | ||||||
|  				 !(val & MT7531_PHY_ACS_ST), 20, 100000); |  				 !(val & MT7531_PHY_ACS_ST), 20, 100000); | ||||||
| @@ -772,7 +773,7 @@ mt7531_ind_c22_phy_read(struct mt7530_pr | @@ -786,7 +787,7 @@ mt7531_ind_c22_phy_read(struct mt7530_pr | ||||||
|   |   | ||||||
|  	ret = val & MT7531_MDIO_RW_DATA_MASK; |  	ret = val & MT7531_MDIO_RW_DATA_MASK; | ||||||
|  out: |  out: | ||||||
| @@ -189,7 +189,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> | |||||||
|   |   | ||||||
|  	return ret; |  	return ret; | ||||||
|  } |  } | ||||||
| @@ -781,14 +782,13 @@ static int | @@ -795,14 +796,13 @@ static int | ||||||
|  mt7531_ind_c22_phy_write(struct mt7530_priv *priv, int port, int regnum, |  mt7531_ind_c22_phy_write(struct mt7530_priv *priv, int port, int regnum, | ||||||
|  			 u16 data) |  			 u16 data) | ||||||
|  { |  { | ||||||
| @@ -205,7 +205,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> | |||||||
|   |   | ||||||
|  	ret = readx_poll_timeout(_mt7530_unlocked_read, &p, reg, |  	ret = readx_poll_timeout(_mt7530_unlocked_read, &p, reg, | ||||||
|  				 !(reg & MT7531_PHY_ACS_ST), 20, 100000); |  				 !(reg & MT7531_PHY_ACS_ST), 20, 100000); | ||||||
| @@ -810,7 +810,7 @@ mt7531_ind_c22_phy_write(struct mt7530_p | @@ -824,7 +824,7 @@ mt7531_ind_c22_phy_write(struct mt7530_p | ||||||
|  	} |  	} | ||||||
|   |   | ||||||
|  out: |  out: | ||||||
| @@ -214,7 +214,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> | |||||||
|   |   | ||||||
|  	return ret; |  	return ret; | ||||||
|  } |  } | ||||||
| @@ -1323,7 +1323,6 @@ static int | @@ -1344,7 +1344,6 @@ static int | ||||||
|  mt7530_port_change_mtu(struct dsa_switch *ds, int port, int new_mtu) |  mt7530_port_change_mtu(struct dsa_switch *ds, int port, int new_mtu) | ||||||
|  { |  { | ||||||
|  	struct mt7530_priv *priv = ds->priv; |  	struct mt7530_priv *priv = ds->priv; | ||||||
| @@ -222,7 +222,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> | |||||||
|  	int length; |  	int length; | ||||||
|  	u32 val; |  	u32 val; | ||||||
|   |   | ||||||
| @@ -1334,7 +1333,7 @@ mt7530_port_change_mtu(struct dsa_switch | @@ -1355,7 +1354,7 @@ mt7530_port_change_mtu(struct dsa_switch | ||||||
|  	if (!dsa_is_cpu_port(ds, port)) |  	if (!dsa_is_cpu_port(ds, port)) | ||||||
|  		return 0; |  		return 0; | ||||||
|   |   | ||||||
| @@ -231,7 +231,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> | |||||||
|   |   | ||||||
|  	val = mt7530_mii_read(priv, MT7530_GMACCR); |  	val = mt7530_mii_read(priv, MT7530_GMACCR); | ||||||
|  	val &= ~MAX_RX_PKT_LEN_MASK; |  	val &= ~MAX_RX_PKT_LEN_MASK; | ||||||
| @@ -1355,7 +1354,7 @@ mt7530_port_change_mtu(struct dsa_switch | @@ -1376,7 +1375,7 @@ mt7530_port_change_mtu(struct dsa_switch | ||||||
|   |   | ||||||
|  	mt7530_mii_write(priv, MT7530_GMACCR, val); |  	mt7530_mii_write(priv, MT7530_GMACCR, val); | ||||||
|   |   | ||||||
| @@ -240,7 +240,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> | |||||||
|   |   | ||||||
|  	return 0; |  	return 0; | ||||||
|  } |  } | ||||||
| @@ -2151,10 +2150,10 @@ mt7530_irq_thread_fn(int irq, void *dev_ | @@ -2172,10 +2171,10 @@ mt7530_irq_thread_fn(int irq, void *dev_ | ||||||
|  	u32 val; |  	u32 val; | ||||||
|  	int p; |  	int p; | ||||||
|   |   | ||||||
| @@ -253,7 +253,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> | |||||||
|   |   | ||||||
|  	for (p = 0; p < MT7530_NUM_PHYS; p++) { |  	for (p = 0; p < MT7530_NUM_PHYS; p++) { | ||||||
|  		if (BIT(p) & val) { |  		if (BIT(p) & val) { | ||||||
| @@ -2190,7 +2189,7 @@ mt7530_irq_bus_lock(struct irq_data *d) | @@ -2211,7 +2210,7 @@ mt7530_irq_bus_lock(struct irq_data *d) | ||||||
|  { |  { | ||||||
|  	struct mt7530_priv *priv = irq_data_get_irq_chip_data(d); |  	struct mt7530_priv *priv = irq_data_get_irq_chip_data(d); | ||||||
|   |   | ||||||
| @@ -262,7 +262,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> | |||||||
|  } |  } | ||||||
|   |   | ||||||
|  static void |  static void | ||||||
| @@ -2199,7 +2198,7 @@ mt7530_irq_bus_sync_unlock(struct irq_da | @@ -2220,7 +2219,7 @@ mt7530_irq_bus_sync_unlock(struct irq_da | ||||||
|  	struct mt7530_priv *priv = irq_data_get_irq_chip_data(d); |  	struct mt7530_priv *priv = irq_data_get_irq_chip_data(d); | ||||||
|   |   | ||||||
|  	mt7530_mii_write(priv, MT7530_SYS_INT_EN, priv->irq_enable); |  	mt7530_mii_write(priv, MT7530_SYS_INT_EN, priv->irq_enable); | ||||||
|   | |||||||
| @@ -21,7 +21,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> | |||||||
|  |  | ||||||
| --- a/drivers/net/dsa/mt7530.c | --- a/drivers/net/dsa/mt7530.c | ||||||
| +++ b/drivers/net/dsa/mt7530.c | +++ b/drivers/net/dsa/mt7530.c | ||||||
| @@ -951,6 +951,24 @@ mt7530_set_ageing_time(struct dsa_switch | @@ -965,6 +965,24 @@ mt7530_set_ageing_time(struct dsa_switch | ||||||
|  	return 0; |  	return 0; | ||||||
|  } |  } | ||||||
|   |   | ||||||
| @@ -48,7 +48,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> | |||||||
|  	struct mt7530_priv *priv = ds->priv; |  	struct mt7530_priv *priv = ds->priv; | ||||||
| --- a/drivers/net/dsa/mt7530.h | --- a/drivers/net/dsa/mt7530.h | ||||||
| +++ b/drivers/net/dsa/mt7530.h | +++ b/drivers/net/dsa/mt7530.h | ||||||
| @@ -714,24 +714,6 @@ enum p5_interface_select { | @@ -720,24 +720,6 @@ enum p5_interface_select { | ||||||
|  	P5_INTF_SEL_GMAC5_SGMII, |  	P5_INTF_SEL_GMAC5_SGMII, | ||||||
|  }; |  }; | ||||||
|   |   | ||||||
|   | |||||||
| @@ -17,7 +17,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> | |||||||
|  |  | ||||||
| --- a/drivers/net/dsa/mt7530.c | --- a/drivers/net/dsa/mt7530.c | ||||||
| +++ b/drivers/net/dsa/mt7530.c | +++ b/drivers/net/dsa/mt7530.c | ||||||
| @@ -3366,44 +3366,21 @@ static const struct of_device_id mt7530_ | @@ -3394,44 +3394,21 @@ static const struct of_device_id mt7530_ | ||||||
|  MODULE_DEVICE_TABLE(of, mt7530_of_match); |  MODULE_DEVICE_TABLE(of, mt7530_of_match); | ||||||
|   |   | ||||||
|  static int |  static int | ||||||
| @@ -67,7 +67,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> | |||||||
|  	if (!priv->info) |  	if (!priv->info) | ||||||
|  		return -EINVAL; |  		return -EINVAL; | ||||||
|   |   | ||||||
| @@ -3417,23 +3394,53 @@ mt7530_probe(struct mdio_device *mdiodev | @@ -3445,23 +3422,53 @@ mt7530_probe(struct mdio_device *mdiodev | ||||||
|  		return -EINVAL; |  		return -EINVAL; | ||||||
|   |   | ||||||
|  	priv->id = priv->info->id; |  	priv->id = priv->info->id; | ||||||
| @@ -131,7 +131,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> | |||||||
|  		priv->reset = devm_gpiod_get_optional(&mdiodev->dev, "reset", |  		priv->reset = devm_gpiod_get_optional(&mdiodev->dev, "reset", | ||||||
|  						      GPIOD_OUT_LOW); |  						      GPIOD_OUT_LOW); | ||||||
|  		if (IS_ERR(priv->reset)) { |  		if (IS_ERR(priv->reset)) { | ||||||
| @@ -3442,12 +3449,15 @@ mt7530_probe(struct mdio_device *mdiodev | @@ -3470,12 +3477,15 @@ mt7530_probe(struct mdio_device *mdiodev | ||||||
|  		} |  		} | ||||||
|  	} |  	} | ||||||
|   |   | ||||||
|   | |||||||
| @@ -17,7 +17,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> | |||||||
|  |  | ||||||
| --- a/drivers/net/dsa/mt7530.c | --- a/drivers/net/dsa/mt7530.c | ||||||
| +++ b/drivers/net/dsa/mt7530.c | +++ b/drivers/net/dsa/mt7530.c | ||||||
| @@ -3484,6 +3484,17 @@ mt7530_probe(struct mdio_device *mdiodev | @@ -3512,6 +3512,17 @@ mt7530_probe(struct mdio_device *mdiodev | ||||||
|  } |  } | ||||||
|   |   | ||||||
|  static void |  static void | ||||||
| @@ -35,7 +35,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> | |||||||
|  mt7530_remove(struct mdio_device *mdiodev) |  mt7530_remove(struct mdio_device *mdiodev) | ||||||
|  { |  { | ||||||
|  	struct mt7530_priv *priv = dev_get_drvdata(&mdiodev->dev); |  	struct mt7530_priv *priv = dev_get_drvdata(&mdiodev->dev); | ||||||
| @@ -3502,16 +3513,11 @@ mt7530_remove(struct mdio_device *mdiode | @@ -3530,16 +3541,11 @@ mt7530_remove(struct mdio_device *mdiode | ||||||
|  		dev_err(priv->dev, "Failed to disable io pwr: %d\n", |  		dev_err(priv->dev, "Failed to disable io pwr: %d\n", | ||||||
|  			ret); |  			ret); | ||||||
|   |   | ||||||
|   | |||||||
| @@ -416,7 +416,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> | |||||||
|  static u32 |  static u32 | ||||||
|  mt7530_mii_read(struct mt7530_priv *priv, u32 reg) |  mt7530_mii_read(struct mt7530_priv *priv, u32 reg) | ||||||
|  { |  { | ||||||
| @@ -3164,72 +3115,6 @@ static const struct phylink_pcs_ops mt75 | @@ -3191,72 +3142,6 @@ static const struct phylink_pcs_ops mt75 | ||||||
|  	.pcs_an_restart = mt7530_pcs_an_restart, |  	.pcs_an_restart = mt7530_pcs_an_restart, | ||||||
|  }; |  }; | ||||||
|   |   | ||||||
| @@ -489,7 +489,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> | |||||||
|  static int |  static int | ||||||
|  mt753x_setup(struct dsa_switch *ds) |  mt753x_setup(struct dsa_switch *ds) | ||||||
|  { |  { | ||||||
| @@ -3288,7 +3173,7 @@ static int mt753x_set_mac_eee(struct dsa | @@ -3315,7 +3200,7 @@ static int mt753x_set_mac_eee(struct dsa | ||||||
|  	return 0; |  	return 0; | ||||||
|  } |  } | ||||||
|   |   | ||||||
| @@ -497,8 +497,8 @@ Signed-off-by: David S. Miller <davem@davemloft.net> | |||||||
| +const struct dsa_switch_ops mt7530_switch_ops = { | +const struct dsa_switch_ops mt7530_switch_ops = { | ||||||
|  	.get_tag_protocol	= mtk_get_tag_protocol, |  	.get_tag_protocol	= mtk_get_tag_protocol, | ||||||
|  	.setup			= mt753x_setup, |  	.setup			= mt753x_setup, | ||||||
|  	.get_strings		= mt7530_get_strings, |  	.preferred_default_local_cpu_port = mt753x_preferred_default_local_cpu_port, | ||||||
| @@ -3322,8 +3207,9 @@ static const struct dsa_switch_ops mt753 | @@ -3350,8 +3235,9 @@ static const struct dsa_switch_ops mt753 | ||||||
|  	.get_mac_eee		= mt753x_get_mac_eee, |  	.get_mac_eee		= mt753x_get_mac_eee, | ||||||
|  	.set_mac_eee		= mt753x_set_mac_eee, |  	.set_mac_eee		= mt753x_set_mac_eee, | ||||||
|  }; |  }; | ||||||
| @@ -509,7 +509,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> | |||||||
|  	[ID_MT7621] = { |  	[ID_MT7621] = { | ||||||
|  		.id = ID_MT7621, |  		.id = ID_MT7621, | ||||||
|  		.pcs_ops = &mt7530_pcs_ops, |  		.pcs_ops = &mt7530_pcs_ops, | ||||||
| @@ -3356,16 +3242,9 @@ static const struct mt753x_info mt753x_t | @@ -3384,16 +3270,9 @@ static const struct mt753x_info mt753x_t | ||||||
|  		.mac_port_config = mt7531_mac_config, |  		.mac_port_config = mt7531_mac_config, | ||||||
|  	}, |  	}, | ||||||
|  }; |  }; | ||||||
| @@ -528,7 +528,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> | |||||||
|  mt7530_probe_common(struct mt7530_priv *priv) |  mt7530_probe_common(struct mt7530_priv *priv) | ||||||
|  { |  { | ||||||
|  	struct device *dev = priv->dev; |  	struct device *dev = priv->dev; | ||||||
| @@ -3402,88 +3281,9 @@ mt7530_probe_common(struct mt7530_priv * | @@ -3430,88 +3309,9 @@ mt7530_probe_common(struct mt7530_priv * | ||||||
|   |   | ||||||
|  	return 0; |  	return 0; | ||||||
|  } |  } | ||||||
| @@ -619,7 +619,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> | |||||||
|  mt7530_remove_common(struct mt7530_priv *priv) |  mt7530_remove_common(struct mt7530_priv *priv) | ||||||
|  { |  { | ||||||
|  	if (priv->irq) |  	if (priv->irq) | ||||||
| @@ -3494,57 +3294,6 @@ mt7530_remove_common(struct mt7530_priv | @@ -3522,57 +3322,6 @@ mt7530_remove_common(struct mt7530_priv | ||||||
|  	mutex_destroy(&priv->reg_mutex); |  	mutex_destroy(&priv->reg_mutex); | ||||||
|  } |  } | ||||||
|   |   | ||||||
| @@ -679,7 +679,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> | |||||||
|  MODULE_LICENSE("GPL"); |  MODULE_LICENSE("GPL"); | ||||||
| --- a/drivers/net/dsa/mt7530.h | --- a/drivers/net/dsa/mt7530.h | ||||||
| +++ b/drivers/net/dsa/mt7530.h | +++ b/drivers/net/dsa/mt7530.h | ||||||
| @@ -839,4 +839,10 @@ static inline void INIT_MT7530_DUMMY_POL | @@ -845,4 +845,10 @@ static inline void INIT_MT7530_DUMMY_POL | ||||||
|  	p->reg = reg; |  	p->reg = reg; | ||||||
|  } |  } | ||||||
|   |   | ||||||
|   | |||||||
| @@ -184,7 +184,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> | |||||||
| +MODULE_LICENSE("GPL"); | +MODULE_LICENSE("GPL"); | ||||||
| --- a/drivers/net/dsa/mt7530.c | --- a/drivers/net/dsa/mt7530.c | ||||||
| +++ b/drivers/net/dsa/mt7530.c | +++ b/drivers/net/dsa/mt7530.c | ||||||
| @@ -2198,6 +2198,47 @@ static const struct irq_domain_ops mt753 | @@ -2219,6 +2219,47 @@ static const struct irq_domain_ops mt753 | ||||||
|  }; |  }; | ||||||
|   |   | ||||||
|  static void |  static void | ||||||
| @@ -232,7 +232,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> | |||||||
|  mt7530_setup_mdio_irq(struct mt7530_priv *priv) |  mt7530_setup_mdio_irq(struct mt7530_priv *priv) | ||||||
|  { |  { | ||||||
|  	struct dsa_switch *ds = priv->ds; |  	struct dsa_switch *ds = priv->ds; | ||||||
| @@ -2231,8 +2272,15 @@ mt7530_setup_irq(struct mt7530_priv *pri | @@ -2252,8 +2293,15 @@ mt7530_setup_irq(struct mt7530_priv *pri | ||||||
|  		return priv->irq ? : -EINVAL; |  		return priv->irq ? : -EINVAL; | ||||||
|  	} |  	} | ||||||
|   |   | ||||||
| @@ -250,7 +250,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> | |||||||
|  	if (!priv->irq_domain) { |  	if (!priv->irq_domain) { | ||||||
|  		dev_err(dev, "failed to create IRQ domain\n"); |  		dev_err(dev, "failed to create IRQ domain\n"); | ||||||
|  		return -ENOMEM; |  		return -ENOMEM; | ||||||
| @@ -2727,6 +2775,25 @@ static void mt7531_mac_port_get_caps(str | @@ -2754,6 +2802,25 @@ static void mt7531_mac_port_get_caps(str | ||||||
|  	} |  	} | ||||||
|  } |  } | ||||||
|   |   | ||||||
| @@ -276,7 +276,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> | |||||||
|  static int |  static int | ||||||
|  mt753x_pad_setup(struct dsa_switch *ds, const struct phylink_link_state *state) |  mt753x_pad_setup(struct dsa_switch *ds, const struct phylink_link_state *state) | ||||||
|  { |  { | ||||||
| @@ -2803,6 +2870,17 @@ static bool mt753x_is_mac_port(u32 port) | @@ -2830,6 +2897,17 @@ static bool mt753x_is_mac_port(u32 port) | ||||||
|  } |  } | ||||||
|   |   | ||||||
|  static int |  static int | ||||||
| @@ -294,7 +294,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> | |||||||
|  mt7531_mac_config(struct dsa_switch *ds, int port, unsigned int mode, |  mt7531_mac_config(struct dsa_switch *ds, int port, unsigned int mode, | ||||||
|  		  phy_interface_t interface) |  		  phy_interface_t interface) | ||||||
|  { |  { | ||||||
| @@ -2872,7 +2950,8 @@ mt753x_phylink_mac_config(struct dsa_swi | @@ -2899,7 +2977,8 @@ mt753x_phylink_mac_config(struct dsa_swi | ||||||
|   |   | ||||||
|  	switch (port) { |  	switch (port) { | ||||||
|  	case 0 ... 4: /* Internal phy */ |  	case 0 ... 4: /* Internal phy */ | ||||||
| @@ -304,7 +304,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> | |||||||
|  			goto unsupported; |  			goto unsupported; | ||||||
|  		break; |  		break; | ||||||
|  	case 5: /* 2nd cpu port with phy of port 0 or 4 / external phy */ |  	case 5: /* 2nd cpu port with phy of port 0 or 4 / external phy */ | ||||||
| @@ -2950,7 +3029,8 @@ static void mt753x_phylink_mac_link_up(s | @@ -2977,7 +3056,8 @@ static void mt753x_phylink_mac_link_up(s | ||||||
|  	/* MT753x MAC works in 1G full duplex mode for all up-clocked |  	/* MT753x MAC works in 1G full duplex mode for all up-clocked | ||||||
|  	 * variants. |  	 * variants. | ||||||
|  	 */ |  	 */ | ||||||
| @@ -314,7 +314,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> | |||||||
|  	    (phy_interface_mode_is_8023z(interface))) { |  	    (phy_interface_mode_is_8023z(interface))) { | ||||||
|  		speed = SPEED_1000; |  		speed = SPEED_1000; | ||||||
|  		duplex = DUPLEX_FULL; |  		duplex = DUPLEX_FULL; | ||||||
| @@ -3030,6 +3110,21 @@ mt7531_cpu_port_config(struct dsa_switch | @@ -3057,6 +3137,21 @@ mt7531_cpu_port_config(struct dsa_switch | ||||||
|  	return 0; |  	return 0; | ||||||
|  } |  } | ||||||
|   |   | ||||||
| @@ -336,7 +336,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> | |||||||
|  static void mt753x_phylink_get_caps(struct dsa_switch *ds, int port, |  static void mt753x_phylink_get_caps(struct dsa_switch *ds, int port, | ||||||
|  				    struct phylink_config *config) |  				    struct phylink_config *config) | ||||||
|  { |  { | ||||||
| @@ -3175,6 +3270,27 @@ static int mt753x_set_mac_eee(struct dsa | @@ -3202,6 +3297,27 @@ static int mt753x_set_mac_eee(struct dsa | ||||||
|  	return 0; |  	return 0; | ||||||
|  } |  } | ||||||
|   |   | ||||||
| @@ -364,7 +364,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> | |||||||
|  const struct dsa_switch_ops mt7530_switch_ops = { |  const struct dsa_switch_ops mt7530_switch_ops = { | ||||||
|  	.get_tag_protocol	= mtk_get_tag_protocol, |  	.get_tag_protocol	= mtk_get_tag_protocol, | ||||||
|  	.setup			= mt753x_setup, |  	.setup			= mt753x_setup, | ||||||
| @@ -3243,6 +3359,17 @@ const struct mt753x_info mt753x_table[] | @@ -3271,6 +3387,17 @@ const struct mt753x_info mt753x_table[] | ||||||
|  		.mac_port_get_caps = mt7531_mac_port_get_caps, |  		.mac_port_get_caps = mt7531_mac_port_get_caps, | ||||||
|  		.mac_port_config = mt7531_mac_config, |  		.mac_port_config = mt7531_mac_config, | ||||||
|  	}, |  	}, | ||||||
| @@ -392,9 +392,9 @@ Signed-off-by: David S. Miller <davem@davemloft.net> | |||||||
|  }; |  }; | ||||||
|   |   | ||||||
|  #define	NUM_TRGMII_CTRL			5 |  #define	NUM_TRGMII_CTRL			5 | ||||||
| @@ -54,11 +55,11 @@ enum mt753x_id { | @@ -59,11 +60,11 @@ enum mt753x_id { | ||||||
|  #define  MT7531_MIRROR_PORT_SET(x)	(((x) & MIRROR_MASK) << 16) |  | ||||||
|  #define  MT7531_CPU_PMAP_MASK		GENMASK(7, 0) |  #define  MT7531_CPU_PMAP_MASK		GENMASK(7, 0) | ||||||
|  |  #define  MT7531_CPU_PMAP(x)		FIELD_PREP(MT7531_CPU_PMAP_MASK, x) | ||||||
|   |   | ||||||
| -#define MT753X_MIRROR_REG(id)		(((id) == ID_MT7531) ? \ | -#define MT753X_MIRROR_REG(id)		(((id) == ID_MT7531) ? \ | ||||||
| +#define MT753X_MIRROR_REG(id)		((((id) == ID_MT7531) || ((id) == ID_MT7988)) ?	\ | +#define MT753X_MIRROR_REG(id)		((((id) == ID_MT7531) || ((id) == ID_MT7988)) ?	\ | ||||||
| @@ -407,7 +407,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> | |||||||
|  					 MT7531_MIRROR_MASK : MIRROR_MASK) |  					 MT7531_MIRROR_MASK : MIRROR_MASK) | ||||||
|   |   | ||||||
|  /* Registers for BPDU and PAE frame control*/ |  /* Registers for BPDU and PAE frame control*/ | ||||||
| @@ -327,9 +328,8 @@ enum mt7530_vlan_port_acc_frm { | @@ -332,9 +333,8 @@ enum mt7530_vlan_port_acc_frm { | ||||||
|  					 MT7531_FORCE_DPX | \ |  					 MT7531_FORCE_DPX | \ | ||||||
|  					 MT7531_FORCE_RX_FC | \ |  					 MT7531_FORCE_RX_FC | \ | ||||||
|  					 MT7531_FORCE_TX_FC) |  					 MT7531_FORCE_TX_FC) | ||||||
|   | |||||||
| @@ -73,7 +73,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org> | |||||||
|  } |  } | ||||||
| --- a/drivers/net/dsa/mt7530.c | --- a/drivers/net/dsa/mt7530.c | ||||||
| +++ b/drivers/net/dsa/mt7530.c | +++ b/drivers/net/dsa/mt7530.c | ||||||
| @@ -3237,6 +3237,12 @@ mt753x_setup(struct dsa_switch *ds) | @@ -3264,6 +3264,12 @@ mt753x_setup(struct dsa_switch *ds) | ||||||
|  	if (ret && priv->irq) |  	if (ret && priv->irq) | ||||||
|  		mt7530_free_irq_common(priv); |  		mt7530_free_irq_common(priv); | ||||||
|   |   | ||||||
| @@ -88,7 +88,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org> | |||||||
|   |   | ||||||
| --- a/drivers/net/dsa/mt7530.h | --- a/drivers/net/dsa/mt7530.h | ||||||
| +++ b/drivers/net/dsa/mt7530.h | +++ b/drivers/net/dsa/mt7530.h | ||||||
| @@ -773,10 +773,10 @@ struct mt753x_info { | @@ -779,10 +779,10 @@ struct mt753x_info { | ||||||
|   *			registers |   *			registers | ||||||
|   * @p6_interface	Holding the current port 6 interface |   * @p6_interface	Holding the current port 6 interface | ||||||
|   * @p5_intf_sel:	Holding the current port 5 interface select |   * @p5_intf_sel:	Holding the current port 5 interface select | ||||||
| @@ -100,7 +100,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org> | |||||||
|   */ |   */ | ||||||
|  struct mt7530_priv { |  struct mt7530_priv { | ||||||
|  	struct device		*dev; |  	struct device		*dev; | ||||||
| @@ -795,7 +795,6 @@ struct mt7530_priv { | @@ -801,7 +801,6 @@ struct mt7530_priv { | ||||||
|  	unsigned int		p5_intf_sel; |  	unsigned int		p5_intf_sel; | ||||||
|  	u8			mirror_rx; |  	u8			mirror_rx; | ||||||
|  	u8			mirror_tx; |  	u8			mirror_tx; | ||||||
| @@ -108,7 +108,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org> | |||||||
|  	struct mt7530_port	ports[MT7530_NUM_PORTS]; |  	struct mt7530_port	ports[MT7530_NUM_PORTS]; | ||||||
|  	struct mt753x_pcs	pcs[MT7530_NUM_PORTS]; |  	struct mt753x_pcs	pcs[MT7530_NUM_PORTS]; | ||||||
|  	/* protect among processes for registers access*/ |  	/* protect among processes for registers access*/ | ||||||
| @@ -803,6 +802,7 @@ struct mt7530_priv { | @@ -809,6 +808,7 @@ struct mt7530_priv { | ||||||
|  	int irq; |  	int irq; | ||||||
|  	struct irq_domain *irq_domain; |  	struct irq_domain *irq_domain; | ||||||
|  	u32 irq_enable; |  	u32 irq_enable; | ||||||
|   | |||||||
| @@ -4328,6 +4328,7 @@ CONFIG_NF_CONNTRACK_PROCFS=y | |||||||
| # CONFIG_NF_DUP_IPV4 is not set | # CONFIG_NF_DUP_IPV4 is not set | ||||||
| # CONFIG_NF_DUP_IPV6 is not set | # CONFIG_NF_DUP_IPV6 is not set | ||||||
| # CONFIG_NF_FLOW_TABLE is not set | # CONFIG_NF_FLOW_TABLE is not set | ||||||
|  | # CONFIG_NF_FLOW_TABLE_PROCFS is not set | ||||||
| # CONFIG_NF_LOG_ARP is not set | # CONFIG_NF_LOG_ARP is not set | ||||||
| # CONFIG_NF_LOG_BRIDGE is not set | # CONFIG_NF_LOG_BRIDGE is not set | ||||||
| # CONFIG_NF_LOG_IPV4 is not set | # CONFIG_NF_LOG_IPV4 is not set | ||||||
|   | |||||||
| @@ -17,7 +17,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name> | |||||||
|  	depends on NETFILTER_ADVANCED |  	depends on NETFILTER_ADVANCED | ||||||
|  	help |  	help | ||||||
|  	  H.323 is a VoIP signalling protocol from ITU-T. As one of the most |  	  H.323 is a VoIP signalling protocol from ITU-T. As one of the most | ||||||
| @@ -1105,7 +1104,6 @@ config NETFILTER_XT_TARGET_SECMARK | @@ -1114,7 +1113,6 @@ config NETFILTER_XT_TARGET_SECMARK | ||||||
|   |   | ||||||
|  config NETFILTER_XT_TARGET_TCPMSS |  config NETFILTER_XT_TARGET_TCPMSS | ||||||
|  	tristate '"TCPMSS" target support' |  	tristate '"TCPMSS" target support' | ||||||
|   | |||||||
| @@ -70,7 +70,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name> | |||||||
|  	help |  	help | ||||||
|  	  This option adds the flow table core infrastructure. |  	  This option adds the flow table core infrastructure. | ||||||
|   |   | ||||||
| @@ -1010,6 +1009,15 @@ config NETFILTER_XT_TARGET_NOTRACK | @@ -1019,6 +1018,15 @@ config NETFILTER_XT_TARGET_NOTRACK | ||||||
|  	depends on NETFILTER_ADVANCED |  	depends on NETFILTER_ADVANCED | ||||||
|  	select NETFILTER_XT_TARGET_CT |  	select NETFILTER_XT_TARGET_CT | ||||||
|   |   | ||||||
| @@ -88,7 +88,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name> | |||||||
|  	depends on NETFILTER_ADVANCED |  	depends on NETFILTER_ADVANCED | ||||||
| --- a/net/netfilter/Makefile | --- a/net/netfilter/Makefile | ||||||
| +++ b/net/netfilter/Makefile | +++ b/net/netfilter/Makefile | ||||||
| @@ -143,6 +143,7 @@ obj-$(CONFIG_NETFILTER_XT_TARGET_CLASSIF | @@ -144,6 +144,7 @@ obj-$(CONFIG_NETFILTER_XT_TARGET_CLASSIF | ||||||
|  obj-$(CONFIG_NETFILTER_XT_TARGET_CONNSECMARK) += xt_CONNSECMARK.o |  obj-$(CONFIG_NETFILTER_XT_TARGET_CONNSECMARK) += xt_CONNSECMARK.o | ||||||
|  obj-$(CONFIG_NETFILTER_XT_TARGET_CT) += xt_CT.o |  obj-$(CONFIG_NETFILTER_XT_TARGET_CT) += xt_CT.o | ||||||
|  obj-$(CONFIG_NETFILTER_XT_TARGET_DSCP) += xt_DSCP.o |  obj-$(CONFIG_NETFILTER_XT_TARGET_DSCP) += xt_DSCP.o | ||||||
|   | |||||||
| @@ -43,7 +43,7 @@ Subject: [PATCH] net/usb/qmi_wwan: add MeigLink modem support | |||||||
|   |   | ||||||
|  #define QUECTEL_VENDOR_ID			0x2c7c |  #define QUECTEL_VENDOR_ID			0x2c7c | ||||||
|  /* These Quectel products use Quectel's vendor ID */ |  /* These Quectel products use Quectel's vendor ID */ | ||||||
| @@ -1152,6 +1157,11 @@ static const struct usb_device_id option | @@ -1156,6 +1161,11 @@ static const struct usb_device_id option | ||||||
|  	{ USB_DEVICE(QUALCOMM_VENDOR_ID, 0x0023)}, /* ONYX 3G device */ |  	{ USB_DEVICE(QUALCOMM_VENDOR_ID, 0x0023)}, /* ONYX 3G device */ | ||||||
|  	{ USB_DEVICE(QUALCOMM_VENDOR_ID, 0x9000), /* SIMCom SIM5218 */ |  	{ USB_DEVICE(QUALCOMM_VENDOR_ID, 0x9000), /* SIMCom SIM5218 */ | ||||||
|  	  .driver_info = NCTRL(0) | NCTRL(1) | NCTRL(2) | NCTRL(3) | RSVD(4) }, |  	  .driver_info = NCTRL(0) | NCTRL(1) | NCTRL(2) | NCTRL(3) | RSVD(4) }, | ||||||
| @@ -55,7 +55,7 @@ Subject: [PATCH] net/usb/qmi_wwan: add MeigLink modem support | |||||||
|  	/* Quectel products using Qualcomm vendor ID */ |  	/* Quectel products using Qualcomm vendor ID */ | ||||||
|  	{ USB_DEVICE(QUALCOMM_VENDOR_ID, QUECTEL_PRODUCT_UC15)}, |  	{ USB_DEVICE(QUALCOMM_VENDOR_ID, QUECTEL_PRODUCT_UC15)}, | ||||||
|  	{ USB_DEVICE(QUALCOMM_VENDOR_ID, QUECTEL_PRODUCT_UC20), |  	{ USB_DEVICE(QUALCOMM_VENDOR_ID, QUECTEL_PRODUCT_UC20), | ||||||
| @@ -1193,6 +1203,11 @@ static const struct usb_device_id option | @@ -1197,6 +1207,11 @@ static const struct usb_device_id option | ||||||
|  	  .driver_info = ZLP }, |  	  .driver_info = ZLP }, | ||||||
|  	{ USB_DEVICE(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_BG96), |  	{ USB_DEVICE(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_BG96), | ||||||
|  	  .driver_info = RSVD(4) }, |  	  .driver_info = RSVD(4) }, | ||||||
|   | |||||||
| @@ -15,7 +15,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name> | |||||||
|  |  | ||||||
| --- a/net/bridge/br_input.c | --- a/net/bridge/br_input.c | ||||||
| +++ b/net/bridge/br_input.c | +++ b/net/bridge/br_input.c | ||||||
| @@ -204,6 +204,9 @@ static void __br_handle_local_finish(str | @@ -209,6 +209,9 @@ static void __br_handle_local_finish(str | ||||||
|  /* note: already called with rcu_read_lock */ |  /* note: already called with rcu_read_lock */ | ||||||
|  static int br_handle_local_finish(struct net *net, struct sock *sk, struct sk_buff *skb) |  static int br_handle_local_finish(struct net *net, struct sock *sk, struct sk_buff *skb) | ||||||
|  { |  { | ||||||
| @@ -25,7 +25,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name> | |||||||
|  	__br_handle_local_finish(skb); |  	__br_handle_local_finish(skb); | ||||||
|   |   | ||||||
|  	/* return 1 to signal the okfn() was called so it's ok to use the skb */ |  	/* return 1 to signal the okfn() was called so it's ok to use the skb */ | ||||||
| @@ -369,6 +372,17 @@ static rx_handler_result_t br_handle_fra | @@ -376,6 +379,17 @@ static rx_handler_result_t br_handle_fra | ||||||
|   |   | ||||||
|  forward: |  forward: | ||||||
|  	switch (p->state) { |  	switch (p->state) { | ||||||
|   | |||||||
| @@ -10,9 +10,9 @@ Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> | |||||||
|  |  | ||||||
| --- a/net/netfilter/nf_flow_table_core.c | --- a/net/netfilter/nf_flow_table_core.c | ||||||
| +++ b/net/netfilter/nf_flow_table_core.c | +++ b/net/netfilter/nf_flow_table_core.c | ||||||
| @@ -606,13 +606,41 @@ void nf_flow_table_free(struct nf_flowta | @@ -651,6 +651,23 @@ static struct pernet_operations nf_flow_ | ||||||
|  } |  	.exit_batch = nf_flow_table_pernet_exit, | ||||||
|  EXPORT_SYMBOL_GPL(nf_flow_table_free); |  }; | ||||||
|   |   | ||||||
| +static int nf_flow_table_netdev_event(struct notifier_block *this, | +static int nf_flow_table_netdev_event(struct notifier_block *this, | ||||||
| +				      unsigned long event, void *ptr) | +				      unsigned long event, void *ptr) | ||||||
| @@ -33,26 +33,30 @@ Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> | |||||||
| + | + | ||||||
|  static int __init nf_flow_table_module_init(void) |  static int __init nf_flow_table_module_init(void) | ||||||
|  { |  { | ||||||
| -	return nf_flow_table_offload_init(); |  	int ret; | ||||||
| +	int ret; | @@ -663,8 +680,14 @@ static int __init nf_flow_table_module_i | ||||||
| + |  	if (ret) | ||||||
| +	ret = nf_flow_table_offload_init(); |  		goto out_offload; | ||||||
| +	if (ret) |   | ||||||
| +		return ret; |  | ||||||
| + |  | ||||||
| +	ret = register_netdevice_notifier(&flow_offload_netdev_notifier); | +	ret = register_netdevice_notifier(&flow_offload_netdev_notifier); | ||||||
| +	if (ret) | +	if (ret) | ||||||
| +		nf_flow_table_offload_exit(); | +		goto out_offload_init; | ||||||
| + | + | ||||||
| +	return ret; |  	return 0; | ||||||
|  } |   | ||||||
|  | +out_offload_init: | ||||||
|  | +	nf_flow_table_offload_exit(); | ||||||
|  |  out_offload: | ||||||
|  |  	unregister_pernet_subsys(&nf_flow_table_net_ops); | ||||||
|  |  	return ret; | ||||||
|  | @@ -672,6 +695,7 @@ out_offload: | ||||||
|   |   | ||||||
|  static void __exit nf_flow_table_module_exit(void) |  static void __exit nf_flow_table_module_exit(void) | ||||||
|  { |  { | ||||||
| +	unregister_netdevice_notifier(&flow_offload_netdev_notifier); | +	unregister_netdevice_notifier(&flow_offload_netdev_notifier); | ||||||
|  	nf_flow_table_offload_exit(); |  	nf_flow_table_offload_exit(); | ||||||
|  |  	unregister_pernet_subsys(&nf_flow_table_net_ops); | ||||||
|  } |  } | ||||||
|   |  | ||||||
| --- a/net/netfilter/nft_flow_offload.c | --- a/net/netfilter/nft_flow_offload.c | ||||||
| +++ b/net/netfilter/nft_flow_offload.c | +++ b/net/netfilter/nft_flow_offload.c | ||||||
| @@ -455,47 +455,14 @@ static struct nft_expr_type nft_flow_off | @@ -455,47 +455,14 @@ static struct nft_expr_type nft_flow_off | ||||||
|   | |||||||
| @@ -18,7 +18,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name> | |||||||
|  |  | ||||||
| --- a/net/netfilter/nf_tables_api.c | --- a/net/netfilter/nf_tables_api.c | ||||||
| +++ b/net/netfilter/nf_tables_api.c | +++ b/net/netfilter/nf_tables_api.c | ||||||
| @@ -7803,7 +7803,7 @@ static int nft_register_flowtable_net_ho | @@ -7811,7 +7811,7 @@ static int nft_register_flowtable_net_ho | ||||||
|  		err = flowtable->data.type->setup(&flowtable->data, |  		err = flowtable->data.type->setup(&flowtable->data, | ||||||
|  						  hook->ops.dev, |  						  hook->ops.dev, | ||||||
|  						  FLOW_BLOCK_BIND); |  						  FLOW_BLOCK_BIND); | ||||||
|   | |||||||
| @@ -45,7 +45,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name> | |||||||
|  			if (!(p->flags & BR_BCAST_FLOOD) && skb->dev != br->dev) |  			if (!(p->flags & BR_BCAST_FLOOD) && skb->dev != br->dev) | ||||||
| --- a/net/bridge/br_input.c | --- a/net/bridge/br_input.c | ||||||
| +++ b/net/bridge/br_input.c | +++ b/net/bridge/br_input.c | ||||||
| @@ -326,6 +326,8 @@ static rx_handler_result_t br_handle_fra | @@ -331,6 +331,8 @@ static rx_handler_result_t br_handle_fra | ||||||
|  		fwd_mask |= p->group_fwd_mask; |  		fwd_mask |= p->group_fwd_mask; | ||||||
|  		switch (dest[5]) { |  		switch (dest[5]) { | ||||||
|  		case 0x00:	/* Bridge Group Address */ |  		case 0x00:	/* Bridge Group Address */ | ||||||
|   | |||||||
| @@ -15,16 +15,7 @@ Signed-off-by: Alexander Couzens <lynxis@fe80.eu> | |||||||
|  |  | ||||||
| --- a/drivers/net/dsa/mt7530.c | --- a/drivers/net/dsa/mt7530.c | ||||||
| +++ b/drivers/net/dsa/mt7530.c | +++ b/drivers/net/dsa/mt7530.c | ||||||
| @@ -2628,7 +2628,7 @@ mt7531_setup(struct dsa_switch *ds) | @@ -2680,6 +2680,10 @@ mt7531_setup(struct dsa_switch *ds) | ||||||
|  	struct mt7530_priv *priv = ds->priv; |  | ||||||
|  	struct mt7530_dummy_poll p; |  | ||||||
|  	u32 val, id; |  | ||||||
| -	int ret; |  | ||||||
| +	int ret, i; |  | ||||||
|   |  | ||||||
|  	/* Reset whole chip through gpio pin or memory-mapped registers for |  | ||||||
|  	 * different type of hardware |  | ||||||
| @@ -2660,6 +2660,10 @@ mt7531_setup(struct dsa_switch *ds) |  | ||||||
|  		return -ENODEV; |  		return -ENODEV; | ||||||
|  	} |  	} | ||||||
|   |   | ||||||
|   | |||||||
| @@ -16,7 +16,7 @@ Signed-off-by: David Bauer <mail@david-bauer.net> | |||||||
|  |  | ||||||
| --- a/drivers/net/dsa/mt7530.c | --- a/drivers/net/dsa/mt7530.c | ||||||
| +++ b/drivers/net/dsa/mt7530.c | +++ b/drivers/net/dsa/mt7530.c | ||||||
| @@ -2335,10 +2335,13 @@ mt7530_setup_mdio(struct mt7530_priv *pr | @@ -2356,10 +2356,13 @@ mt7530_setup_mdio(struct mt7530_priv *pr | ||||||
|  { |  { | ||||||
|  	struct dsa_switch *ds = priv->ds; |  	struct dsa_switch *ds = priv->ds; | ||||||
|  	struct device *dev = priv->dev; |  	struct device *dev = priv->dev; | ||||||
| @@ -30,7 +30,7 @@ Signed-off-by: David Bauer <mail@david-bauer.net> | |||||||
|  	bus = devm_mdiobus_alloc(dev); |  	bus = devm_mdiobus_alloc(dev); | ||||||
|  	if (!bus) |  	if (!bus) | ||||||
|  		return -ENOMEM; |  		return -ENOMEM; | ||||||
| @@ -2355,7 +2358,9 @@ mt7530_setup_mdio(struct mt7530_priv *pr | @@ -2376,7 +2379,9 @@ mt7530_setup_mdio(struct mt7530_priv *pr | ||||||
|  	if (priv->irq) |  	if (priv->irq) | ||||||
|  		mt7530_setup_mdio_irq(priv); |  		mt7530_setup_mdio_irq(priv); | ||||||
|   |   | ||||||
|   | |||||||
| @@ -33,7 +33,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org> | |||||||
|  |  | ||||||
| --- a/drivers/net/dsa/mt7530.c | --- a/drivers/net/dsa/mt7530.c | ||||||
| +++ b/drivers/net/dsa/mt7530.c | +++ b/drivers/net/dsa/mt7530.c | ||||||
| @@ -3038,8 +3038,7 @@ static void mt753x_phylink_mac_link_up(s | @@ -3065,8 +3065,7 @@ static void mt753x_phylink_mac_link_up(s | ||||||
|  	/* MT753x MAC works in 1G full duplex mode for all up-clocked |  	/* MT753x MAC works in 1G full duplex mode for all up-clocked | ||||||
|  	 * variants. |  	 * variants. | ||||||
|  	 */ |  	 */ | ||||||
|   | |||||||
| @@ -61,7 +61,7 @@ Signed-off-by: Imre Kaloz <kaloz@openwrt.org> | |||||||
|  /* |  /* | ||||||
|   * We need to store the untouched command line for future reference. |   * We need to store the untouched command line for future reference. | ||||||
|   * We also need to store the touched command line since the parameter |   * We also need to store the touched command line since the parameter | ||||||
| @@ -958,6 +981,7 @@ asmlinkage __visible void __init __no_sa | @@ -960,6 +983,7 @@ asmlinkage __visible void __init __no_sa | ||||||
|  	pr_notice("%s", linux_banner); |  	pr_notice("%s", linux_banner); | ||||||
|  	early_security_init(); |  	early_security_init(); | ||||||
|  	setup_arch(&command_line); |  	setup_arch(&command_line); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Hauke Mehrtens
					Hauke Mehrtens