pull-request: can 2025-10-20
Subsystems (8)
Marc Kleine-Budde
maintainercover pull-request: can 2025-10-20
Hello netdev-team,
this is a pull request of 4 patches for net/main.
All patches are by me. The first 3 update the bxcan, esd and rockchip driver to drop skbs in xmit of the device is in listen only mode.
The last patch targets the CAN netlink implementation to allow the disabling of automatic restart after Bus-Off, even if the a driver doesn't implement that callback.
regards,
Marc
---
The following changes since commit ffff5c8fc2af2218a3332b3d5b97654599d50cde:
net: phy: realtek: fix rtl8221b-vm-cg name (2025-10-17 16:34:37 -0700)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can.git tags/linux-can-fixes-for-6.18-20251020
for you to fetch changes up to 8e93ac51e4c6dc399fad59ec21f55f2cfb46d27c:
can: netlink: can_changelink(): allow disabling of automatic restart (2025-10-20 17:20:12 +0200)
----------------------------------------------------------------
linux-can-fixes-for-6.18-20251020
----------------------------------------------------------------
Marc Kleine-Budde (5):
can: bxcan: bxcan_start_xmit(): use can_dev_dropped_skb() instead of can_dropped_invalid_skb()
can: esd: acc_start_xmit(): use can_dev_dropped_skb() instead of can_dropped_invalid_skb()
can: rockchip-canfd: rkcanfd_start_xmit(): use can_dev_dropped_skb() instead of can_dropped_invalid_skb() Merge patch series "can: drivers: drop skb in xmit if device is in listen only mode"
can: netlink: can_changelink(): allow disabling of automatic restart
drivers/net/can/bxcan.c | 2 +- drivers/net/can/dev/netlink.c | 6 ++++-- drivers/net/can/esd/esdacc.c | 2 +- drivers/net/can/rockchip/rockchip_canfd-tx.c | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-)
Marc Kleine-Budde
maintainerPATCH 1/4 can: bxcan: bxcan_start_xmit(): use can_dev_dropped_skb() instead of can_dropped_invalid_skb()
In addition to can_dropped_invalid_skb(), the helper function can_dev_dropped_skb() checks whether the device is in listen-only mode and discards the skb accordingly.
Replace can_dropped_invalid_skb() by can_dev_dropped_skb() to also drop skbs in for listen-only mode.
--- drivers/net/can/bxcan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/can/bxcan.c +1 -1
@@ -842,7 +842,7 @@ static netdev_tx_t bxcan_start_xmit(struct sk_buff *skb,u32 id;int i, j; -if (can_dropped_invalid_skb (ndev, skb)) +if (can_dev_dropped_skb (ndev, skb))return NETDEV_TX_OK ;if (bxcan_tx_busy (priv))
base-commit: ffff5c8fc2af2218a3332b3d5b97654599d50cde
Signature · 1 line
2.51.0
Re: [PATCH net 1/4] can: bxcan: bxcan_start_xmit(): use can_dev_dropped_skb() instead of can_dropped_invalid_skb()
This series was applied to netdev/net.git (main) by Marc Kleine-Budde <[email protected]>:
Hello:
This series was applied to netdev/net.git (main)
by Marc Kleine-Budde <[email protected]>:
Quoted 8 lines · On Mon, 20 Oct 2025 17:22:22 +0200 you wrote:
In addition to
can_dropped_invalid_skb(), the helper functioncan_dev_dropped_skb()checks whether the device is in listen-only mode and discards the skb accordingly.Replace
can_dropped_invalid_skb()bycan_dev_dropped_skb()to also drop skbs in for listen-only mode.[...]
Here is the summary with links:
- [net,1/4] can: bxcan: bxcan_start_xmit(): use can_dev_dropped_skb() instead of can_dropped_invalid_skb()
https://git.kernel.org/netdev/net/c/3a20c444cd12 - [net,2/4] can: esd: acc_start_xmit(): use can_dev_dropped_skb() instead of can_dropped_invalid_skb() https://git.kernel.org/netdev/net/c/0bee15a5caf3 - [net,3/4] can: rockchip-canfd: rkcanfd_start_xmit(): use can_dev_dropped_skb() instead of can_dropped_invalid_skb() https://git.kernel.org/netdev/net/c/3a3bc9bbb3a0 - [net,4/4] can: netlink: can_changelink(): allow disabling of automatic restart https://git.kernel.org/netdev/net/c/8e93ac51e4c6
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html
Marc Kleine-Budde
maintainerPATCH 2/4 can: esd: acc_start_xmit(): use can_dev_dropped_skb() instead of can_dropped_invalid_skb()
In reply to Marc Kleine-BuddeIn addition to can_dropped_invalid_skb(), the helper function can_dev_dropped_skb() checks whether the device is in listen-only mode and discards the skb accordingly.
Replace can_dropped_invalid_skb() by can_dev_dropped_skb() to also drop skbs in for listen-only mode.
--- drivers/net/can/esd/esdacc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/can/esd/esdacc.c +1 -1
@@ -254,7 +254,7 @@ netdev_tx_t acc_start_xmit(struct sk_buff *skb, struct net_device *netdev)u32 acc_id;u32 acc_dlc; -if (can_dropped_invalid_skb (netdev, skb)) +if (can_dev_dropped_skb (netdev, skb))return NETDEV_TX_OK ;/* Access core->tx_fifo_tail only once because it may be changed
Signature · 1 line
2.51.0
Marc Kleine-Budde
maintainerPATCH 3/4 can: rockchip-canfd: rkcanfd_start_xmit(): use can_dev_dropped_skb() instead of can_dropped_invalid_skb()
In reply to Marc Kleine-BuddeIn addition to can_dropped_invalid_skb(), the helper function can_dev_dropped_skb() checks whether the device is in listen-only mode and discards the skb accordingly.
Replace can_dropped_invalid_skb() by can_dev_dropped_skb() to also drop skbs in for listen-only mode.
--- drivers/net/can/rockchip/rockchip_canfd-tx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/can/rockchip/rockchip_canfd-tx.c +1 -1
@@ -72,7 +72,7 @@ netdev_tx_t rkcanfd_start_xmit(struct sk_buff *skb, struct net_device *ndev)int err;u8 i; -if (can_dropped_invalid_skb (ndev, skb)) +if (can_dev_dropped_skb (ndev, skb))return NETDEV_TX_OK ; if (!netif_subqueue_maybe_stop(priv->ndev, 0,
Signature · 1 line
2.51.0
Marc Kleine-Budde
maintainerPATCH 4/4 can: netlink: can_changelink(): allow disabling of automatic restart
In reply to Marc Kleine-BuddeSince the commit c1f3f9797c1f ("can: netlink: can_changelink(): fix NULL pointer deref of struct can_priv::do_set_mode"), the automatic restart delay can only be set for devices that implement the restart handler struct can_priv::do_set_mode. As it makes no sense to configure a automatic restart for devices that doesn't support it.
However, since systemd commit 13ce5d4632e3 ("network/can: properly handle CAN.RestartSec=0") [1], systemd-networkd correctly handles a restart delay of "0" (i.e. the restart is disabled). Which means that a disabled restart is always configured in the kernel.
On systems with both changes active this causes that CAN interfaces that don't implement a restart handler cannot be brought up by systemd-networkd.
Solve this problem by allowing a delay of "0" to be configured, even if the device does not implement a restart handler.
[1] https://github.com/systemd/systemd/commit/13ce5d4632e395521e6205c954493c7fc1c4c6e0
--- drivers/net/can/dev/netlink.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/net/can/dev/netlink.c +4 -2
@@ -452,7 +452,9 @@ static int can_changelink(struct net_device *dev, struct nlattr *tb[], }if (data[IFLA_CAN_RESTART_MS ]) { -if (!priv->do_set_mode) { +unsigned int restart_ms =nla_get_u32 (data[IFLA_CAN_RESTART_MS ]); + +if (restart_ms !=0 && !priv->do_set_mode) {NL_SET_ERR_MSG (extack,"Device doesn't support restart from Bus Off" );return -EOPNOTSUPP ;
@@ -461,7 +463,7 @@ static int can_changelink(struct net_device *dev, struct nlattr *tb[],/* Do not allow changing restart delay while running */ if (dev->flags &IFF_UP )return -EBUSY ; - priv->restart_ms =nla_get_u32 (data[IFLA_CAN_RESTART_MS ]); + priv->restart_ms = restart_ms; }if (data[IFLA_CAN_RESTART ]) {
Signature · 1 line
2.51.0