From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wolfgang Grandegger Subject: Re: pch_can: Data transmission stops after dropped packet Date: Sat, 24 Nov 2012 08:16:10 +0100 Message-ID: <50B0743A.4080203@grandegger.com> References: <50AA4FB3.7070009@grandegger.com> <50AA5EE6.6060105@grandegger.com> <50AA86DB.7000506@grandegger.com> <50AAA8C8.2080504@grandegger.com> <50ABABDE.8060503@grandegger.com> <50ABF09C.8040303@grandegger.com> <50ACABE2.2020306@grandegger.com> <50ACF9C0.8050206@grandegger.com> <50AD042B.3020305 @grandegger.com> <50AD319E.2000209@grandegger.com> <50AF8C01.6060809@grandegger.com> <50AFABB1.7080507@grandegger.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: Received: from ngcobalt02.manitu.net ([217.11.48.102]:56209 "EHLO ngcobalt02.manitu.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751160Ab2KXHQO (ORCPT ); Sat, 24 Nov 2012 02:16:14 -0500 In-Reply-To: <50AFABB1.7080507@grandegger.com> Sender: linux-can-owner@vger.kernel.org List-ID: To: Michael Pellegrini Cc: linux-can@vger.kernel.org, "bhupesh.sharma" On 11/23/2012 06:00 PM, Wolfgang Grandegger wrote: > On 11/23/2012 04:04 PM, Michael Pellegrini wrote: >> Wolfgang Grandegger grandegger.com> writes: >> >>> Did you see any other related kernel messages? For real testing you >>> should remove the debug message above. I will try to add a more >>> sophisticated trigger. >> >> I didn't see any other messages. That message prints in such a tight >> loop that it's hard to catch any other messages. > > That's clear. Therefore please remove that printk for testing. For a > quick test could you please add spin_locks to c_can_do_rx_poll() similar > to c_can_do_tx(). My suspicion is that there is a race in accessing the > message ram. There is this infamous c_can_msg_obj_is_busy() in > c_can_object_get() and c_can_object_put(). At a closer look I realized that the c_can driver uses IF1 for both, RX and TX. The manual recommends to use one IF for RX and the other for TX to avoid conflicts between the CPU access to the message RAM. I see this implemented in the pch_can driver but not the c_can driver. Bhupesh, any comments? Maybe I have missed something. Wolfgang.