* [PATCH net 0/2] pull-request: can 2026-03-10
@ 2026-03-10 10:30 Marc Kleine-Budde
2026-03-10 10:30 ` [PATCH net 1/2] can: dev: keep the max bitrate error at 5% Marc Kleine-Budde
2026-03-10 10:30 ` [PATCH net 2/2] can: hi311x: hi3110_open(): add check for hi3110_power_enable() return value Marc Kleine-Budde
0 siblings, 2 replies; 4+ messages in thread
From: Marc Kleine-Budde @ 2026-03-10 10:30 UTC (permalink / raw)
To: netdev; +Cc: davem, kuba, linux-can, kernel
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(-)
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH net 1/2] can: dev: keep the max bitrate error at 5%
2026-03-10 10:30 [PATCH net 0/2] pull-request: can 2026-03-10 Marc Kleine-Budde
@ 2026-03-10 10:30 ` Marc Kleine-Budde
2026-03-10 14:20 ` patchwork-bot+netdevbpf
2026-03-10 10:30 ` [PATCH net 2/2] can: hi311x: hi3110_open(): add check for hi3110_power_enable() return value Marc Kleine-Budde
1 sibling, 1 reply; 4+ messages in thread
From: Marc Kleine-Budde @ 2026-03-10 10:30 UTC (permalink / raw)
To: netdev
Cc: davem, kuba, linux-can, kernel, Haibo Chen, stable,
Marc Kleine-Budde
From: Haibo Chen <haibo.chen@nxp.com>
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.
Fixes: b360a13d44db ("can: dev: print bitrate error with two decimal digits")
Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
Link: https://patch.msgid.link/20260306-can-fix-v1-1-ac526cec6777@nxp.com
Cc: stable@kernel.org
[mkl: improve commit message]
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
drivers/net/can/dev/calc_bittiming.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/can/dev/calc_bittiming.c b/drivers/net/can/dev/calc_bittiming.c
index cc4022241553..42498e9d3f38 100644
--- a/drivers/net/can/dev/calc_bittiming.c
+++ b/drivers/net/can/dev/calc_bittiming.c
@@ -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
--
2.51.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH net 2/2] can: hi311x: hi3110_open(): add check for hi3110_power_enable() return value
2026-03-10 10:30 [PATCH net 0/2] pull-request: can 2026-03-10 Marc Kleine-Budde
2026-03-10 10:30 ` [PATCH net 1/2] can: dev: keep the max bitrate error at 5% Marc Kleine-Budde
@ 2026-03-10 10:30 ` Marc Kleine-Budde
1 sibling, 0 replies; 4+ messages in thread
From: Marc Kleine-Budde @ 2026-03-10 10:30 UTC (permalink / raw)
To: netdev; +Cc: davem, kuba, linux-can, kernel, Wenyuan Li, Marc Kleine-Budde
From: Wenyuan Li <2063309626@qq.com>
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.
Signed-off-by: Wenyuan Li <2063309626@qq.com>
Link: https://patch.msgid.link/tencent_B5E2E7528BB28AA8A2A56E16C49BD58B8B07@qq.com
Fixes: 57e83fb9b746 ("can: hi311x: Add Holt HI-311x CAN driver")
[mkl: adjust subject, commit message and jump label]
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
drivers/net/can/spi/hi311x.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/net/can/spi/hi311x.c b/drivers/net/can/spi/hi311x.c
index e00d3dbc4cf4..91b1fa970f8f 100644
--- a/drivers/net/can/spi/hi311x.c
+++ b/drivers/net/can/spi/hi311x.c
@@ -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;
--
2.51.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH net 1/2] can: dev: keep the max bitrate error at 5%
2026-03-10 10:30 ` [PATCH net 1/2] can: dev: keep the max bitrate error at 5% Marc Kleine-Budde
@ 2026-03-10 14:20 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-03-10 14:20 UTC (permalink / raw)
To: Marc Kleine-Budde
Cc: netdev, davem, kuba, linux-can, kernel, haibo.chen, stable
Hello:
This series was applied to netdev/net.git (main)
by Marc Kleine-Budde <mkl@pengutronix.de>:
On Tue, 10 Mar 2026 11:30:34 +0100 you wrote:
> From: Haibo Chen <haibo.chen@nxp.com>
>
> 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.
>
> [...]
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!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-03-10 14:20 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-10 10:30 [PATCH net 0/2] pull-request: can 2026-03-10 Marc Kleine-Budde
2026-03-10 10:30 ` [PATCH net 1/2] can: dev: keep the max bitrate error at 5% Marc Kleine-Budde
2026-03-10 14:20 ` patchwork-bot+netdevbpf
2026-03-10 10:30 ` [PATCH net 2/2] can: hi311x: hi3110_open(): add check for hi3110_power_enable() return value Marc Kleine-Budde
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox