Skip to content

Commit e8c127b

Browse files
committed
Merge tag 'net-6.6-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Pull networking fixes from Paolo Abeni: "Including fixes from CAN and BPF. We have a regression in TC currently under investigation, otherwise the things that stand off most are probably the TCP and AF_PACKET fixes, with both issues coming from 6.5. Previous releases - regressions: - af_packet: fix fortified memcpy() without flex array. - tcp: fix crashes trying to free half-baked MTU probes - xdp: fix zero-size allocation warning in xskq_create() - can: sja1000: always restart the tx queue after an overrun - eth: mlx5e: again mutually exclude RX-FCS and RX-port-timestamp - eth: nfp: avoid rmmod nfp crash issues - eth: octeontx2-pf: fix page pool frag allocation warning Previous releases - always broken: - mctp: perform route lookups under a RCU read-side lock - bpf: s390: fix clobbering the caller's backchain in the trampoline - phy: lynx-28g: cancel the CDR check work item on the remove path - dsa: qca8k: fix qca8k driver for Turris 1.x - eth: ravb: fix use-after-free issue in ravb_tx_timeout_work() - eth: ixgbe: fix crash with empty VF macvlan list" * tag 'net-6.6-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (54 commits) rswitch: Fix imbalance phy_power_off() calling rswitch: Fix renesas_eth_sw_remove() implementation octeontx2-pf: Fix page pool frag allocation warning nfc: nci: assert requested protocol is valid af_packet: Fix fortified memcpy() without flex array. net: tcp: fix crashes trying to free half-baked MTU probes net/smc: Fix pos miscalculation in statistics nfp: flower: avoid rmmod nfp crash issues net: usb: dm9601: fix uninitialized variable use in dm9601_mdio_read ethtool: Fix mod state of verbose no_mask bitset net: nfc: fix races in nfc_llcp_sock_get() and nfc_llcp_sock_get_sn() mctp: perform route lookups under a RCU read-side lock net: skbuff: fix kernel-doc typos s390/bpf: Fix unwinding past the trampoline s390/bpf: Fix clobbering the caller's backchain in the trampoline net/mlx5e: Again mutually exclude RX-FCS and RX-port-timestamp net/smc: Fix dependency of SMC on ISM ixgbe: fix crash with empty VF macvlan list net/mlx5e: macsec: use update_pn flag instead of PN comparation net: phy: mscc: macsec: reject PN update requests ...
2 parents 9a5a149 + b91e840 commit e8c127b

File tree

58 files changed

+712
-280
lines changed

Some content is hidden

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

58 files changed

+712
-280
lines changed

arch/arm64/boot/dts/freescale/imx93.dtsi

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@
185185
#size-cells = <1>;
186186
ranges;
187187

188-
anomix_ns_gpr: syscon@44210000 {
188+
aonmix_ns_gpr: syscon@44210000 {
189189
compatible = "fsl,imx93-aonmix-ns-syscfg", "syscon";
190190
reg = <0x44210000 0x1000>;
191191
};
@@ -319,6 +319,7 @@
319319
assigned-clock-parents = <&clk IMX93_CLK_SYS_PLL_PFD1_DIV2>;
320320
assigned-clock-rates = <40000000>;
321321
fsl,clk-source = /bits/ 8 <0>;
322+
fsl,stop-mode = <&aonmix_ns_gpr 0x14 0>;
322323
status = "disabled";
323324
};
324325

@@ -591,6 +592,7 @@
591592
assigned-clock-parents = <&clk IMX93_CLK_SYS_PLL_PFD1_DIV2>;
592593
assigned-clock-rates = <40000000>;
593594
fsl,clk-source = /bits/ 8 <0>;
595+
fsl,stop-mode = <&wakeupmix_gpr 0x0c 2>;
594596
status = "disabled";
595597
};
596598

