pull-request: can 2026-03-10
Subsystems (3)
Marc Kleine-Budde
maintainercover pull-request: can 2026-03-10
Hello netdev-team,
this is a pull request of 2 patches for net/main.
Haibo Chen's patch fixes the maximum allowed bit rate error, which was broken in v6.19.
Wenyuan Li contributes a patch for the hi311x driver that adds missing error checking in the caller of the hi3110_power_enable() function, hi3110_open().
regards,
Marc
---
The following changes since commit e3f5e0f22cfc2371e7471c9fd5b4da78f9df7c69:
mctp: i2c: fix skb memory leak in receive path (2026-03-10 11:10:55 +0100)
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-7.0-20260310
for you to fetch changes up to 47bba09b14fa21712398febf36cb14fd4fc3bded:
can: hi311x: hi3110_open(): add check for hi3110_power_enable() return value (2026-03-10 11:12:52 +0100)
----------------------------------------------------------------
linux-can-fixes-for-7.0-20260310
----------------------------------------------------------------
Haibo Chen (1):
can: dev: keep the max bitrate error at 5%
Wenyuan Li (1):
can: hi311x: hi3110_open(): add check for hi3110_power_enable() return value
drivers/net/can/dev/calc_bittiming.c | 2 +- drivers/net/can/spi/hi311x.c | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-)
Marc Kleine-Budde
maintainerPATCH 1/2 can: dev: keep the max bitrate error at 5%
From: Haibo Chen <[email protected]>
Commit b360a13d44db ("can: dev: print bitrate error with two decimal digits") changed calculation of the bit rate error from on-tenth of a percent to on-hundredth of a percent, but forgot to adjust the scale of the CAN_CALC_MAX_ERROR constant.
Keeping the existing logic unchanged: Only when the bitrate error exceeds 5% should an error be returned. Otherwise, simply output a warning log.
--- drivers/net/can/dev/calc_bittiming.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/can/dev/calc_bittiming.c +1 -1
@@ -8,7 +8,7 @@#include <linux/units.h> #include <linux/can/dev.h> -#define CAN_CALC_MAX_ERROR 50/* in one-tenth of a percent */ +#define CAN_CALC_MAX_ERROR 500/* max error 5% */ /* CiA recommended sample points for Non Return to Zero encoding. */ static int can_calc_sample_point_nrz (const struct can_bittiming *bt)
base-commit: e3f5e0f22cfc2371e7471c9fd5b4da78f9df7c69
Signature · 1 line
2.51.0
Re: [PATCH net 1/2] can: dev: keep the max bitrate error at 5%
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 Tue, 10 Mar 2026 11:30:34 +0100 you wrote:
From: Haibo Chen <[email protected]>
Commit
b360a13d44db("can: dev: print bitrate error with two decimal digits") changed calculation of the bit rate error from on-tenth of a percent to on-hundredth of a percent, but forgot to adjust the scale of theCAN_CALC_MAX_ERRORconstant.[...]
Here is the summary with links:
- [net,1/2] can: dev: keep the max bitrate error at 5%
https://git.kernel.org/netdev/net/c/1eea46908c57 - [net,2/2] can: hi311x: hi3110_open(): add check for hi3110_power_enable() return value https://git.kernel.org/netdev/net/c/47bba09b14fa
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/2 can: hi311x: hi3110_open(): add check for hi3110_power_enable() return value
In reply to Marc Kleine-BuddeFrom: Wenyuan Li <[email protected]>
In hi3110_open(), the return value of hi3110_power_enable() is not checked. If power enable fails, the device may not function correctly, while the driver still returns success.
Add a check for the return value and propagate the error accordingly.
--- drivers/net/can/spi/hi311x.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/net/can/spi/hi311x.c +4 -1
@@ -755,7 +755,9 @@ static int hi3110_open(struct net_device *net)return ret;mutex_lock (&priv->hi3110_lock); -hi3110_power_enable (priv->transceiver,1 ); + ret =hi3110_power_enable (priv->transceiver,1 ); +if (ret) + goto out_close_candev; priv->force_quit =0 ; priv->tx_skb =NULL ;
@@ -790,6 +792,7 @@ static int hi3110_open(struct net_device *net)hi3110_hw_sleep (spi); out_close:hi3110_power_enable (priv->transceiver,0 ); + out_close_candev:close_candev (net);mutex_unlock (&priv->hi3110_lock);return ret;
Signature · 1 line
2.51.0