Re: [PATCH V3] CAN: Add Flexcan CAN controller driver
From: Wolfgang Grandegger <hidden>
Date: 2009-08-02 19:22:51
Sascha Hauer wrote:
On Thu, Jul 30, 2009 at 10:22:11PM +0200, Wolfgang Grandegger wrote:quoted
Wolfgang Grandegger wrote:quoted
Sascha Hauer wrote:[...]quoted
quoted
errcnt = readl(®s->errcnt); rxerr = (errcnt >> 8) & 0xff; txerr = errcnt & 0xff; if ((rxerr >= 96 || txerr >= 96) && state == CAN_STATE_ERROR_ACTIVE) state = CAN_STATE_ERROR_WARNING;Yes, or do not handle the state in the "case 0" above appropriately. The CAN spec only specifies the bus error states error active, error passive and bus off. The warning is somehow optional but available on most CAN controllers. Nevertheless, we should create a message if the ISR realizes a state changes.FYI, I will be on holiday for the next 1.5 weeks.Lucky you ;)
A last answer before I go really offline...
I just did some tests with the CAN cable disconnected. It turns out that I get flooded by interrupts caused by ACK errors. The system is completely unresponsive then. Unfortunately the ACK error interrupt can't be disabled seperately, so we have to disable error interrupts completely once we get an ACK error. I'm thinking about setting up a timer and poll the error status register then.
I suspect that you are using 1MB/s. That's the infamous bus error flooding we realize with the SJA1000 on low-end systems as well. The right solution is using the NAPI (RX polling) interface. Wolfgang.