public inbox for linux-can@vger.kernel.org
 help / color / mirror / Atom feed
From: Wolfgang Grandegger <wg@grandegger.com>
To: Krzysztof Witkowski <Krzysztof.Witkowski@mobile.put.edu.pl>
Cc: linux-can@vger.kernel.org
Subject: Re: CPU load inhibits CAN interrupts
Date: Wed, 11 Apr 2012 15:23:50 +0200	[thread overview]
Message-ID: <4F8585E6.3070901@grandegger.com> (raw)
In-Reply-To: <4F85518F.9020305@mobile.put.edu.pl>

On 04/11/2012 11:40 AM, Krzysztof Witkowski wrote:
> W dniu 4/10/2012 7:48 PM, Wolfgang Grandegger pisze:
>>> However, if I generate artificial CPU load with stress command:
>>>
>>>     chrt --idle 0 stress -c 2
>>
>> What does "-c 2" do? My "chrt" command does not have that option.
> 
> It is an option for stress command:
> -c, --cpu N
>               spawn N workers spinning on sqrt()
> 
>>> Why CPU load inhibits hardware interrupts and what can be done about it?
>>
>> Hm, what does "ip -d -s can0" report while you are producing CPU load
>> with the stress command above.
> 
> # ip -s -d link show can0
> 
> 4: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UNKNOWN
> mode DEFAULT qlen 10
>     link/can
>     can state ERROR-PASSIVE (berr-counter tx 0 rx 128) restart-ms 100
>     bitrate 1000000 sample-point 0.750
>     tq 125 prop-seg 2 phase-seg1 3 phase-seg2 2 sjw 2

Why did you set sja to 2? To avoid bus errors? If yes, maybe 4 is better.

>     sja1000: tseg1 1..16 tseg2 1..8 sjw 1..4 brp 1..64 brp-inc 1
>     clock 8000000
>     re-started bus-errors arbit-lost error-warn error-pass bus-off
>     0          0          0          1          1          0
>     RX: bytes  packets  errors  dropped overrun mcast
>     728        91       0       0       0       0
>     TX: bytes  packets  errors  dropped carrier collsns
>     0          0        0       0       0       0
> 
> 
> It can occasionally deliver packets, but the rate is no more than ~2
> packets/second.

Strange, anyway, the statistics above reports electrical problems on the
CAN bus. What do you get with the "ip" option "berr-reporting on?
Is there an app reading the CAN messages at the same time?

BTW: what SJA1000 driver and kernel version do you use?

Wolfgang.

      reply	other threads:[~2012-04-11 13:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-10 14:40 CPU load inhibits CAN interrupts Krzysztof Witkowski
2012-04-10 17:48 ` Wolfgang Grandegger
2012-04-11  9:40   ` Krzysztof Witkowski
2012-04-11 13:23     ` Wolfgang Grandegger [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F8585E6.3070901@grandegger.com \
    --to=wg@grandegger.com \
    --cc=Krzysztof.Witkowski@mobile.put.edu.pl \
    --cc=linux-can@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox