Skip to content

Commit 1f594fe

Browse files
committed
Merge tag 'net-6.4-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Pull networking fixes from Paolo Abeni: "Including fixes from can, xfrm, bluetooth and netfilter. Current release - regressions: - ipv6: fix RCU splat in ipv6_route_seq_show() - wifi: iwlwifi: disable RFI feature Previous releases - regressions: - tcp: fix possible sk_priority leak in tcp_v4_send_reset() - tipc: do not update mtu if msg_max is too small in mtu negotiation - netfilter: fix null deref on element insertion - devlink: change per-devlink netdev notifier to static one - phylink: fix ksettings_set() ethtool call - wifi: mac80211: fortify the spinlock against deadlock by interrupt - wifi: brcmfmac: check for probe() id argument being NULL - eth: ice: - fix undersized tx_flags variable - fix ice VF reset during iavf initialization - eth: hns3: fix sending pfc frames after reset issue Previous releases - always broken: - xfrm: release all offloaded policy memory - nsh: use correct mac_offset to unwind gso skb in nsh_gso_segment() - vsock: avoid to close connected socket after the timeout - dsa: rzn1-a5psw: enable management frames for CPU port - eth: virtio_net: fix error unwinding of XDP initialization - eth: tun: fix memory leak for detached NAPI queue. Misc: - MAINTAINERS: sctp: move Neil to CREDITS" * tag 'net-6.4-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (107 commits) MAINTAINERS: skip CCing netdev for Bluetooth patches mdio_bus: unhide mdio_bus_init prototype bridge: always declare tunnel functions atm: hide unused procfs functions net: isa: include net/Space.h Revert "ARM: dts: stm32: add CAN support on stm32f746" netfilter: nft_set_rbtree: fix null deref on element insertion netfilter: nf_tables: fix nft_trans type confusion netfilter: conntrack: define variables exp_nat_nla_policy and any_addr with CONFIG_NF_NAT net: wwan: t7xx: Ensure init is completed before system sleep net: selftests: Fix optstring net: pcs: xpcs: fix C73 AN not getting enabled net: wwan: iosm: fix NULL pointer dereference when removing device vlan: fix a potential uninit-value in vlan_dev_hard_start_xmit() mailmap: add entries for Nikolay Aleksandrov igb: fix bit_shift to be in [1..8] range net: dsa: mv88e6xxx: Fix mv88e6393x EPC write command offset cassini: Fix a memory leak in the error handling path of cas_init_one() tun: Fix memory leak for detached NAPI queue. can: kvaser_pciefd: Disable interrupts in probe error path ...
2 parents b802651 + 6e42fae commit 1f594fe

File tree

123 files changed

+878
-455
lines changed

Some content is hidden

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

123 files changed

+878
-455
lines changed

.mailmap

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,11 @@ Nicolas Pitre <[email protected]> <[email protected]>
364364
Nicolas Saenz Julienne <[email protected]> <[email protected]>
365365
Nicolas Saenz Julienne <[email protected]> <[email protected]>
366366
Niklas Söderlund <[email protected]>
367+
Nikolay Aleksandrov <[email protected]> <[email protected]>
368+
Nikolay Aleksandrov <[email protected]> <[email protected]>
369+
Nikolay Aleksandrov <[email protected]> <[email protected]>
370+
Nikolay Aleksandrov <[email protected]> <[email protected]>
371+
Nikolay Aleksandrov <[email protected]> <[email protected]>
367372
Oleksandr Natalenko <[email protected]> <[email protected]>
368373
369374

CREDITS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1706,6 +1706,10 @@ S: Panoramastrasse 18
17061706
S: D-69126 Heidelberg
17071707
S: Germany
17081708

1709+
N: Neil Horman
1710+
1711+
D: SCTP protocol maintainer.
1712+
17091713
N: Simon Horman
17101714
17111715
D: Renesas ARM/ARM64 SoC maintainer

Documentation/devicetree/bindings/net/can/st,stm32-bxcan.yaml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,22 @@ properties:
2121

