From 07c7b6f6161be52b8ab6bca70ed6a7140708c94e Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Tue, 18 Mar 2014 17:19:10 +0000 Subject: [PATCH] can: c_can: Fix the lost message handling The lost message handling is broken in several ways. 1) Clearing the message lost flag is done by writing 0 to the message control register of the object. #define IF_MCONT_CLR_MSGLST (0 << 14) That clears the object buffer configuration in the worst case, which results in a loss of the EOB flag. That leaves the FIFO chain without a limit and causes a complete lockup of the HW 2) In case that the error skb allocation fails, the code happily claims that it handed down a packet. Just an accounting bug, but .... 3) The code adds a lot of pointless overhead to that error case, where we need to get stuff done as fast as possible to avoid more packet loss. - printk an annoying error message - reread the object buffer for nothing Fix is simple again: - Use the already known MSGCTRL content and only clear the MSGLST bit - Fix the buffer accounting by adding a proper return code - Remove the pointless operations Signed-off-by: Thomas Gleixner Signed-off-by: Marc Kleine-Budde --- Reading git-format-patch failed