summaryrefslogtreecommitdiffstats
path: root/net/can
diff options
context:
space:
mode:
authorJeroen Hofstee <jhofstee@victronenergy.com>2019-09-24 18:46:03 +0000
committerMarc Kleine-Budde <mkl@pengutronix.de>2019-11-04 21:47:23 +0100
commit3b2d652da21450aba19d299a75fe3a6f5d4003ff (patch)
tree8a88ce5c428a2f283c1018fa7a28b48cd0b1f3aa /net/can
parent678d85ed8554e1d6c9720ebcab785eea8fe0d4ef (diff)
downloadlinux-3b2d652da21450aba19d299a75fe3a6f5d4003ff.tar.bz2
can: ti_hecc: properly report state changes
The HECC_CANES register handles the flags specially, it only updates the flags after a one is written to them. Since the interrupt for frame errors is not enabled an old error can hence been seen when a state interrupt arrives. For example if the device is not connected to the CAN-bus the error warning interrupt will have HECC_CANES indicating there is no ack. The error passive interrupt thereafter will have HECC_CANES flagging that there is a warning level. And if thereafter there is a message successfully send HECC_CANES points to an error passive event, while in reality it became error warning again. In summary, the state is not always reported correctly. So handle the state changes and frame errors separately. The state changes are now based on the interrupt flags and handled directly when they occur. The reporting of the frame errors is still done as before, as a side effect of another interrupt. note: the hecc_clear_bit will do a read, modify, write. So it will not only clear the bit, but also reset all other bits being set as a side affect, hence it is replaced with only clearing the flags. note: The HECC_CANMC_CCR is no longer cleared in the state change interrupt, it is completely unrelated. And use net_ratelimit to make checkpatch happy. Signed-off-by: Jeroen Hofstee <jhofstee@victronenergy.com> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'net/can')
0 files changed, 0 insertions, 0 deletions