LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 06-19-2021, 07:30 PM   #1
engnfrc
LQ Newbie
 
Registered: Jun 2021
Posts: 4

Rep: Reputation: Disabled
MCP2518FD Drivers Rarely Working with Custom Kernel 5.10.Y


I'm working with an RPi 4 running Buster and having a custom HAT. The HAT has two on-board MCP2518FD chips on SPI 0.0 and 0.1. Up till recently I've been using a custom build of kernel v4.19.73 with a slightly tweaked version of the msperl's mcp25xxfd driver: https://github.com/msperl/linux-rpi/releases and things have been going great. Now I want to take advantage of booting from a USB, however this has required merging in the more recent kernel v5.10.Y changes (v5.10.44). In doing so I've learned that a spin-off of the mcp25xxfd has found its way into the mainstream and renamed to mcp251xfd. I have installed the new custom kernel and tried both the mcp25xxfd I had been using AND the new mcp251xfd driver, but neither are working reliably. On the rare chance (1 out of many restarts) one is working properly I can do a candump and see traffic as expected, however almost always when I go to bring up the CAN port I receive: "RTNETLINK answers: Connection timed out" and looking at dmesg I see combinations of "SPI transfer timed out", "failed to transfer one message from queue", and "CRC read error at address 0x...". Since the hardware works with the old software I have no reason to think it's a hardware issue and if it were a driver issue I'd think someone else has seen this by now and that patch would have been issued (I started with v5.10.17 a few months ago and updated to v5.10.44 today now that I'm back to working on this issue). Looking at "dmesg" and "vcdbg log msg" I don't see any major differences between when things work and when they do not, when they do work it's for one reboot and then the following are all messed up till the random one off when they aren't. I accidentally shutdown the system and I don't have physical access to it again till Monday, so bare with me on logs and whatnot, I'll get whatever you all want to see then. Has anyone else seen this behavior and/or have experience with using the MCP2518FD chip on an RPi 4 running Buster and having a 5.10.Y variant of the kernel??
 
Old 06-22-2021, 12:38 PM   #2
engnfrc
LQ Newbie
 
Registered: Jun 2021
Posts: 4

Original Poster
Rep: Reputation: Disabled
I've attached three files... my /boot/config.txt and dmesg logs where things worked and things were broken when I ran the ip link commands.
Attached Files
File Type: txt config.txt (2.7 KB, 50 views)
File Type: txt dmesg_loaded_mcp251xfd.txt (22.4 KB, 50 views)
File Type: txt dmesg_loaded_mcp251xfd_broken.txt (24.1 KB, 32 views)
 
Old 07-03-2021, 08:17 AM   #3
zeebra
Senior Member
 
Registered: Dec 2011
Distribution: Slackware
Posts: 1,830
Blog Entries: 17

Rep: Reputation: 638Reputation: 638Reputation: 638Reputation: 638Reputation: 638Reputation: 638
So, how exactly did you migrate from your old kernel to the newer one?

I'm currently migrating from 5.8 to 5.12 on quite ordinary hardware, and it's quite alot of work. Depreciated functions, matured ones and more or less relevant dependencies, changed drivers and many more things. A move from 4.19 to 5.10 could create a number of issues.
 
Old 07-06-2021, 02:16 PM   #4
engnfrc
LQ Newbie
 
Registered: Jun 2021
Posts: 4

Original Poster
Rep: Reputation: Disabled
For us we just ran the applicable apt upgrade commands and were left with kernel 5.10.Y, then from there I built a new custom kernel by branching off of 5.10.Y RPi Linux branch and applying whatever changes were needed (not very many and I ditched the MCP25XXFD driver for the MCP251XFD in the mainstream now). Initially I copied over our existing kernel config files, but later I remade them using the default config files present and made the necessary changes for our system, again not too many.

Quote:
Originally Posted by zeebra View Post
So, how exactly did you migrate from your old kernel to the newer one?

I'm currently migrating from 5.8 to 5.12 on quite ordinary hardware, and it's quite alot of work. Depreciated functions, matured ones and more or less relevant dependencies, changed drivers and many more things. A move from 4.19 to 5.10 could create a number of issues.
 
Old 07-06-2021, 02:25 PM   #5
engnfrc
LQ Newbie
 
Registered: Jun 2021
Posts: 4

Original Poster
Rep: Reputation: Disabled
Finally narrowing down this problem today, it would appear that the problem only crops up when I've got the I2S bits enabled; disable I2S and the CAN stuff on SPI0 works great. Any ideas?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Five More Engineering Hints You’ll Rarely Hear LXer Syndicated Linux News 3 10-06-2020 04:15 PM
Rarely used PS1 attributes - not working cryingthug Programming 7 06-20-2012 06:11 AM
LXer: The Top 5 Engineering Hints You Rarely Hear LXer Syndicated Linux News 0 08-05-2006 02:54 PM
Laptop rarely starts up, seemingly stuck in standby andrewjjones Linux - Hardware 1 08-10-2005 02:53 PM
ACPI rarely does anything cjames53 Linux - Laptop and Netbook 0 03-05-2005 08:01 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 02:48 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration