Skip to content

Commit 5fc3193

Browse files
committed
Merge tag 'net-6.14-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Pull networking fixes from Paolo Abeni: "Including fixes from can, bluetooth and ipsec. This contains a last minute revert of a recent GRE patch, mostly to allow me stating there are no known regressions outstanding. Current release - regressions: - revert "gre: Fix IPv6 link-local address generation." - eth: ti: am65-cpsw: fix NAPI registration sequence Previous releases - regressions: - ipv6: fix memleak of nhc_pcpu_rth_output in fib_check_nh_v6_gw(). - mptcp: fix data stream corruption in the address announcement - bluetooth: fix connection regression between LE and non-LE adapters - can: - flexcan: only change CAN state when link up in system PM - ucan: fix out of bound read in strscpy() source Previous releases - always broken: - lwtunnel: fix reentry loops - ipv6: fix TCP GSO segmentation with NAT - xfrm: force software GSO only in tunnel mode - eth: ti: icssg-prueth: add lock to stats Misc: - add Andrea Mayer as a maintainer of SRv6" * tag 'net-6.14-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (33 commits) MAINTAINERS: Add Andrea Mayer as a maintainer of SRv6 Revert "gre: Fix IPv6 link-local address generation." Revert "selftests: Add IPv6 link-local address generation tests for GRE devices." net/neighbor: add missing policy for NDTPA_QUEUE_LENBYTES tools headers: Sync uapi/asm-generic/socket.h with the kernel sources mptcp: Fix data stream corruption in the address announcement selftests: net: test for lwtunnel dst ref loops net: ipv6: ioam6: fix lwtunnel_output() loop net: lwtunnel: fix recursion loops net: ti: icssg-prueth: Add lock to stats net: atm: fix use after free in lec_send() xsk: fix an integer overflow in xp_create_and_assign_umem() net: stmmac: dwc-qos-eth: use devm_kzalloc() for AXI data selftests: drv-net: use defer in the ping test phy: fix xa_alloc_cyclic() error handling dpll: fix xa_alloc_cyclic() error handling devlink: fix xa_alloc_cyclic() error handling ipv6: Set errno after ip_fib_metrics_init() in ip6_route_info_create(). ipv6: Fix memleak of nhc_pcpu_rth_output in fib_check_nh_v6_gw(). net: ipv6: fix TCP GSO segmentation with NAT ...
2 parents 80c4c25 + feaee98 commit 5fc3193

File tree

38 files changed

+560
-334
lines changed

38 files changed

+560
-334
lines changed

Documentation/devicetree/bindings/net/can/renesas,rcar-canfd.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ allOf:
170170
const: renesas,r8a779h0-canfd
171171
then:
172172
patternProperties:
173-
"^channel[5-7]$": false
173+
"^channel[4-7]$": false
174174
else:
175175
if:
176176
not:

MAINTAINERS