2222
st,can-primary:
2323
description:
24-
Primary and secondary mode of the bxCAN peripheral is only relevant
25-
if the chip has two CAN peripherals. In that case they share some
26-
of the required logic.
24+
Primary mode of the bxCAN peripheral is only relevant if the chip has
25+
two CAN peripherals in dual CAN configuration. In that case they share
26+
some of the required logic.
27+
Not to be used if the peripheral is in single CAN configuration.
2728
To avoid misunderstandings, it should be noted that ST documentation
28-
uses the terms master/slave instead of primary/secondary.
29+
uses the terms master instead of primary.
30+
type: boolean
31+
32+
st,can-secondary:
33+
description:
34+
Secondary mode of the bxCAN peripheral is only relevant if the chip
35+
has two CAN peripherals in dual CAN configuration. In that case they
36+
share some of the required logic.
37+
Not to be used if the peripheral is in single CAN configuration.
38+
To avoid misunderstandings, it should be noted that ST documentation
39+
uses the terms slave instead of secondary.
2940
type: boolean
3041

3142
reg:

MAINTAINERS

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6211,6 +6211,7 @@ X: Documentation/devicetree/
62116211
X: Documentation/driver-api/media/
62126212
X: Documentation/firmware-guide/acpi/
62136213
X: Documentation/i2c/
6214+
X: Documentation/netlink/
62146215
X: Documentation/power/
62156216
X: Documentation/spi/
62166217
X: Documentation/userspace-api/media/
@@ -14566,6 +14567,7 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git
1456614567
F: Documentation/devicetree/bindings/net/
1456714568
F: drivers/connector/
1456814569
F: drivers/net/
14570+
X: drivers/net/wireless/
1456914571
F: include/dt-bindings/net/
1457014572
F: include/linux/etherdevice.h
1457114573
F: include/linux/fcdevice.h
@@ -14615,6 +14617,7 @@ B: mailto:[email protected]
1461514617
T: git git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git
1461614618
T: git git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git
1461714619
F: Documentation/core-api/netlink.rst
14620+
F: Documentation/netlink/
1461814621
F: Documentation/networking/
1461914622
F: Documentation/process/maintainer-netdev.rst
1462014623
F: Documentation/userspace-api/netlink/
@@ -14629,6 +14632,7 @@ F: include/uapi/linux/netdevice.h
1462914632
F: lib/net_utils.c
1463014633
F: lib/random32.c
1463114634
F: net/
14635+
X: net/bluetooth/
1463214636
F: tools/net/
1463314637
F: tools/testing/selftests/net/
1463414638

@@ -18842,12 +18846,11 @@ F: drivers/target/
1884218846
F: include/target/
1884318847

1884418848
SCTP PROTOCOL
18845-
M: Neil Horman <[email protected]>
1884618849
M: Marcelo Ricardo Leitner <[email protected]>
1884718850
M: Xin Long <[email protected]>
1884818851
1884918852
S: Maintained
18850-
W: http://lksctp.sourceforge.net
18853+
W: https://github.com/sctp/lksctp-tools/wiki
1885118854
F: Documentation/networking/sctp.rst
1885218855
F: include/linux/sctp.h
1885318856
F: include/net/sctp/

arch/arm/boot/dts/stm32f429.dtsi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,7 @@
387387
interrupt-names = "tx", "rx0", "rx1", "sce";
388388
resets = <&rcc STM32F4_APB1_RESET(CAN2)>;
389389
clocks = <&rcc 0 STM32F4_APB1_CLOCK(CAN2)>;
390+
st,can-secondary;
390391
st,gcan = <&gcan>;
391392
status = "disabled";
392393
};

