Subject: Re: [PATCH resend] can: c_can: Fix tx_bytes accounting

From: Wolfgang Grandegger <[email-masked]>
Date: Thu, 24 Mar 2011 12:49:03 +0100

On 03/24/2011 11:49 AM, Kurt Van Dijck wrote:
> On Thu, Mar 24, 2011 at 12:26:50PM +0100, Jan Altenberg wrote:
>> The current SocketCAN implementation for the Bosch c_can cell doesn't
>> account the TX bytes correctly, because it calls
>> c_can_inval_msg_object() (which clears the msg ctrl register) before
>> reading the DLC value:
>>
>> The fix is quite easy: Just move c_can_inval_msg_object() to the end of
>> the if() statement. So:
>>       * We only call c_can_inval_msg_object() if the message was
>>         actually transmitted
>>       * We read out the DLC value _before_ clearing the msg ctrl
>>         register
>>
>> Signed-off-by: Jan Altenberg <[email-masked]>
> Acked-by: Kurt Van Dijck <kurt.van.dijck-/[email-masked]>
Acked-by: Wolfgang Grandegger <[email-masked]>