All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stanislav Meduna <stano@meduna.org>
To: linux-can@vger.kernel.org
Cc: wg@grandegger.com, Marc Kleine-Budde <mkl@pengutronix.de>
Subject: FlexCAN i.MX28 BUG! hardware recovered automatically from BUS_OFF
Date: Wed, 16 Apr 2014 13:52:43 +0200	[thread overview]
Message-ID: <534E6F0B.70100@meduna.org> (raw)

On 07.03.2014 09:08, Stanislav Meduna wrote:
Hi,

I am using a FlexCAN CAN controller on a Freescale i.MX28
platform [1] and I am upgrading from kernel 3.4 to 3.12.15-rt25.
I am testing the behaviour regarding bus errors, so I run
a test program where the can1 sends and can0 receives and
I am trying to induce bus problems.

If there is no ip link set ... restart-ms parametrized,
the bus does not recover from being left unconnected for
a while

# ip -d -s link show can1
3: can1: <NO-CARRIER,NOARP,UP,ECHO> mtu 16 qdisc pfifo_fast state DOWN qlen 10
    link/can
    can state BUS-OFF (berr-counter tx 0 rx 0) restart-ms 0
    bitrate 500000 sample-point 0.875
    tq 125 prop-seg 6 phase-seg1 7 phase-seg2 2 sjw 1
    flexcan: tseg1 4..16 tseg2 2..8 sjw 1..4 brp 1..256 brp-inc 1
    clock 24000000
    re-started bus-errors arbit-lost error-warn error-pass bus-off
    0          0          0          7          3          2
    RX: bytes  packets  errors  dropped overrun mcast
    320        130      0       0       0       0
    TX: bytes  packets  errors  dropped carrier collsns
    117        59       0       1       0       0

If I configure restart-ms 100, the controller recovers

3: can1: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UP qlen 10
    link/can
    can state ERROR-ACTIVE (berr-counter tx 0 rx 0) restart-ms 100
    bitrate 500000 sample-point 0.875
    tq 125 prop-seg 6 phase-seg1 7 phase-seg2 2 sjw 1
    flexcan: tseg1 4..16 tseg2 2..8 sjw 1..4 brp 1..256 brp-inc 1
    clock 24000000
    re-started bus-errors arbit-lost error-warn error-pass bus-off
    20         0          0          27         23         22
    RX: bytes  packets  errors  dropped overrun mcast
    960        210      0       0       0       0
    TX: bytes  packets  errors  dropped carrier collsns
    147        73       0       22      0       0

but while disconnected it floods the log with

[ 1866.452038] flexcan 80034000.can can1: writing ctrl=0x0231a055
[ 1867.447723] flexcan 80034000.can can1: BUG! hardware recovered automatically from BUS_OFF
[ 1867.456128] flexcan 80034000.can can1: writing ctrl=0x0231a055
[ 1868.447649] flexcan 80034000.can can1: BUG! hardware recovered automatically from BUS_OFF

Is this the expected behaviour? What exactly is the "BUG"?

Please Cc: me when replying.

[1] http://www.tq-group.com/en/products/product-details/prod/embedded-modul-tqma28/extb/Main/productdetail/

Thanks
-- 
                                              Stano


                 reply	other threads:[~2014-04-16 11:52 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=534E6F0B.70100@meduna.org \
    --to=stano@meduna.org \
    --cc=linux-can@vger.kernel.org \
    --cc=mkl@pengutronix.de \
    --cc=wg@grandegger.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.