arch/arm/boot/dts/stm32f7-pinctrl.dtsi

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,88 @@
283283
slew-rate = <2>;
284284
};
285285
};
286+
287+
can1_pins_a: can1-0 {
288+
pins1 {
289+
pinmux = <STM32_PINMUX('A', 12, AF9)>; /* CAN1_TX */
290+
};
291+
pins2 {
292+
pinmux = <STM32_PINMUX('A', 11, AF9)>; /* CAN1_RX */
293+
bias-pull-up;
294+
};
295+
};
296+
297+
can1_pins_b: can1-1 {
298+
pins1 {
299+
pinmux = <STM32_PINMUX('B', 9, AF9)>; /* CAN1_TX */
300+
};
301+
pins2 {
302+
pinmux = <STM32_PINMUX('B', 8, AF9)>; /* CAN1_RX */
303+
bias-pull-up;
304+
};
305+
};
306+
307+
can1_pins_c: can1-2 {
308+
pins1 {
309+
pinmux = <STM32_PINMUX('D', 1, AF9)>; /* CAN1_TX */
310+
};
311+
pins2 {
312+
pinmux = <STM32_PINMUX('D', 0, AF9)>; /* CAN1_RX */
313+
bias-pull-up;
314+
315+
};
316+
};
317+
318+
can1_pins_d: can1-3 {
319+
pins1 {
320+
pinmux = <STM32_PINMUX('H', 13, AF9)>; /* CAN1_TX */
321+
};
322+
pins2 {
323+
pinmux = <STM32_PINMUX('H', 14, AF9)>; /* CAN1_RX */
324+
bias-pull-up;
325+
326+
};
327+
};
328+
329+
can2_pins_a: can2-0 {
330+
pins1 {
331+
pinmux = <STM32_PINMUX('B', 6, AF9)>; /* CAN2_TX */
332+
};
333+
pins2 {
334+
pinmux = <STM32_PINMUX('B', 5, AF9)>; /* CAN2_RX */
335+
bias-pull-up;
336+
};
337+
};
338+
339+
can2_pins_b: can2-1 {
340+
pins1 {
341+
pinmux = <STM32_PINMUX('B', 13, AF9)>; /* CAN2_TX */
342+
};
343+
pins2 {
344+
pinmux = <STM32_PINMUX('B', 12, AF9)>; /* CAN2_RX */
345+
bias-pull-up;
346+
};
347+
};
348+
349+
can3_pins_a: can3-0 {
350+
pins1 {
351+
pinmux = <STM32_PINMUX('A', 15, AF11)>; /* CAN3_TX */
352+
};
353+
pins2 {
354+
pinmux = <STM32_PINMUX('A', 8, AF11)>; /* CAN3_RX */
355+
bias-pull-up;
356+
};
357+
};
358+
359+
can3_pins_b: can3-1 {
360+
pins1 {
361+
pinmux = <STM32_PINMUX('B', 4, AF11)>; /* CAN3_TX */
362+
};
363+
pins2 {
364+
pinmux = <STM32_PINMUX('B', 3, AF11)>; /* CAN3_RX */
365+
bias-pull-up;
366+
};
367+
};
286368
};
287369
};
288370
};

drivers/net/can/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ config CAN_AT91
9595

9696
config CAN_BXCAN
9797
tristate "STM32 Basic Extended CAN (bxCAN) devices"
98-
depends on OF || ARCH_STM32 || COMPILE_TEST
98+
depends on ARCH_STM32 || COMPILE_TEST
9999
depends on HAS_IOMEM
100100
select CAN_RX_OFFLOAD
101101
help

drivers/net/can/bxcan.c

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@
118118
#define BXCAN_FiR1_REG(b) (0x40 + (b) * 8)
119119
#define BXCAN_FiR2_REG(b) (0x44 + (b) * 8)
120120

121-
#define BXCAN_FILTER_ID(primary) (primary ? 0 : 14)
121+
#define BXCAN_FILTER_ID(cfg) ((cfg) == BXCAN_CFG_DUAL_SECONDARY ? 14 : 0)
122122

123123
/* Filter primary register (FMR) bits */
124124
#define BXCAN_FMR_CANSB_MASK GENMASK(13, 8)
@@ -135,6 +135,12 @@ enum bxcan_lec_code {
135135
BXCAN_LEC_UNUSED
136136
};
137137

