]> git.baikalelectronics.ru Git - kernel.git/commit
can: esd_usb: Allow REC and TEC to return to zero
authorFrank Jungclaus <frank.jungclaus@esd.eu>
Wed, 30 Nov 2022 20:22:42 +0000 (21:22 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Dec 2022 10:30:48 +0000 (11:30 +0100)
commit56de1e2e0b1849e154e4941ccc2c9ed4f62702dc
treeb0b6debf7952b19d04c8c1600f14f3b35aecc310
parent8a5c5ff78ccb0b1dacaaea02dd20a4c6c154a0b7
can: esd_usb: Allow REC and TEC to return to zero

[ Upstream commit 918ee4911f7a41fb4505dff877c1d7f9f64eb43e ]

We don't get any further EVENT from an esd CAN USB device for changes
on REC or TEC while those counters converge to 0 (with ecc == 0). So
when handling the "Back to Error Active"-event force txerr = rxerr =
0, otherwise the berr-counters might stay on values like 95 forever.

Also, to make life easier during the ongoing development a
netdev_dbg() has been introduced to allow dumping error events send by
an esd CAN USB device.

Fixes: 37ca9589408a ("can: Add driver for esd CAN-USB/2 device")
Signed-off-by: Frank Jungclaus <frank.jungclaus@esd.eu>
Link: https://lore.kernel.org/all/20221130202242.3998219-2-frank.jungclaus@esd.eu
Cc: stable@vger.kernel.org
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/can/usb/esd_usb2.c