Skip to content

Commit

Permalink
Merge tag 'net-6.14-rc8' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/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
  ...
  • Loading branch information
Linus Torvalds committed Mar 20, 2025
2 parents 80c4c25 + feaee98 commit 5fc3193
Show file tree
Hide file tree
Showing 38 changed files with 560 additions and 334 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ allOf:
const: renesas,r8a779h0-canfd
then:
patternProperties:
"^channel[5-7]$": false
"^channel[4-7]$": false
else:
if:
not:
Expand Down
11 changes: 11 additions & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -16660,6 +16660,17 @@ F: net/mptcp/
F: tools/testing/selftests/bpf/*/*mptcp*.[ch]
F: tools/testing/selftests/net/mptcp/

NETWORKING [SRv6]
M: Andrea Mayer <andrea.mayer@uniroma2.it>
L: netdev@vger.kernel.org
S: Maintained
T: git git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git
F: include/linux/seg6*
F: include/net/seg6*
F: include/uapi/linux/seg6*
F: net/ipv6/seg6*
F: tools/testing/selftests/net/srv6*

NETWORKING [TCP]
M: Eric Dumazet <edumazet@google.com>
M: Neal Cardwell <ncardwell@google.com>
Expand Down
2 changes: 1 addition & 1 deletion drivers/dpll/dpll_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ dpll_pin_alloc(u64 clock_id, u32 pin_idx, struct module *module,
xa_init_flags(&pin->parent_refs, XA_FLAGS_ALLOC);
ret = xa_alloc_cyclic(&dpll_pin_xa, &pin->id, pin, xa_limit_32b,
&dpll_pin_xa_id, GFP_KERNEL);
if (ret)
if (ret < 0)
goto err_xa_alloc;
return pin;
err_xa_alloc:
Expand Down
18 changes: 15 additions & 3 deletions drivers/net/can/flexcan/flexcan-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2260,14 +2260,19 @@ static int __maybe_unused flexcan_suspend(struct device *device)

flexcan_chip_interrupts_disable(dev);

err = flexcan_transceiver_disable(priv);
if (err)
return err;

err = pinctrl_pm_select_sleep_state(device);
if (err)
return err;
}
netif_stop_queue(dev);
netif_device_detach(dev);

priv->can.state = CAN_STATE_SLEEPING;
}
priv->can.state = CAN_STATE_SLEEPING;

return 0;
}
Expand All @@ -2278,7 +2283,6 @@ static int __maybe_unused flexcan_resume(struct device *device)
struct flexcan_priv *priv = netdev_priv(dev);
int err;

priv->can.state = CAN_STATE_ERROR_ACTIVE;
if (netif_running(dev)) {
netif_device_attach(dev);
netif_start_queue(dev);
Expand All @@ -2292,12 +2296,20 @@ static int __maybe_unused flexcan_resume(struct device *device)
if (err)
return err;

err = flexcan_chip_start(dev);
err = flexcan_transceiver_enable(priv);
if (err)
return err;

err = flexcan_chip_start(dev);
if (err) {
flexcan_transceiver_disable(priv);
return err;
}

flexcan_chip_interrupts_enable(dev);
}

priv->can.state = CAN_STATE_ERROR_ACTIVE;
}

return 0;
Expand Down
28 changes: 11 additions & 17 deletions drivers/net/can/rcar/rcar_canfd.c
Original file line number Diff line number Diff line change
Expand Up @@ -787,22 +787,14 @@ static void rcar_canfd_configure_controller(struct rcar_canfd_global *gpriv)
}

static void rcar_canfd_configure_afl_rules(struct rcar_canfd_global *gpriv,
u32 ch)
u32 ch, u32 rule_entry)
{
u32 cfg;
int offset, start, page, num_rules = RCANFD_CHANNEL_NUMRULES;
int offset, page, num_rules = RCANFD_CHANNEL_NUMRULES;
u32 rule_entry_index = rule_entry % 16;
u32 ridx = ch + RCANFD_RFFIFO_IDX;

if (ch == 0) {
start = 0; /* Channel 0 always starts from 0th rule */
} else {
/* Get number of Channel 0 rules and adjust */
cfg = rcar_canfd_read(gpriv->base, RCANFD_GAFLCFG(ch));
start = RCANFD_GAFLCFG_GETRNC(gpriv, 0, cfg);
}

