Thread (3 messages) 3 messages, 3 authors, 2025-12-22

Re: ctucanfd: possible coding error in ctucan_set_secondary_sample_point causing SSP not enabled

From: Marc Kleine-Budde <mkl@pengutronix.de>
Date: 2025-12-22 16:21:11
Also in: linux-can

On 22.12.2025 16:51:07, Ondrej Ille wrote:
yes, your thinking is correct, there is a bug there.

This was pointed to by another user right in the CTU CAN FD repository
where the Linux driver also lives:
https://github.com/Blebowski/CTU-CAN-FD/pull/2

It is as you say, it should be:

-- ssp_cfg |= FIELD_PREP(REG_TRV_DELAY_SSP_SRC, 0x1);
++ ssp_cfg |= FIELD_PREP(REG_TRV_DELAY_SSP_SRC, 0x0);
This statement has no effect, as 'ssp_cfg |= 0x0' is still 'ssp_cfg'.
IMHO it's better to add a comment that says, why you don't set
REG_TRV_DELAY_SSP_SRC. Another option is to add create a define that
replaces 0x1 and 0x0 for REG_TRV_DELAY_SSP_SRC with a speaking name.

regards,
Marc

-- 
Pengutronix e.K.                 | Marc Kleine-Budde          |
Embedded Linux                   | https://www.pengutronix.de |
Vertretung Nürnberg              | Phone: +49-5121-206917-129 |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-9   |

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help