Re: [PATCH] can: netlink: Fix TDCO calculation using the old data bittiming

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Marc,

On 21.02.24 15:24, Marc Kleine-Budde wrote:
On 21.02.2024 15:14:02, Oliver Hartkopp wrote:
I have an old PCAN USB adapter (Classical CAN) which uses the pcan_usb
driver and wanted to set a 50kbit/s bitrate:

ip link set can0 up txqueuelen 500 type can bitrate 50000 sjw 4

First it complained about the SJW having a higher value than some phase-seg
value which was 2.

Error: sjw: 4 greater than phase-seg2: 2.

I always thought the driver automatically adapts the SJW value to the
highest possible and SJW=4 could always be set. Did this change at a certain
point?

Yes, that changed with b5a3d0864ee7 ("can: bittiming: can_sjw_check():
check that SJW is not longer than either Phase Buffer Segment")

See discussion in https://lore.kernel.org/all/20220907103845.3929288-3-mkl@xxxxxxxxxxxxxx/

Ok, thanks.

Anyway, then I reduced the given SJW value and the ip command did not give
any error message.

But finally there was not CAN traffic possible with my "always working
setup".

I'm running 6.8.0-rc4-00433-g92a355464776 from Linus' tree.

Reverting this patch fixed my issue.

But what has the tdco calculation to do with non CAN-FD controllers?

Hm, I was using a Debian 6.1 kernel in between, which worked.

Then I booted my 6.8.0-rc4-00433-g92a355464776 again, reverted the patch and loaded the changed can-dev module by hand - which then also worked.

To double check now I was unloading the patched version and using the can-dev from /lib/modules again, also works ¯\_(ツ)_/¯

So, I'll have to make more investigations what really went wrong here.
I also was astonished about such CAN FD dependency.

Will come back with more info about my experienced issue.
So far please drop my blame for this patch.

Best regards,
Oliver




[Index of Archives]     [Automotive Discussions]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [CAN Bus]

  Powered by Linux