Skip to content

Commit 7b8e926

Browse files
committed
Merge tag 'net-6.19-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Pull networking fixes from Paolo Abeni: "Including fixes from netfilter and CAN. Current release - regressions: - netfilter: nf_conncount: fix leaked ct in error paths - sched: act_mirred: fix loop detection - sctp: fix potential deadlock in sctp_clone_sock() - can: fix build dependency - eth: mlx5e: do not update BQL of old txqs during channel reconfiguration Previous releases - regressions: - sched: ets: always remove class from active list before deleting it - inet: frags: flush pending skbs in fqdir_pre_exit() - netfilter: nf_nat: remove bogus direction check - mptcp: - schedule rtx timer only after pushing data - avoid deadlock on fallback while reinjecting - can: gs_usb: fix error handling - eth: - mlx5e: - avoid unregistering PSP twice - fix double unregister of HCA_PORTS component - bnxt_en: fix XDP_TX path - mlxsw: fix use-after-free when updating multicast route stats Previous releases - always broken: - ethtool: avoid overflowing userspace buffer on stats query - openvswitch: fix middle attribute validation in push_nsh() action - eth: - mlx5: fw_tracer, validate format string parameters - mlxsw: spectrum_router: fix neighbour use-after-free - ipvlan: ignore PACKET_LOOPBACK in handle_mode_l2() Misc: - Jozsef Kadlecsik retires from maintaining netfilter - tools: ynl: fix build on systems with old kernel headers" * tag 'net-6.19-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (83 commits) net: hns3: add VLAN id validation before using net: hns3: using the num_tqps to check whether tqp_index is out of range when vf get ring info from mbx net: hns3: using the num_tqps in the vf driver to apply for resources net: enetc: do not transmit redirected XDP frames when the link is down selftests/tc-testing: Test case exercising potential mirred redirect deadlock net/sched: act_mirred: fix loop detection sctp: Clear inet_opt in sctp_v6_copy_ip_options(). sctp: Fetch inet6_sk() after setting ->pinet6 in sctp_clone_sock(). net/handshake: duplicate handshake cancellations leak socket net/mlx5e: Don't include PSP in the hard MTU calculations net/mlx5e: Do not update BQL of old txqs during channel reconfiguration net/mlx5e: Trigger neighbor resolution for unresolved destinations net/mlx5e: Use ip6_dst_lookup instead of ipv6_dst_lookup_flow for MAC init net/mlx5: Serialize firmware reset with devlink net/mlx5: fw_tracer, Handle escaped percent properly net/mlx5: fw_tracer, Validate format string parameters net/mlx5: Drain firmware reset in shutdown callback net/mlx5: fw reset, clear reset requested on drain_fw_reset net: dsa: mxl-gsw1xx: manually clear RANEG bit net: dsa: mxl-gsw1xx: fix .shutdown driver operation ...
2 parents a91e113 + 21a88f5 commit 7b8e926

88 files changed

Lines changed: 769 additions & 269 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CREDITS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1987,6 +1987,7 @@ D: netfilter: TCP window tracking code
19871987
D: netfilter: raw table
19881988
D: netfilter: iprange match
19891989
D: netfilter: new logging interfaces
1990+
D: netfilter: ipset
19901991
D: netfilter: various other hacks
19911992
S: Tata
19921993
S: Hungary

MAINTAINERS

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18028,7 +18028,6 @@ F: drivers/net/ethernet/neterion/
1802818028

1802918029
NETFILTER
1803018030
M: Pablo Neira Ayuso <pablo@netfilter.org>
18031-
M: Jozsef Kadlecsik <kadlec@netfilter.org>
1803218031
M: Florian Westphal <fw@strlen.de>
1803318032
R: Phil Sutter <phil@nwl.cc>
1803418033
L: netfilter-devel@vger.kernel.org

drivers/net/can/Kconfig

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# SPDX-License-Identifier: GPL-2.0-only
22

