From: Ahmed S. Darwish Date: Mon, 26 Jan 2015 05:25:43 +0000 (+0200) Subject: can: kvaser_usb: Fix state handling upon BUS_ERROR events X-Git-Tag: omap-for-v4.1/prcm-dts-mfd-syscon-fix~219^2~6^2 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e638642b08c170d2021b706f0b1c4f4ae93d8cbd;p=pandora-kernel.git can: kvaser_usb: Fix state handling upon BUS_ERROR events 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 Cc: linux-stable Signed-off-by: Marc Kleine-Budde --- Reading git-diff-tree failed