From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wolfgang Grandegger Subject: Re: [PATCH resend] can: c_can: Fix tx_bytes accounting Date: Thu, 24 Mar 2011 12:49:03 +0100 Message-ID: <4D8B2FAF.5040000@grandegger.com> References: <16a340801622a96218c76dbbabc7a23f.squirrel@www.linutronix.de> <1300963120.3295.7.camel@localhost> <4D8B1641.6000706@grandegger.com> <1300966010.3295.40.camel@localhost> <20110324104925.GB339@e-circ.dyndns.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Jan Altenberg , Bhupesh SHARMA , "b.spranger-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org" , "netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , " Return-path: In-Reply-To: <20110324104925.GB339-MxZ6Iy/zr/UdbCeoMzGj59i2O/JbrIOy@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: socketcan-core-bounces-0fE9KPoRgkgATYTw5x5z8w@public.gmane.org Errors-To: socketcan-core-bounces-0fE9KPoRgkgATYTw5x5z8w@public.gmane.org List-Id: netdev.vger.kernel.org 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 > Acked-by: Kurt Van Dijck Acked-by: Wolfgang Grandegger