Good idea, however the chip has IMHO a bug:
The problem with the error interrupt is, when disabled the can core
doesn't issue any can bus warning or bus passive interrupts.
Can you ensure that you get both error warning and error passive can
error messages with disabled BERR and you patch applied?
If a bus error occurs and bus error reporting is disabled, work_done
will stay 0, so both the RX and the ERR interrupt stay disabled (which
is done in flexcan_irq). I think we should always enable the RX
interrupt. (However, if the bus is working again the chip can probably
send messages again, so we get a TX-complete IRQ, but this depends on
the application.)
Having a look at flexcan_irq:
This mean with disabled BERR NAPI should only be scheduled in case of a
RX or a state change interrupt. Both of these interrupts should generate
a can_frame in flexcan_poll and this the work_done shoud be > 0, modulo
out of memory situations.
So thinking about the problem I don't see how your patch works. But
there might be a bug in the driver or my logic.
Cheers, Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Industrial Linux Solutions | Phone: +49-231-2826-924 |
Vertretung West/Dortmund | Fax: +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |