Repository navigation
Commit bccd8fd
can: kvaser_usb: Fix state handling upon BUS_ERROR events
commit e638642 upstream.
While being in an ERROR_WARNING state, and receiving further
bus error events with error counters still in the ERROR_WARNING
range of 97-127 inclusive, the state handling code erroneously
reverts back to ERROR_ACTIVE.
Per the CAN standard, only revert to ERROR_ACTIVE when the
error counters are less than 96.
Moreover, in certain Kvaser models, the BUS_ERROR flag is
always set along with undefined bits in the M16C status
register. Thus use bitwise operators instead of full equality
for checking that register against bus errors.
Signed-off-by: Ahmed S. Darwish <ahmed.darwish@valeo.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>1 parent 1c13b0f commit bccd8fd
1 file changed
Lines changed: 3 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
698 | 698 | | |
699 | 699 | | |
700 | 700 | | |
701 | | - | |
702 | | - | |
703 | | - | |
| 701 | + | |
704 | 702 | | |
705 | 703 | | |
706 | 704 | | |
| |||
710 | 708 | | |
711 | 709 | | |
712 | 710 | | |
713 | | - | |
| 711 | + | |
| 712 | + | |
714 | 713 | | |
715 | 714 | | |
716 | 715 | | |
| |||
0 commit comments