/* Enable write access to entry */
page = RCANFD_GAFL_PAGENUM(start);
page = RCANFD_GAFL_PAGENUM(rule_entry);
rcar_canfd_set_bit(gpriv->base, RCANFD_GAFLECTR,
(RCANFD_GAFLECTR_AFLPN(gpriv, page) |
RCANFD_GAFLECTR_AFLDAE));
Expand All @@ -818,13 +810,13 @@ static void rcar_canfd_configure_afl_rules(struct rcar_canfd_global *gpriv,
offset = RCANFD_C_GAFL_OFFSET;

/* Accept all IDs */
rcar_canfd_write(gpriv->base, RCANFD_GAFLID(offset, start), 0);
rcar_canfd_write(gpriv->base, RCANFD_GAFLID(offset, rule_entry_index), 0);
/* IDE or RTR is not considered for matching */
rcar_canfd_write(gpriv->base, RCANFD_GAFLM(offset, start), 0);
rcar_canfd_write(gpriv->base, RCANFD_GAFLM(offset, rule_entry_index), 0);
/* Any data length accepted */
rcar_canfd_write(gpriv->base, RCANFD_GAFLP0(offset, start), 0);
rcar_canfd_write(gpriv->base, RCANFD_GAFLP0(offset, rule_entry_index), 0);
/* Place the msg in corresponding Rx FIFO entry */
rcar_canfd_set_bit(gpriv->base, RCANFD_GAFLP1(offset, start),
rcar_canfd_set_bit(gpriv->base, RCANFD_GAFLP1(offset, rule_entry_index),
RCANFD_GAFLP1_GAFLFDP(ridx));

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

/* Configure receive rules */
rcar_canfd_configure_afl_rules(gpriv, ch);
rcar_canfd_configure_afl_rules(gpriv, ch, rule_entry);
rule_entry += RCANFD_CHANNEL_NUMRULES;
}

/* Configure common interrupts */
Expand Down
43 changes: 18 additions & 25 deletions drivers/net/can/usb/ucan.c
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ union ucan_ctl_payload {
*/
struct ucan_ctl_cmd_get_protocol_version cmd_get_protocol_version;

u8 raw[128];
u8 fw_str[128];
} __packed;

enum {
Expand Down Expand Up @@ -424,18 +424,20 @@ static int ucan_ctrl_command_out(struct ucan_priv *up,
UCAN_USB_CTL_PIPE_TIMEOUT);
}

static int ucan_device_request_in(struct ucan_priv *up,
u8 cmd, u16 subcmd, u16 datalen)
static void ucan_get_fw_str(struct ucan_priv *up, char *fw_str, size_t size)
{
return usb_control_msg(up->udev,
usb_rcvctrlpipe(up->udev, 0),
cmd,
USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
subcmd,
0,
up->ctl_msg_buffer,
datalen,
UCAN_USB_CTL_PIPE_TIMEOUT);
int ret;

ret = usb_control_msg(up->udev, usb_rcvctrlpipe(up->udev, 0),
UCAN_DEVICE_GET_FW_STRING,
USB_DIR_IN | USB_TYPE_VENDOR |
USB_RECIP_DEVICE,
0, 0, fw_str, size - 1,
UCAN_USB_CTL_PIPE_TIMEOUT);
if (ret > 0)
fw_str[ret] = '\0';
else
strscpy(fw_str, "unknown", size);
}

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

udev = interface_to_usbdev(intf);

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

/* just print some device information - if available */
ret = ucan_device_request_in(up, UCAN_DEVICE_GET_FW_STRING, 0,
sizeof(union ucan_ctl_payload));
if (ret > 0) {
/* copy string while ensuring zero termination */
strscpy(firmware_str, up->ctl_msg_buffer->raw,
sizeof(union ucan_ctl_payload) + 1);
} else {
strcpy(firmware_str, "unknown");
}

/* device is compatible, reset it */
ret = ucan_ctrl_command_out(up, UCAN_COMMAND_RESET, 0, 0);
if (ret < 0)
Expand All @@ -1555,7 +1545,10 @@ static int ucan_probe(struct usb_interface *intf,

/* initialisation complete, log device info */
netdev_info(up->netdev, "registered device\n");
netdev_info(up->netdev, "firmware string: %s\n", firmware_str);
ucan_get_fw_str(up, up->ctl_msg_buffer->fw_str,
sizeof(up->ctl_msg_buffer->fw_str));
netdev_info(up->netdev, "firmware string: %s\n",
up->ctl_msg_buffer->fw_str);

/* success */
return 0;
Expand Down
14 changes: 10 additions & 4 deletions drivers/net/ethernet/microsoft/mana/gdma_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,10 @@ static int mana_gd_detect_devices(struct pci_dev *pdev)
struct gdma_list_devices_resp resp = {};
struct gdma_general_req req = {};
struct gdma_dev_id dev;
u32 i, max_num_devs;
int found_dev = 0;
u16 dev_type;
int err;
u32 i;

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

max_num_devs = min_t(u32, MAX_NUM_GDMA_DEVICES, resp.num_of_devs);

for (i = 0; i < max_num_devs; i++) {
for (i = 0; i < GDMA_DEV_LIST_SIZE &&
found_dev < resp.num_of_devs; i++) {
dev = resp.devs[i];
dev_type = dev.type;

/* Skip empty devices */
if (dev.as_uint32 == 0)
continue;

found_dev++;

/* HWC is already detected in mana_hwc_create_channel(). */
if (dev_type == GDMA_DEVICE_HWC)
continue;
Expand Down
4 changes: 3 additions & 1 deletion drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ static int dwc_eth_dwmac_config_dt(struct platform_device *pdev,
u32 a_index = 0;

if (!plat_dat->axi) {
plat_dat->axi = kzalloc(sizeof(struct stmmac_axi), GFP_KERNEL);
plat_dat->axi = devm_kzalloc(&pdev->dev,
sizeof(struct stmmac_axi),
GFP_KERNEL);

if (!plat_dat->axi)
return -ENOMEM;
Expand Down
32 changes: 18 additions & 14 deletions drivers/net/ethernet/ti/am65-cpsw-nuss.c
Original file line number Diff line number Diff line change
Expand Up @@ -2306,14 +2306,18 @@ static void am65_cpsw_nuss_remove_tx_chns(struct am65_cpsw_common *common)
static int am65_cpsw_nuss_ndev_add_tx_napi(struct am65_cpsw_common *common)
{
struct device *dev = common->dev;
struct am65_cpsw_tx_chn *tx_chn;
int i, ret = 0;

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

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

netif_napi_add_tx(common->dma_ndev, &tx_chn->napi_tx,
am65_cpsw_nuss_tx_poll);

ret = devm_request_irq(dev, tx_chn->irq,
am65_cpsw_nuss_tx_irq,
IRQF_TRIGGER_HIGH,
Expand All @@ -2323,19 +2327,16 @@ static int am65_cpsw_nuss_ndev_add_tx_napi(struct am65_cpsw_common *common)
tx_chn->id, tx_chn->irq, ret);
goto err;
}

netif_napi_add_tx(common->dma_ndev, &tx_chn->napi_tx,
am65_cpsw_nuss_tx_poll);
}

return 0;

err:
for (--i ; i >= 0 ; i--) {
struct am65_cpsw_tx_chn *tx_chn = &common->tx_chns[i];

netif_napi_del(&tx_chn->napi_tx);
netif_napi_del(&tx_chn->napi_tx);
for (--i; i >= 0; i--) {
tx_chn = &common->tx_chns[i];
devm_free_irq(dev, tx_chn->irq, tx_chn);
netif_napi_del(&tx_chn->napi_tx);
}

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

netif_napi_add(common->dma_ndev, &flow->napi_rx,
am65_cpsw_nuss_rx_poll);

ret = devm_request_irq(dev, flow->irq,
am65_cpsw_nuss_rx_irq,
IRQF_TRIGGER_HIGH,
Expand All @@ -2577,23 +2581,23 @@ static int am65_cpsw_nuss_init_rx_chns(struct am65_cpsw_common *common)
dev_err(dev, "failure requesting rx %d irq %u, %d\n",
i, flow->irq, ret);
flow->irq = -EINVAL;
goto err_flow;
goto err_request_irq;
}

netif_napi_add(common->dma_ndev, &flow->napi_rx,
am65_cpsw_nuss_rx_poll);
}

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

return 0;

err_request_irq:
netif_napi_del(&flow->napi_rx);

err_flow:
for (--i; i >= 0 ; i--) {
for (--i; i >= 0; i--) {
flow = &rx_chn->flows[i];
netif_napi_del(&flow->napi_rx);
devm_free_irq(dev, flow->irq, flow);
netif_napi_del(&flow->napi_rx);
}

err:
Expand Down
1 change: 1 addition & 0 deletions drivers/net/ethernet/ti/icssg/icssg_prueth.c
Original file line number Diff line number Diff line change
Expand Up @@ -1679,6 +1679,7 @@ static int prueth_probe(struct platform_device *pdev)
}

spin_lock_init(&prueth->vtbl_lock);
spin_lock_init(&prueth->stats_lock);
/* setup netdev interfaces */
if (eth0_node) {
ret = prueth_netdev_init(prueth, eth0_node);
Expand Down
2 changes: 2 additions & 0 deletions drivers/net/ethernet/ti/icssg/icssg_prueth.h
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,8 @@ struct prueth {
int default_vlan;
/** @vtbl_lock: Lock for vtbl in shared memory */
spinlock_t vtbl_lock;
/** @stats_lock: Lock for reading icssg stats */
spinlock_t stats_lock;
};

struct emac_tx_ts_response {
Expand Down
4 changes: 4 additions & 0 deletions drivers/net/ethernet/ti/icssg/icssg_stats.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ void emac_update_hardware_stats(struct prueth_emac *emac)
u32 val, reg;
int i;

spin_lock(&prueth->stats_lock);

for (i = 0; i < ARRAY_SIZE(icssg_all_miig_stats); i++) {
regmap_read(prueth->miig_rt,
base + icssg_all_miig_stats[i].offset,
Expand All @@ -51,6 +53,8 @@ void emac_update_hardware_stats(struct prueth_emac *emac)
emac->pa_stats[i] += val;
}
}

spin_unlock(&prueth->stats_lock);
}

void icssg_stats_work_handler(struct work_struct *work)
Expand Down
Loading

0 comments on commit 5fc3193

Please sign in to comment.