33
menuconfig CAN_DEV
4-
tristate "CAN Device Drivers"
4+
bool "CAN Device Drivers"
55
default y
66
depends on CAN
77
help
@@ -17,10 +17,7 @@ menuconfig CAN_DEV
1717
virtual ones. If you own such devices or plan to use the virtual CAN
1818
interfaces to develop applications, say Y here.
1919

20-
To compile as a module, choose M here: the module will be called
21-
can-dev.
22-
23-
if CAN_DEV
20+
if CAN_DEV && CAN
2421

2522
config CAN_VCAN
2623
tristate "Virtual Local CAN Interface (vcan)"

drivers/net/can/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ obj-$(CONFIG_CAN_VCAN) += vcan.o
77
obj-$(CONFIG_CAN_VXCAN) += vxcan.o
88
obj-$(CONFIG_CAN_SLCAN) += slcan/
99

10-
obj-y += dev/
10+
obj-$(CONFIG_CAN_DEV) += dev/
1111
obj-y += esd/
1212
obj-y += rcar/
1313
obj-y += rockchip/

drivers/net/can/dev/Makefile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
# SPDX-License-Identifier: GPL-2.0
22

3-
obj-$(CONFIG_CAN_DEV) += can-dev.o
4-
5-
can-dev-y += skb.o
3+
obj-$(CONFIG_CAN) += can-dev.o
64

5+
can-dev-$(CONFIG_CAN_DEV) += skb.o
76
can-dev-$(CONFIG_CAN_CALC_BITTIMING) += calc_bittiming.o
87
can-dev-$(CONFIG_CAN_NETLINK) += bittiming.o
98
can-dev-$(CONFIG_CAN_NETLINK) += dev.o

drivers/net/can/usb/gs_usb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1074,7 +1074,7 @@ static int gs_can_open(struct net_device *netdev)
10741074
usb_free_urb(urb);
10751075
out_usb_kill_anchored_urbs:
10761076
if (!parent->active_channels) {
1077-
usb_kill_anchored_urbs(&dev->tx_submitted);
1077+
usb_kill_anchored_urbs(&parent->rx_submitted);
10781078

10791079
if (dev->feature & GS_CAN_FEATURE_HW_TIMESTAMP)
10801080
gs_usb_timestamp_stop(parent);

drivers/net/dsa/lantiq/lantiq_gswip.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -444,9 +444,6 @@ static void gswip_remove(struct platform_device *pdev)
444444
if (!priv)
445445
return;
446446

447-
/* disable the switch */
448-
gswip_disable_switch(priv);
449-
450447
dsa_unregister_switch(priv->ds);
451448

452449
for (i = 0; i < priv->num_gphy_fw; i++)

drivers/net/dsa/lantiq/lantiq_gswip.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,8 +294,6 @@ struct gswip_priv {
294294
u16 version;
295295
};
296296

297-
void gswip_disable_switch(struct gswip_priv *priv);
298-
299297
int gswip_probe_common(struct gswip_priv *priv, u32 version);
300298

301299
#endif /* __LANTIQ_GSWIP_H */

drivers/net/dsa/lantiq/lantiq_gswip_common.c

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -752,6 +752,13 @@ static int gswip_setup(struct dsa_switch *ds)
752752
return 0;
753753
}
754754