138+
enum bxcan_cfg {
139+
BXCAN_CFG_SINGLE = 0,
140+
BXCAN_CFG_DUAL_PRIMARY,
141+
BXCAN_CFG_DUAL_SECONDARY
142+
};
143+
138144
/* Structure of the message buffer */
139145
struct bxcan_mb {
140146
u32 id; /* can identifier */
@@ -167,7 +173,7 @@ struct bxcan_priv {
167173
struct regmap *gcan;
168174
int tx_irq;
169175
int sce_irq;
170-
bool primary;
176+
enum bxcan_cfg cfg;
171177
struct clk *clk;
172178
spinlock_t rmw_lock; /* lock for read-modify-write operations */
173179
unsigned int tx_head;
@@ -202,17 +208,17 @@ static inline void bxcan_rmw(struct bxcan_priv *priv, void __iomem *addr,
202208
spin_unlock_irqrestore(&priv->rmw_lock, flags);
203209
}
204210

205-
static void bxcan_disable_filters(struct bxcan_priv *priv, bool primary)
211+
static void bxcan_disable_filters(struct bxcan_priv *priv, enum bxcan_cfg cfg)
206212
{
207-
unsigned int fid = BXCAN_FILTER_ID(primary);
213+
unsigned int fid = BXCAN_FILTER_ID(cfg);
208214
u32 fmask = BIT(fid);
209215

210216
regmap_update_bits(priv->gcan, BXCAN_FA1R_REG, fmask, 0);
211217
}
212218

213-
static void bxcan_enable_filters(struct bxcan_priv *priv, bool primary)
219+
static void bxcan_enable_filters(struct bxcan_priv *priv, enum bxcan_cfg cfg)
214220
{
215-
unsigned int fid = BXCAN_FILTER_ID(primary);
221+
unsigned int fid = BXCAN_FILTER_ID(cfg);
216222
u32 fmask = BIT(fid);
217223

218224
/* Filter settings:
@@ -680,7 +686,7 @@ static int bxcan_chip_start(struct net_device *ndev)
680686
BXCAN_BTR_BRP_MASK | BXCAN_BTR_TS1_MASK | BXCAN_BTR_TS2_MASK |
681687
BXCAN_BTR_SJW_MASK, set);
682688

683-
bxcan_enable_filters(priv, priv->primary);
689+
bxcan_enable_filters(priv, priv->cfg);
684690

685691
/* Clear all internal status */
686692
priv->tx_head = 0;
@@ -806,7 +812,7 @@ static void bxcan_chip_stop(struct net_device *ndev)
806812
BXCAN_IER_EPVIE | BXCAN_IER_EWGIE | BXCAN_IER_FOVIE1 |
807813
BXCAN_IER_FFIE1 | BXCAN_IER_FMPIE1 | BXCAN_IER_FOVIE0 |
808814
BXCAN_IER_FFIE0 | BXCAN_IER_FMPIE0 | BXCAN_IER_TMEIE, 0);
809-
bxcan_disable_filters(priv, priv->primary);
815+
bxcan_disable_filters(priv, priv->cfg);
810816
bxcan_enter_sleep_mode(priv);
811817
priv->can.state = CAN_STATE_STOPPED;
812818
}
@@ -931,7 +937,7 @@ static int bxcan_probe(struct platform_device *pdev)
931937
struct clk *clk = NULL;
932938
void __iomem *regs;
933939
struct regmap *gcan;
934-
bool primary;
940+
enum bxcan_cfg cfg;
935941
int err, rx_irq, tx_irq, sce_irq;
936942

937943
regs = devm_platform_ioremap_resource(pdev, 0);
@@ -946,7 +952,13 @@ static int bxcan_probe(struct platform_device *pdev)
946952
return PTR_ERR(gcan);
947953
}
948954

949-
primary = of_property_read_bool(np, "st,can-primary");
955+
if (of_property_read_bool(np, "st,can-primary"))
956+
cfg = BXCAN_CFG_DUAL_PRIMARY;
957+
else if (of_property_read_bool(np, "st,can-secondary"))
958+
cfg = BXCAN_CFG_DUAL_SECONDARY;
959+
else
960+
cfg = BXCAN_CFG_SINGLE;
961+
950962
clk = devm_clk_get(dev, NULL);
951963
if (IS_ERR(clk)) {
952964
dev_err(dev, "failed to get clock\n");
@@ -992,7 +1004,7 @@ static int bxcan_probe(struct platform_device *pdev)
9921004
priv->clk = clk;
9931005
priv->tx_irq = tx_irq;
9941006
priv->sce_irq = sce_irq;
995-
priv->primary = primary;
1007+
priv->cfg = cfg;
9961008
priv->can.clock.freq = clk_get_rate(clk);
9971009
spin_lock_init(&priv->rmw_lock);
9981010
priv->tx_head = 0;

drivers/net/can/dev/skb.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ int can_put_echo_skb(struct sk_buff *skb, struct net_device *dev,
5454
/* check flag whether this packet has to be looped back */
5555
if (!(dev->flags & IFF_ECHO) ||
5656
(skb->protocol != htons(ETH_P_CAN) &&
57-
skb->protocol != htons(ETH_P_CANFD))) {
57+
skb->protocol != htons(ETH_P_CANFD) &&
58+
skb->protocol != htons(ETH_P_CANXL))) {
5859
kfree_skb(skb);
5960
return 0;
6061
}

0 commit comments

Comments
 (0)