linux-can.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Dual SJA1000 can controllers on SMP system.
@ 2013-06-13 12:47 Mirza Krak
  2013-06-16  9:20 ` Wolfgang Grandegger
  0 siblings, 1 reply; 10+ messages in thread
From: Mirza Krak @ 2013-06-13 12:47 UTC (permalink / raw)
  To: linux-can

Dear Sirs.

I am running a 3.1.10 kernel on Nvidia Tegra 2 CPU (Dual Core). Not 
vanilla kernel (Linux4Tegra).

We are using dual can controllers connected on th external data bus on 
our custom hardware. The can controllers are SJA1000.

Driver that is used is vanilla sja1000 driver (sja1000.c)

Now to the issue at hand. Will try my best to explain our scenario and 
issue:
     1. The two can controllers are connected with each other with a 
loop-back.
     2. What we are attempting is to send data on both controllers in 
two separate processes. We are using following command "cansequence can0 
-p &" and "cansequence can1 -p &". With a bit-rate configured to 1 Mbit/s.
     3. What we see when we attempt the above is that one of the 
controllers stop sending and the software buffer gets filled up. When it 
stops varies but usually after a few packets are sent.

After some digging we came to this conclusion. The two cansequence 
processes end up on different CPU cores. The process that ends up in 
CPU1 is the one that always stops transmitting.

Workarounds that we have seen that works is
     1. Disable dual core with kernel argument "maxcpus=1".
     2. Forcing the cansequence processes to CPU0 with "taskset" command.

My question to you is if anyone has tested the SJA1000 driver on an SMP 
system or anything similar.
-- 
Med Vänliga Hälsningar / Best Regards
Mirza

*******************************************************************
Mirza Krak
Host Mobility AB
mirza.krak@hostmobility.com
Anders Personsgatan 12, 416 64 Göteborg
Sweden
www.hostmobility.com <http://www.hostmobility.com>
Direct: +46 31 31 32 704
Phone: +46 31 31 32 700
Fax: +46 31 80 67 51
Mobile: +46 730 28 06 22
*******************************************************************


^ permalink raw reply	[flat|nested] 10+ messages in thread
* Re: Dual SJA1000 can controllers on SMP system.
@ 2013-06-16 11:20 mirza
  2013-06-16 12:39 ` Wolfgang Grandegger
  0 siblings, 1 reply; 10+ messages in thread
From: mirza @ 2013-06-16 11:20 UTC (permalink / raw)
  To: wg; +Cc: linux-can



-------- Ursprungligt meddelande --------
> Från: Wolfgang Grandegger <wg@grandegger.com>
> Skickat: den 16 juni 2013 11:19
> Till: Mirza Krak <mirza.krak@hostmobility.com>
> Ämne: Re: Dual SJA1000 can controllers on SMP system.
> 
> On 06/13/2013 02:47 PM, Mirza Krak wrote:
> > Dear Sirs.
> > 
> > I am running a 3.1.10 kernel on Nvidia Tegra 2 CPU (Dual Core). Not
> > vanilla kernel (Linux4Tegra).
> > 
> > We are using dual can controllers connected on th external data bus on
> > our custom hardware. The can controllers are SJA1000.
> 
> What external data bus is the CAN controller connected to?
> And which CAN controller board/card?

As I mentioned the CAN controllers are SJA1000 and the SJA1000 chip is integrated in our board. No external card/board for SJA1000 chip.

It is connected to the Nvidia Tegra 2 externa data bus (a.k.a SNOR). 

> > Driver that is used is vanilla sja1000 driver (sja1000.c)
> 
> Which bus driver is used and how do you load the module?

The bus driver is tegra_snor and is linked in statically in the kernel.  

> 
> > Now to the issue at hand. Will try my best to explain our scenario and
> > issue:
> >     1. The two can controllers are connected with each other with a
> > loop-back.
> >     2. What we are attempting is to send data on both controllers in two
> > separate processes. We are using following command "cansequence can0 -p
> > &" and "cansequence can1 -p &". With a bit-rate configured to 1 Mbit/s.
> >     3. What we see when we attempt the above is that one of the
> > controllers stop sending and the software buffer gets filled up. When it
> > stops varies but usually after a few packets are sent.
> > 
> > After some digging we came to this conclusion. The two cansequence
> > processes end up on different CPU cores. The process that ends up in
> > CPU1 is the one that always stops transmitting.
> > 
> > Workarounds that we have seen that works is
> >     1. Disable dual core with kernel argument "maxcpus=1".
> >     2. Forcing the cansequence processes to CPU0 with "taskset" command.
> > 
> > My question to you is if anyone has tested the SJA1000 driver on an SMP
> > system or anything similar.
> 
> Well, sending from two processes concurrently is not really a typical
> use case. ftrace is your friend. A function trace may help to find the
> root of the problem. Let me know if you need further help on that.

I agree that this is not the typical use case but I still don´t see why this would not work. Any tip on where to start tracing?

> 
> Wolfgang.
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-can" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html 



^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2013-06-17 19:34 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-13 12:47 Dual SJA1000 can controllers on SMP system Mirza Krak
2013-06-16  9:20 ` Wolfgang Grandegger
  -- strict thread matches above, loose matches on Subject: below --
2013-06-16 11:20 mirza
2013-06-16 12:39 ` Wolfgang Grandegger
2013-06-17  6:10   ` Mirza Krak
2013-06-17  7:18     ` Marc Kleine-Budde
2013-06-17 13:46       ` Mirza Krak
2013-06-17 14:12         ` Marc Kleine-Budde
2013-06-17 18:49           ` Mirza Krak
2013-06-17 19:34             ` Wolfgang Grandegger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).