arch/riscv/net/bpf_jit_comp64.c

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ static void __build_epilogue(bool is_tail_call, struct rv_jit_context *ctx)
245245
emit_addi(RV_REG_SP, RV_REG_SP, stack_adjust, ctx);
246246
/* Set return value. */
247247
if (!is_tail_call)
248-
emit_mv(RV_REG_A0, RV_REG_A5, ctx);
248+
emit_addiw(RV_REG_A0, RV_REG_A5, 0, ctx);
249249
emit_jalr(RV_REG_ZERO, is_tail_call ? RV_REG_T3 : RV_REG_RA,
250250
is_tail_call ? (RV_FENTRY_NINSNS + 1) * 4 : 0, /* skip reserved nops and TCC init */
251251
ctx);
@@ -759,8 +759,10 @@ static int invoke_bpf_prog(struct bpf_tramp_link *l, int args_off, int retval_of
759759
if (ret)
760760
return ret;
761761

762-
if (save_ret)
763-
emit_sd(RV_REG_FP, -retval_off, regmap[BPF_REG_0], ctx);
762+
if (save_ret) {
763+
emit_sd(RV_REG_FP, -retval_off, RV_REG_A0, ctx);
764+
emit_sd(RV_REG_FP, -(retval_off - 8), regmap[BPF_REG_0], ctx);
765+
}
764766

765767
/* update branch with beqz */
766768
if (ctx->insns) {
@@ -853,7 +855,7 @@ static int __arch_prepare_bpf_trampoline(struct bpf_tramp_image *im,
853855

854856
save_ret = flags & (BPF_TRAMP_F_CALL_ORIG | BPF_TRAMP_F_RET_FENTRY_RET);
855857
if (save_ret) {
856-
stack_size += 8;
858+
stack_size += 16; /* Save both A5 (BPF R0) and A0 */
857859
retval_off = stack_size;
858860
}
859861

@@ -957,6 +959,7 @@ static int __arch_prepare_bpf_trampoline(struct bpf_tramp_image *im,
957959
if (ret)
958960
goto out;
959961
emit_sd(RV_REG_FP, -retval_off, RV_REG_A0, ctx);
962+
emit_sd(RV_REG_FP, -(retval_off - 8), regmap[BPF_REG_0], ctx);
960963
im->ip_after_call = ctx->insns + ctx->ninsns;
961964
/* 2 nops reserved for auipc+jalr pair */
962965
emit(rv_nop(), ctx);
@@ -988,8 +991,10 @@ static int __arch_prepare_bpf_trampoline(struct bpf_tramp_image *im,
988991
if (flags & BPF_TRAMP_F_RESTORE_REGS)
989992
restore_args(nregs, args_off, ctx);
990993

991-
if (save_ret)
994+
if (save_ret) {
992995
emit_ld(RV_REG_A0, -retval_off, RV_REG_FP, ctx);
996+
emit_ld(regmap[BPF_REG_0], -(retval_off - 8), RV_REG_FP, ctx);
997+
}
993998

994999
emit_ld(RV_REG_S1, -sreg_off, RV_REG_FP, ctx);
9951000

@@ -1515,7 +1520,8 @@ int bpf_jit_emit_insn(const struct bpf_insn *insn, struct rv_jit_context *ctx,
15151520
if (ret)
15161521
return ret;
15171522

1518-
emit_mv(bpf_to_rv_reg(BPF_REG_0, ctx), RV_REG_A0, ctx);
1523+
if (insn->src_reg != BPF_PSEUDO_CALL)
1524+
emit_mv(bpf_to_rv_reg(BPF_REG_0, ctx), RV_REG_A0, ctx);
15191525
break;
15201526
}
15211527
/* tail call */

arch/s390/net/bpf_jit_comp.c

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2066,6 +2066,7 @@ struct bpf_tramp_jit {
20662066
* func_addr's original caller
20672067
*/
20682068
int stack_size; /* Trampoline stack size */
2069+
int backchain_off; /* Offset of backchain */
20692070
int stack_args_off; /* Offset of stack arguments for calling
20702071
* func_addr, has to be at the top
20712072
*/
@@ -2086,9 +2087,10 @@ struct bpf_tramp_jit {
20862087
* for __bpf_prog_enter() return value and
20872088
* func_addr respectively
20882089
*/
2089-
int r14_off; /* Offset of saved %r14 */
20902090
int run_ctx_off; /* Offset of struct bpf_tramp_run_ctx */
20912091
int tccnt_off; /* Offset of saved tailcall counter */
2092+
int r14_off; /* Offset of saved %r14, has to be at the
2093+
* bottom */
20922094
int do_fexit; /* do_fexit: label */
20932095
};
20942096

@@ -2247,25 +2249,38 @@ static int __arch_prepare_bpf_trampoline(struct bpf_tramp_image *im,
22472249
* Calculate the stack layout.
22482250
*/
22492251

2250-
/* Reserve STACK_FRAME_OVERHEAD bytes for the callees. */
2252+
/*
2253+
* Allocate STACK_FRAME_OVERHEAD bytes for the callees. As the s390x
2254+
* ABI requires, put our backchain at the end of the allocated memory.
2255+
*/
22512256
tjit->stack_size = STACK_FRAME_OVERHEAD;
2257+
tjit->backchain_off = tjit->stack_size - sizeof(u64);
22522258
tjit->stack_args_off = alloc_stack(tjit, nr_stack_args * sizeof(u64));
22532259
tjit->reg_args_off = alloc_stack(tjit, nr_reg_args * sizeof(u64));
22542260
tjit->ip_off = alloc_stack(tjit, sizeof(u64));
22552261
tjit->arg_cnt_off = alloc_stack(tjit, sizeof(u64));
22562262
tjit->bpf_args_off = alloc_stack(tjit, nr_bpf_args * sizeof(u64));
22572263
tjit->retval_off = alloc_stack(tjit, sizeof(u64));
22582264
tjit->r7_r8_off = alloc_stack(tjit, 2 * sizeof(u64));
2259-
tjit->r14_off = alloc_stack(tjit, sizeof(u64));
22602265
tjit->run_ctx_off = alloc_stack(tjit,
22612266
sizeof(struct bpf_tramp_run_ctx));
22622267
tjit->tccnt_off = alloc_stack(tjit, sizeof(u64));
2263-
/* The caller has already reserved STACK_FRAME_OVERHEAD bytes. */
2264-
tjit->stack_size -= STACK_FRAME_OVERHEAD;
2268+
tjit->r14_off = alloc_stack(tjit, sizeof(u64) * 2);
2269+
/*
2270+
* In accordance with the s390x ABI, the caller has allocated
2271+
* STACK_FRAME_OVERHEAD bytes for us. 8 of them contain the caller's
2272+
* backchain, and the rest we can use.
2273+
*/
2274+
tjit->stack_size -= STACK_FRAME_OVERHEAD - sizeof(u64);
22652275
tjit->orig_stack_args_off = tjit->stack_size + STACK_FRAME_OVERHEAD;
22662276

2277+
/* lgr %r1,%r15 */
2278+
EMIT4(0xb9040000, REG_1, REG_15);
22672279
/* aghi %r15,-stack_size */
22682280
EMIT4_IMM(0xa70b0000, REG_15, -tjit->stack_size);
2281+
/* stg %r1,backchain_off(%r15) */
2282+
EMIT6_DISP_LH(0xe3000000, 0x0024, REG_1, REG_0, REG_15,
2283+
tjit->backchain_off);
22692284
/* mvc tccnt_off(4,%r15),stack_size+STK_OFF_TCCNT(%r15) */
22702285
_EMIT6(0xd203f000 | tjit->tccnt_off,
22712286
0xf000 | (tjit->stack_size + STK_OFF_TCCNT));

drivers/net/can/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ config CAN_SLCAN
190190

191191
config CAN_SUN4I
192192
tristate "Allwinner A10 CAN controller"
193-
depends on MACH_SUN4I || MACH_SUN7I || RISCV || COMPILE_TEST
193+
depends on MACH_SUN4I || MACH_SUN7I || (RISCV && ARCH_SUNXI) || COMPILE_TEST
194194
help
195195
Say Y here if you want to use CAN controller found on Allwinner
196196
A10/A20/D1 SoCs.

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

Lines changed: 13 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ static struct flexcan_devtype_data fsl_imx8mp_devtype_data = {
348348
static struct flexcan_devtype_data fsl_imx93_devtype_data = {
349349
.quirks = FLEXCAN_QUIRK_DISABLE_RXFG | FLEXCAN_QUIRK_ENABLE_EACEN_RRS |
350350
FLEXCAN_QUIRK_DISABLE_MECR | FLEXCAN_QUIRK_USE_RX_MAILBOX |
351-
FLEXCAN_QUIRK_BROKEN_PERR_STATE | FLEXCAN_QUIRK_AUTO_STOP_MODE |
351+
FLEXCAN_QUIRK_BROKEN_PERR_STATE | FLEXCAN_QUIRK_SETUP_STOP_MODE_GPR |
352352
FLEXCAN_QUIRK_SUPPORT_FD | FLEXCAN_QUIRK_SUPPORT_ECC |
353353
FLEXCAN_QUIRK_SUPPORT_RX_MAILBOX |
354354
FLEXCAN_QUIRK_SUPPORT_RX_MAILBOX_RTR,
@@ -544,11 +544,6 @@ static inline int flexcan_enter_stop_mode(struct flexcan_priv *priv)
544544
} else if (priv->devtype_data.quirks & FLEXCAN_QUIRK_SETUP_STOP_MODE_GPR) {
545545
regmap_update_bits(priv->stm.gpr, priv->stm.req_gpr,
546546
1 << priv->stm.req_bit, 1 << priv->stm.req_bit);
547-
} else if (priv->devtype_data.quirks & FLEXCAN_QUIRK_AUTO_STOP_MODE) {
548-
/* For the auto stop mode, software do nothing, hardware will cover
549-
* all the operation automatically after system go into low power mode.
550-
*/
551-
return 0;
552547
}
553548

554549
return flexcan_low_power_enter_ack(priv);
@@ -574,12 +569,6 @@ static inline int flexcan_exit_stop_mode(struct flexcan_priv *priv)
574569
reg_mcr &= ~FLEXCAN_MCR_SLF_WAK;
575570
priv->write(reg_mcr, &regs->mcr);
576571

577-
/* For the auto stop mode, hardware will exist stop mode
578-
* automatically after system go out of low power mode.
579-
*/
580-
if (priv->devtype_data.quirks & FLEXCAN_QUIRK_AUTO_STOP_MODE)
581-
return 0;
582-
583572
return flexcan_low_power_exit_ack(priv);
584573
}
585574

@@ -1994,13 +1983,18 @@ static int flexcan_setup_stop_mode(struct platform_device *pdev)
19941983
ret = flexcan_setup_stop_mode_scfw(pdev);
19951984
else if (priv->devtype_data.quirks & FLEXCAN_QUIRK_SETUP_STOP_MODE_GPR)
19961985
ret = flexcan_setup_stop_mode_gpr(pdev);
1997-
else if (priv->devtype_data.quirks & FLEXCAN_QUIRK_AUTO_STOP_MODE)
1998-
ret = 0;
19991986
else
20001987
/* return 0 directly if doesn't support stop mode feature */
20011988
return 0;
20021989

2003-
if (ret)
1990+
/* If ret is -EINVAL, this means SoC claim to support stop mode, but
1991+
* dts file lack the stop mode property definition. For this case,
1992+
* directly return 0, this will skip the wakeup capable setting and
1993+
* will not block the driver probe.
1994+
*/
1995+
if (ret == -EINVAL)
1996+
return 0;
1997+
else if (ret)
20041998
return ret;
20051999

20062000
device_set_wakeup_capable(&pdev->dev, true);
@@ -2320,16 +2314,8 @@ static int __maybe_unused flexcan_noirq_suspend(struct device *device)
23202314
if (netif_running(dev)) {
23212315
int err;
23222316

2323-
if (device_may_wakeup(device)) {
2317+
if (device_may_wakeup(device))
23242318
flexcan_enable_wakeup_irq(priv, true);
2325-
/* For auto stop mode, need to keep the clock on before
2326-
* system go into low power mode. After system go into
2327-
* low power mode, hardware will config the flexcan into
2328-
* stop mode, and gate off the clock automatically.
2329-
*/
2330-
if (priv->devtype_data.quirks & FLEXCAN_QUIRK_AUTO_STOP_MODE)
2331-
return 0;
2332-
}
23332319

23342320
err = pm_runtime_force_suspend(device);
23352321
if (err)
@@ -2347,15 +2333,9 @@ static int __maybe_unused flexcan_noirq_resume(struct device *device)
23472333
if (netif_running(dev)) {
23482334
int err;
23492335

2350-
/* For the wakeup in auto stop mode, no need to gate on the
2351-
* clock here, hardware will do this automatically.
2352-
*/
2353-
if (!(device_may_wakeup(device) &&
2354-
priv->devtype_data.quirks & FLEXCAN_QUIRK_AUTO_STOP_MODE)) {
2355-
err = pm_runtime_force_resume(device);
2356-
if (err)
2357-
return err;
2358-
}
2336+
err = pm_runtime_force_resume(device);
2337+
if (err)
2338+
return err;
23592339

23602340
if (device_may_wakeup(device))
23612341
flexcan_enable_wakeup_irq(priv, false);

drivers/net/can/flexcan/flexcan.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,6 @@
6868
#define FLEXCAN_QUIRK_SUPPORT_RX_MAILBOX_RTR BIT(15)
6969
/* Device supports RX via FIFO */
7070
#define FLEXCAN_QUIRK_SUPPORT_RX_FIFO BIT(16)
71-
/* auto enter stop mode to support wakeup */
72-
#define FLEXCAN_QUIRK_AUTO_STOP_MODE BIT(17)
7371

7472
struct flexcan_devtype_data {
7573
u32 quirks; /* quirks needed for different IP cores */

drivers/net/can/m_can/tcan4x5x-core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ static const struct tcan4x5x_version_info tcan4x5x_versions[] = {
125125
},
126126
[TCAN4553] = {
127127
.name = "4553",
128-
.id2_register = 0x32353534,
128+
.id2_register = 0x33353534,
129129
},
130130
/* generic version with no id2_register at the end */
131131
[TCAN4X5X] = {

drivers/net/can/sja1000/sja1000.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,13 @@ static irqreturn_t sja1000_reset_interrupt(int irq, void *dev_id)
392392
struct net_device *dev = (struct net_device *)dev_id;
393393

394394
netdev_dbg(dev, "performing a soft reset upon overrun\n");
395-
sja1000_start(dev);
395+
396+
netif_tx_lock(dev);
397+
398+
can_free_echo_skb(dev, 0, NULL);
399+
sja1000_set_mode(dev, CAN_MODE_START);
400+
401+
netif_tx_unlock(dev);
396402

397403
return IRQ_HANDLED;
398404
}

drivers/net/dsa/qca/qca8k-8xxx.c

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -505,8 +505,8 @@ qca8k_bulk_read(void *ctx, const void *reg_buf, size_t reg_len,
505505
void *val_buf, size_t val_len)
506506
{
507507
int i, count = val_len / sizeof(u32), ret;
508-
u32 reg = *(u32 *)reg_buf & U16_MAX;
509508
struct qca8k_priv *priv = ctx;
509+
u32 reg = *(u16 *)reg_buf;
510510

511511
if (priv->mgmt_master &&
512512
!qca8k_read_eth(priv, reg, val_buf, val_len))
@@ -527,8 +527,8 @@ qca8k_bulk_gather_write(void *ctx, const void *reg_buf, size_t reg_len,
527527
const void *val_buf, size_t val_len)
528528
{
529529
int i, count = val_len / sizeof(u32), ret;
530-
u32 reg = *(u32 *)reg_buf & U16_MAX;
531530
struct qca8k_priv *priv = ctx;
531+
u32 reg = *(u16 *)reg_buf;
532532
u32 *val = (u32 *)val_buf;
533533

534534
if (priv->mgmt_master &&
@@ -666,6 +666,15 @@ qca8k_phy_eth_command(struct qca8k_priv *priv, bool read, int phy,
666666
goto err_read_skb;
667667
}
668668

669+
/* It seems that accessing the switch's internal PHYs via management
670+
* packets still uses the MDIO bus within the switch internally, and
671+
* these accesses can conflict with external MDIO accesses to other
672+
* devices on the MDIO bus.
673+
* We therefore need to lock the MDIO bus onto which the switch is
674+
* connected.
675+
*/
676+
mutex_lock(&priv->bus->mdio_lock);
677+
669678
/* Actually start the request:
670679
* 1. Send mdio master packet
671680
* 2. Busy Wait for mdio master command
@@ -678,6 +687,7 @@ qca8k_phy_eth_command(struct qca8k_priv *priv, bool read, int phy,
678687
mgmt_master = priv->mgmt_master;
679688
if (!mgmt_master) {
680689
mutex_unlock(&mgmt_eth_data->mutex);
690+
mutex_unlock(&priv->bus->mdio_lock);
681691
ret = -EINVAL;
682692
goto err_mgmt_master;
683693
}
@@ -765,6 +775,7 @@ qca8k_phy_eth_command(struct qca8k_priv *priv, bool read, int phy,
765775
QCA8K_ETHERNET_TIMEOUT);
766776

767777
mutex_unlock(&mgmt_eth_data->mutex);
778+
mutex_unlock(&priv->bus->mdio_lock);
768779

769780
return ret;
770781

drivers/net/ethernet/intel/ice/ice_lag.c

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2093,3 +2093,35 @@ void ice_lag_rebuild(struct ice_pf *pf)
20932093
}
20942094
mutex_unlock(&pf->lag_mutex);
20952095
}
2096+
2097+
/**
2098+
* ice_lag_is_switchdev_running
2099+
* @pf: pointer to PF structure
2100+
*
2101+
* Check if switchdev is running on any of the interfaces connected to lag.
2102+
*/
2103+
bool ice_lag_is_switchdev_running(struct ice_pf *pf)
2104+
{
2105+
struct ice_lag *lag = pf->lag;
2106+
struct net_device *tmp_nd;
2107+
2108+
if (!ice_is_feature_supported(pf, ICE_F_SRIOV_LAG) || !lag)
2109+
return false;
2110+
2111+
rcu_read_lock();
2112+
for_each_netdev_in_bond_rcu(lag->upper_netdev, tmp_nd) {
2113+
struct ice_netdev_priv *priv = netdev_priv(tmp_nd);
2114+
2115+
if (!netif_is_ice(tmp_nd) || !priv || !priv->vsi ||
2116+
!priv->vsi->back)
2117+
continue;
2118+
2119+
if (ice_is_switchdev_running(priv->vsi->back)) {
2120+
rcu_read_unlock();
2121+
return true;
2122+
}
2123+
}
2124+
rcu_read_unlock();
2125+
2126+
return false;
2127+
}

0 commit comments

Comments
 (0)