+11
Original file line numberDiff line numberDiff line change
@@ -16660,6 +16660,17 @@ F: net/mptcp/
1666016660
F: tools/testing/selftests/bpf/*/*mptcp*.[ch]
1666116661
F: tools/testing/selftests/net/mptcp/
1666216662

16663+
NETWORKING [SRv6]
16664+
M: Andrea Mayer <[email protected]>
16665+
16666+
S: Maintained
16667+
T: git git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git
16668+
F: include/linux/seg6*
16669+
F: include/net/seg6*
16670+
F: include/uapi/linux/seg6*
16671+
F: net/ipv6/seg6*
16672+
F: tools/testing/selftests/net/srv6*
16673+
1666316674
NETWORKING [TCP]
1666416675
M: Eric Dumazet <[email protected]>
1666516676
M: Neal Cardwell <[email protected]>

drivers/dpll/dpll_core.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,7 @@ dpll_pin_alloc(u64 clock_id, u32 pin_idx, struct module *module,
505505
xa_init_flags(&pin->parent_refs, XA_FLAGS_ALLOC);
506506
ret = xa_alloc_cyclic(&dpll_pin_xa, &pin->id, pin, xa_limit_32b,
507507
&dpll_pin_xa_id, GFP_KERNEL);
508-
if (ret)
508+
if (ret < 0)
509509
goto err_xa_alloc;
510510
return pin;
511511
err_xa_alloc:

drivers/net/can/flexcan/flexcan-core.c

+15-3
Original file line numberDiff line numberDiff line change
@@ -2260,14 +2260,19 @@ static int __maybe_unused flexcan_suspend(struct device *device)
22602260

22612261
flexcan_chip_interrupts_disable(dev);
22622262

2263+
err = flexcan_transceiver_disable(priv);
2264+
if (err)
2265+
return err;
2266+
22632267
err = pinctrl_pm_select_sleep_state(device);
22642268
if (err)
22652269
return err;
22662270
}
22672271
netif_stop_queue(dev);
22682272
netif_device_detach(dev);
2273+
2274+
priv->can.state = CAN_STATE_SLEEPING;
22692275
}
2270-
priv->can.state = CAN_STATE_SLEEPING;
22712276

22722277
return 0;
22732278
}
@@ -2278,7 +2283,6 @@ static int __maybe_unused flexcan_resume(struct device *device)
22782283
struct flexcan_priv *priv = netdev_priv(dev);
22792284
int err;
22802285

2281-
priv->can.state = CAN_STATE_ERROR_ACTIVE;
22822286
if (netif_running(dev)) {
22832287
netif_device_attach(dev);
22842288
netif_start_queue(dev);
@@ -2292,12 +2296,20 @@ static int __maybe_unused flexcan_resume(struct device *device)
22922296
if (err)
22932297
return err;
22942298

2295-
err = flexcan_chip_start(dev);
2299+
err = flexcan_transceiver_enable(priv);
22962300
if (err)
22972301
return err;
22982302

2303+
err = flexcan_chip_start(dev);
2304+
if (err) {
2305+
flexcan_transceiver_disable(priv);
2306+
return err;
2307+
}
2308+
22992309
flexcan_chip_interrupts_enable(dev);
23002310
}
2311+
2312+
priv->can.state = CAN_STATE_ERROR_ACTIVE;
23012313
}
23022314

23032315
return 0;

drivers/net/can/rcar/rcar_canfd.c

+11-17
Original file line numberDiff line numberDiff line change
@@ -787,22 +787,14 @@ static void rcar_canfd_configure_controller(struct rcar_canfd_global *gpriv)
787787
}
788788

789789
static void rcar_canfd_configure_afl_rules(struct rcar_canfd_global *gpriv,
790-
u32 ch)
790+
u32 ch, u32 rule_entry)
791791
{
792-
u32 cfg;
793-
int offset, start, page, num_rules = RCANFD_CHANNEL_NUMRULES;
792+
int offset, page, num_rules = RCANFD_CHANNEL_NUMRULES;
793+
u32 rule_entry_index = rule_entry % 16;
794794
u32 ridx = ch + RCANFD_RFFIFO_IDX;
795795

796-
if (ch == 0) {
797-
start = 0; /* Channel 0 always starts from 0th rule */
798-
} else {
799-
/* Get number of Channel 0 rules and adjust */
800-
cfg = rcar_canfd_read(gpriv->base, RCANFD_GAFLCFG(ch));
801-
start = RCANFD_GAFLCFG_GETRNC(gpriv, 0, cfg);
802-
}
803-
804796
/* Enable write access to entry */
805-
page = RCANFD_GAFL_PAGENUM(start);
797+
page = RCANFD_GAFL_PAGENUM(rule_entry);
806798
rcar_canfd_set_bit(gpriv->base, RCANFD_GAFLECTR,
807799
(RCANFD_GAFLECTR_AFLPN(gpriv, page) |
808800
RCANFD_GAFLECTR_AFLDAE));
@@ -818,13 +810,13 @@ static void rcar_canfd_configure_afl_rules(struct rcar_canfd_global *gpriv,
818810
offset = RCANFD_C_GAFL_OFFSET;
819811

820812
/* Accept all IDs */
821-
rcar_canfd_write(gpriv->base, RCANFD_GAFLID(offset, start), 0);
813+
rcar_canfd_write(gpriv->base, RCANFD_GAFLID(offset, rule_entry_index), 0);
822814
/* IDE or RTR is not considered for matching */
823-
rcar_canfd_write(gpriv->base, RCANFD_GAFLM(offset, start), 0);
815+
rcar_canfd_write(gpriv->base, RCANFD_GAFLM(offset, rule_entry_index), 0);
824816
/* Any data length accepted */
825-
rcar_canfd_write(gpriv->base, RCANFD_GAFLP0(offset, start), 0);
817+
rcar_canfd_write(gpriv->base, RCANFD_GAFLP0(offset, rule_entry_index), 0);
826818
/* Place the msg in corresponding Rx FIFO entry */
827-
rcar_canfd_set_bit(gpriv->base, RCANFD_GAFLP1(offset, start),
819+
rcar_canfd_set_bit(gpriv->base, RCANFD_GAFLP1(offset, rule_entry_index),
828820
RCANFD_GAFLP1_GAFLFDP(ridx));
829821

830822
/* Disable write access to page */
@@ -1851,6 +1843,7 @@ static int rcar_canfd_probe(struct platform_device *pdev)
18511843
unsigned long channels_mask = 0;
18521844
int err, ch_irq, g_irq;
18531845
int g_err_irq, g_recc_irq;
1846+
u32 rule_entry = 0;
18541847
bool fdmode = true; /* CAN FD only mode - default */
18551848
char name[9] = "channelX";
18561849
int i;
@@ -2023,7 +2016,8 @@ static int rcar_canfd_probe(struct platform_device *pdev)
20232016
rcar_canfd_configure_tx(gpriv, ch);
20242017

20252018
/* Configure receive rules */
2026-
rcar_canfd_configure_afl_rules(gpriv, ch);
2019+
rcar_canfd_configure_afl_rules(gpriv, ch, rule_entry);
2020+
rule_entry += RCANFD_CHANNEL_NUMRULES;
20272021
}
20282022

20292023
/* Configure common interrupts */

drivers/net/can/usb/ucan.c

+18-25
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ union ucan_ctl_payload {
186186
*/
187187
struct ucan_ctl_cmd_get_protocol_version cmd_get_protocol_version;
188188

189-
u8 raw[128];
189+
u8 fw_str[128];
190190
} __packed;
191191

192192
enum {
@@ -424,18 +424,20 @@ static int ucan_ctrl_command_out(struct ucan_priv *up,
424424
UCAN_USB_CTL_PIPE_TIMEOUT);
425425
}
426426

427-
static int ucan_device_request_in(struct ucan_priv *up,
428-
u8 cmd, u16 subcmd, u16 datalen)
427+
static void ucan_get_fw_str(struct ucan_priv *up, char *fw_str, size_t size)
429428
{
430-
return usb_control_msg(up->udev,
431-
usb_rcvctrlpipe(up->udev, 0),
432-
cmd,
433-
USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
434-
subcmd,
435-
0,
436-
up->ctl_msg_buffer,
437-
datalen,
438-
UCAN_USB_CTL_PIPE_TIMEOUT);
429+
int ret;
430+
431+
ret = usb_control_msg(up->udev, usb_rcvctrlpipe(up->udev, 0),
432+
UCAN_DEVICE_GET_FW_STRING,
433+
USB_DIR_IN | USB_TYPE_VENDOR |
434+
USB_RECIP_DEVICE,
435+
0, 0, fw_str, size - 1,
436+
UCAN_USB_CTL_PIPE_TIMEOUT);
437+
if (ret > 0)
438+
fw_str[ret] = '\0';
439+
else
440+
strscpy(fw_str, "unknown", size);
439441
}
440442

441443
/* Parse the device information structure reported by the device and
@@ -1314,7 +1316,6 @@ static int ucan_probe(struct usb_interface *intf,
13141316
u8 in_ep_addr;
13151317
u8 out_ep_addr;
13161318
union ucan_ctl_payload *ctl_msg_buffer;
1317-
char firmware_str[sizeof(union ucan_ctl_payload) + 1];
13181319

13191320
udev = interface_to_usbdev(intf);
13201321

@@ -1527,17 +1528,6 @@ static int ucan_probe(struct usb_interface *intf,
15271528
*/
15281529
ucan_parse_device_info(up, &ctl_msg_buffer->cmd_get_device_info);
15291530

1530-
/* just print some device information - if available */
1531-
ret = ucan_device_request_in(up, UCAN_DEVICE_GET_FW_STRING, 0,
1532-
sizeof(union ucan_ctl_payload));
1533-
if (ret > 0) {
1534-
/* copy string while ensuring zero termination */
1535-
strscpy(firmware_str, up->ctl_msg_buffer->raw,
1536-
sizeof(union ucan_ctl_payload) + 1);
1537-
} else {
1538-
strcpy(firmware_str, "unknown");
1539-
}
1540-
15411531
/* device is compatible, reset it */
15421532
ret = ucan_ctrl_command_out(up, UCAN_COMMAND_RESET, 0, 0);
15431533
if (ret < 0)
@@ -1555,7 +1545,10 @@ static int ucan_probe(struct usb_interface *intf,
15551545

15561546
/* initialisation complete, log device info */
15571547
netdev_info(up->netdev, "registered device\n");
1558-
netdev_info(up->netdev, "firmware string: %s\n", firmware_str);
1548+
ucan_get_fw_str(up, up->ctl_msg_buffer->fw_str,
1549+
sizeof(up->ctl_msg_buffer->fw_str));
1550+
netdev_info(up->netdev, "firmware string: %s\n",
1551+
up->ctl_msg_buffer->fw_str);
15591552

15601553
/* success */
15611554
return 0;

drivers/net/ethernet/microsoft/mana/gdma_main.c

+10-4
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,10 @@ static int mana_gd_detect_devices(struct pci_dev *pdev)
134134
struct gdma_list_devices_resp resp = {};
135135
struct gdma_general_req req = {};
136136
struct gdma_dev_id dev;
137-
u32 i, max_num_devs;
137+
int found_dev = 0;
138138
u16 dev_type;
139139
int err;
140+
u32 i;
140141

141142
mana_gd_init_req_hdr(&req.hdr, GDMA_LIST_DEVICES, sizeof(req),
142143
sizeof(resp));
@@ -148,12 +149,17 @@ static int mana_gd_detect_devices(struct pci_dev *pdev)
148149
return err ? err : -EPROTO;
149150
}
150151

151-
max_num_devs = min_t(u32, MAX_NUM_GDMA_DEVICES, resp.num_of_devs);
152-
153-
for (i = 0; i < max_num_devs; i++) {
152+
for (i = 0; i < GDMA_DEV_LIST_SIZE &&
153+
found_dev < resp.num_of_devs; i++) {
154154
dev = resp.devs[i];
155155
dev_type = dev.type;
156156

157+
/* Skip empty devices */
158+
if (dev.as_uint32 == 0)
159+
continue;
160+
161+
found_dev++;
162+
157163
/* HWC is already detected in mana_hwc_create_channel(). */
158164
if (dev_type == GDMA_DEVICE_HWC)
159165
continue;

drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ static int dwc_eth_dwmac_config_dt(struct platform_device *pdev,
4646
u32 a_index = 0;
4747

4848
if (!plat_dat->axi) {
49-
plat_dat->axi = kzalloc(sizeof(struct stmmac_axi), GFP_KERNEL);
49+
plat_dat->axi = devm_kzalloc(&pdev->dev,
50+
sizeof(struct stmmac_axi),
51+
GFP_KERNEL);
5052

5153
if (!plat_dat->axi)
5254
return -ENOMEM;

drivers/net/ethernet/ti/am65-cpsw-nuss.c

+18-14
Original file line numberDiff line numberDiff line change
@@ -2306,14 +2306,18 @@ static void am65_cpsw_nuss_remove_tx_chns(struct am65_cpsw_common *common)
23062306
static int am65_cpsw_nuss_ndev_add_tx_napi(struct am65_cpsw_common *common)
23072307
{
23082308
struct device *dev = common->dev;
2309+
struct am65_cpsw_tx_chn *tx_chn;
23092310
int i, ret = 0;
23102311

23112312
for (i = 0; i < common->tx_ch_num; i++) {
2312-
struct am65_cpsw_tx_chn *tx_chn = &common->tx_chns[i];
2313+
tx_chn = &common->tx_chns[i];
23132314

23142315
hrtimer_init(&tx_chn->tx_hrtimer, CLOCK_MONOTONIC, HRTIMER_MODE_REL_PINNED);
23152316
tx_chn->tx_hrtimer.function = &am65_cpsw_nuss_tx_timer_callback;
23162317

2318+
netif_napi_add_tx(common->dma_ndev, &tx_chn->napi_tx,
2319+
am65_cpsw_nuss_tx_poll);
2320+
23172321
ret = devm_request_irq(dev, tx_chn->irq,
23182322
am65_cpsw_nuss_tx_irq,
23192323
IRQF_TRIGGER_HIGH,
@@ -2323,19 +2327,16 @@ static int am65_cpsw_nuss_ndev_add_tx_napi(struct am65_cpsw_common *common)
23232327
tx_chn->id, tx_chn->irq, ret);
23242328
goto err;
23252329
}
2326-
2327-
netif_napi_add_tx(common->dma_ndev, &tx_chn->napi_tx,
2328-
am65_cpsw_nuss_tx_poll);
23292330
}
23302331

23312332
return 0;
23322333

23332334
err:
2334-
for (--i ; i >= 0 ; i--) {
2335-
struct am65_cpsw_tx_chn *tx_chn = &common->tx_chns[i];
2336-
2337-
netif_napi_del(&tx_chn->napi_tx);
2335+
netif_napi_del(&tx_chn->napi_tx);
2336+
for (--i; i >= 0; i--) {
2337+
tx_chn = &common->tx_chns[i];
23382338
devm_free_irq(dev, tx_chn->irq, tx_chn);
2339+
netif_napi_del(&tx_chn->napi_tx);
23392340
}
23402341

23412342
return ret;
@@ -2569,6 +2570,9 @@ static int am65_cpsw_nuss_init_rx_chns(struct am65_cpsw_common *common)
25692570
HRTIMER_MODE_REL_PINNED);
25702571
flow->rx_hrtimer.function = &am65_cpsw_nuss_rx_timer_callback;
25712572

2573+
netif_napi_add(common->dma_ndev, &flow->napi_rx,
2574+
am65_cpsw_nuss_rx_poll);
2575+
25722576
ret = devm_request_irq(dev, flow->irq,
25732577
am65_cpsw_nuss_rx_irq,
25742578
IRQF_TRIGGER_HIGH,
@@ -2577,23 +2581,23 @@ static int am65_cpsw_nuss_init_rx_chns(struct am65_cpsw_common *common)
25772581
dev_err(dev, "failure requesting rx %d irq %u, %d\n",
25782582
i, flow->irq, ret);
25792583
flow->irq = -EINVAL;
2580-
goto err_flow;
2584+
goto err_request_irq;
25812585
}
2582-
2583-
netif_napi_add(common->dma_ndev, &flow->napi_rx,
2584-
am65_cpsw_nuss_rx_poll);
25852586
}
25862587

25872588
/* setup classifier to route priorities to flows */
25882589
cpsw_ale_classifier_setup_default(common->ale, common->rx_ch_num_flows);
25892590

25902591
return 0;
25912592

2593+
err_request_irq:
2594+
netif_napi_del(&flow->napi_rx);
2595+
25922596
err_flow:
2593-
for (--i; i >= 0 ; i--) {
2597+
for (--i; i >= 0; i--) {
25942598
flow = &rx_chn->flows[i];
2595-
netif_napi_del(&flow->napi_rx);
25962599
devm_free_irq(dev, flow->irq, flow);
2600+
netif_napi_del(&flow->napi_rx);
25972601
}
25982602

25992603
err:

drivers/net/ethernet/ti/icssg/icssg_prueth.c

+1
Original file line numberDiff line numberDiff line change
@@ -1679,6 +1679,7 @@ static int prueth_probe(struct platform_device *pdev)
16791679
}
16801680

16811681
spin_lock_init(&prueth->vtbl_lock);
1682+
spin_lock_init(&prueth->stats_lock);
16821683
/* setup netdev interfaces */
16831684
if (eth0_node) {
16841685
ret = prueth_netdev_init(prueth, eth0_node);

drivers/net/ethernet/ti/icssg/icssg_prueth.h

+2
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,8 @@ struct prueth {
305305
int default_vlan;
306306
/** @vtbl_lock: Lock for vtbl in shared memory */
307307
spinlock_t vtbl_lock;
308+
/** @stats_lock: Lock for reading icssg stats */
309+
spinlock_t stats_lock;
308310
};
309311

310312
struct emac_tx_ts_response {

drivers/net/ethernet/ti/icssg/icssg_stats.c

+4
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ void emac_update_hardware_stats(struct prueth_emac *emac)
2626
u32 val, reg;
2727
int i;
2828

29+
spin_lock(&prueth->stats_lock);
30+
2931
for (i = 0; i < ARRAY_SIZE(icssg_all_miig_stats); i++) {
3032
regmap_read(prueth->miig_rt,
3133
base + icssg_all_miig_stats[i].offset,
@@ -51,6 +53,8 @@ void emac_update_hardware_stats(struct prueth_emac *emac)
5153
emac->pa_stats[i] += val;
5254
}
5355
}
56+
57+
spin_unlock(&prueth->stats_lock);
5458
}
5559

5660
void icssg_stats_work_handler(struct work_struct *work)

0 commit comments

Comments
 (0)