755+
static void gswip_teardown(struct dsa_switch *ds)
756+
{
757+
struct gswip_priv *priv = ds->priv;
758+
759+
regmap_clear_bits(priv->mdio, GSWIP_MDIO_GLOB, GSWIP_MDIO_GLOB_ENABLE);
760+
}
761+
755762
static enum dsa_tag_protocol gswip_get_tag_protocol(struct dsa_switch *ds,
756763
int port,
757764
enum dsa_tag_protocol mp)
@@ -1629,6 +1636,7 @@ static const struct phylink_mac_ops gswip_phylink_mac_ops = {
16291636
static const struct dsa_switch_ops gswip_switch_ops = {
16301637
.get_tag_protocol = gswip_get_tag_protocol,
16311638
.setup = gswip_setup,
1639+
.teardown = gswip_teardown,
16321640
.port_setup = gswip_port_setup,
16331641
.port_enable = gswip_port_enable,
16341642
.port_disable = gswip_port_disable,
@@ -1656,12 +1664,6 @@ static const struct dsa_switch_ops gswip_switch_ops = {
16561664
.port_hsr_leave = dsa_port_simple_hsr_leave,
16571665
};
16581666

1659-
void gswip_disable_switch(struct gswip_priv *priv)
1660-
{
1661-
regmap_clear_bits(priv->mdio, GSWIP_MDIO_GLOB, GSWIP_MDIO_GLOB_ENABLE);
1662-
}
1663-
EXPORT_SYMBOL_GPL(gswip_disable_switch);
1664-
16651667
static int gswip_validate_cpu_port(struct dsa_switch *ds)
16661668
{
16671669
struct gswip_priv *priv = ds->priv;
@@ -1718,15 +1720,14 @@ int gswip_probe_common(struct gswip_priv *priv, u32 version)
17181720

17191721
err = gswip_validate_cpu_port(priv->ds);
17201722
if (err)
1721-
goto disable_switch;
1723+
goto unregister_switch;
17221724

17231725
dev_info(priv->dev, "probed GSWIP version %lx mod %lx\n",
17241726
GSWIP_VERSION_REV(version), GSWIP_VERSION_MOD(version));
17251727

17261728
return 0;
17271729

1728-
disable_switch:
1729-
gswip_disable_switch(priv);
1730+
unregister_switch:
17301731
dsa_unregister_switch(priv->ds);
17311732

17321733
return err;

drivers/net/dsa/lantiq/mxl-gsw1xx.c

Lines changed: 41 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@
1111

1212
#include <linux/bits.h>
1313
#include <linux/delay.h>
14+
#include <linux/jiffies.h>
1415
#include <linux/module.h>
1516
#include <linux/of_device.h>
1617
#include <linux/of_mdio.h>
1718
#include <linux/regmap.h>
19+
#include <linux/workqueue.h>
1820
#include <net/dsa.h>
1921

2022
#include "lantiq_gswip.h"
@@ -29,6 +31,7 @@ struct gsw1xx_priv {
2931
struct regmap *clk;
3032
struct regmap *shell;
3133
struct phylink_pcs pcs;
34+
struct delayed_work clear_raneg;
3235
phy_interface_t tbi_interface;
3336
struct gswip_priv gswip;
3437
};
@@ -145,7 +148,9 @@ static void gsw1xx_pcs_disable(struct phylink_pcs *pcs)
145148
{
146149
struct gsw1xx_priv *priv = pcs_to_gsw1xx(pcs);
147150

148-
/* Assert SGMII shell reset */
151+
cancel_delayed_work_sync(&priv->clear_raneg);
152+
153+
/* Assert SGMII shell reset (will also clear RANEG bit) */
149154
regmap_set_bits(priv->shell, GSW1XX_SHELL_RST_REQ,
150155
GSW1XX_RST_REQ_SGMII_SHELL);
151156

@@ -255,10 +260,16 @@ static int gsw1xx_pcs_reset(struct gsw1xx_priv *priv)
255260
FIELD_PREP(GSW1XX_SGMII_PHY_RX0_CFG2_FILT_CNT,
256261
GSW1XX_SGMII_PHY_RX0_CFG2_FILT_CNT_DEF);
257262

258-
/* TODO: Take care of inverted RX pair once generic property is
263+
/* RX lane seems to be inverted internally, so bit
264+
* GSW1XX_SGMII_PHY_RX0_CFG2_INVERT needs to be set for normal
265+
* (ie. non-inverted) operation.
266+
*
267+
* TODO: Take care of inverted RX pair once generic property is
259268
* available
260269
*/
261270

271+
val |= GSW1XX_SGMII_PHY_RX0_CFG2_INVERT;
272+
262273
ret = regmap_write(priv->sgmii, GSW1XX_SGMII_PHY_RX0_CFG2, val);
263274
if (ret < 0)
264275
return ret;
@@ -422,12 +433,29 @@ static int gsw1xx_pcs_config(struct phylink_pcs *pcs, unsigned int neg_mode,
422433
return 0;
423434
}
424435

436+
static void gsw1xx_pcs_clear_raneg(struct work_struct *work)
437+
{
438+
struct gsw1xx_priv *priv =
439+
container_of(work, struct gsw1xx_priv, clear_raneg.work);
440+
441+
regmap_clear_bits(priv->sgmii, GSW1XX_SGMII_TBI_ANEGCTL,
442+
GSW1XX_SGMII_TBI_ANEGCTL_RANEG);
443+
}
444+
425445
static void gsw1xx_pcs_an_restart(struct phylink_pcs *pcs)
426446
{
427447
struct gsw1xx_priv *priv = pcs_to_gsw1xx(pcs);
428448

449+
cancel_delayed_work_sync(&priv->clear_raneg);
450+
429451
regmap_set_bits(priv->sgmii, GSW1XX_SGMII_TBI_ANEGCTL,
430452
GSW1XX_SGMII_TBI_ANEGCTL_RANEG);
453+
454+
/* despite being documented as self-clearing, the RANEG bit
455+
* sometimes remains set, preventing auto-negotiation from happening.
456+
* MaxLinear advises to manually clear the bit after 10ms.
457+
*/
458+
schedule_delayed_work(&priv->clear_raneg, msecs_to_jiffies(10));
431459
}
432460

433461
static void gsw1xx_pcs_link_up(struct phylink_pcs *pcs,
@@ -630,6 +658,8 @@ static int gsw1xx_probe(struct mdio_device *mdiodev)
630658
if (ret)
631659
return ret;
632660

661+
INIT_DELAYED_WORK(&priv->clear_raneg, gsw1xx_pcs_clear_raneg);
662+
633663
ret = gswip_probe_common(&priv->gswip, version);
634664
if (ret)
635665
return ret;
@@ -642,25 +672,31 @@ static int gsw1xx_probe(struct mdio_device *mdiodev)
642672
static void gsw1xx_remove(struct mdio_device *mdiodev)
643673
{
644674
struct gswip_priv *priv = dev_get_drvdata(&mdiodev->dev);
675+
struct gsw1xx_priv *gsw1xx_priv;
645676

646677
if (!priv)
647678
return;
648679

649-
gswip_disable_switch(priv);
650-
651680
dsa_unregister_switch(priv->ds);
681+
682+
gsw1xx_priv = container_of(priv, struct gsw1xx_priv, gswip);
683+
cancel_delayed_work_sync(&gsw1xx_priv->clear_raneg);
652684
}
653685

654686
static void gsw1xx_shutdown(struct mdio_device *mdiodev)
655687
{
656688
struct gswip_priv *priv = dev_get_drvdata(&mdiodev->dev);
689+
struct gsw1xx_priv *gsw1xx_priv;
657690

658691
if (!priv)
659692
return;
660693

694+
dsa_switch_shutdown(priv->ds);
695+
661696
dev_set_drvdata(&mdiodev->dev, NULL);
662697

663-
gswip_disable_switch(priv);
698+
gsw1xx_priv = container_of(priv, struct gsw1xx_priv, gswip);
699+
cancel_delayed_work_sync(&gsw1xx_priv->clear_raneg);
664700
}
665701

666702
static const struct gswip_hw_info gsw12x_data = {

0 commit comments

Comments
 (0)