All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mirza Krak <mirza.krak@gmail.com>
To: Wolfgang Grandegger <wg@grandegger.com>
Cc: Marc Kleine-Budde <mkl@pengutronix.de>,
	"ZHU Yi (ST-FIR/ENG1-Zhu)" <Yi.Zhu5@cn.bosch.com>,
	Pankaj Bansal <pankaj.bansal@nxp.com>,
	"linux-can@vger.kernel.org" <linux-can@vger.kernel.org>,
	Varun Sethi <V.Sethi@nxp.com>,
	Poonam Aggrwal <poonam.aggrwal@nxp.com>,
	Stefan Agner <stefan@agner.ch>
Subject: Re: [PATCH v2 2/2] can: flexcan: adding platform specific details for LS1021A
Date: Fri, 24 Nov 2017 17:02:31 +0100	[thread overview]
Message-ID: <CALw8SCWFDt58x6zrbnoXuX=DkG0+OZtXnCO5CdK+MQb2JyubuA@mail.gmail.com> (raw)
In-Reply-To: <e318ca19-bb08-f537-ed7a-4f8008b9a341@grandegger.com>

2017-11-23 22:05 GMT+01:00 Wolfgang Grandegger <wg@grandegger.com>:
> Hello Mirza,
>
> Am 23.11.2017 um 21:17 schrieb Mirza Krak:
>>
>> 2017-11-23 21:12 GMT+01:00 Mirza Krak <mirza.krak@gmail.com>:
>>>
>>> On Nov 22, 2017 13:00, "Marc Kleine-Budde" <mkl@pengutronix.de> wrote:
>>>
>>
>> < snip >
>>
>>>
>>> Cc'ed Stefan Agner - maybe he has access to this SoC.
>>>
>>>> @Marc, @Wolfgang,
>>>> What do you think? Or shall we fix first and then wait?
>>>
>>>
>>> Let's wait if Stefan can test, otherwise just fix.
>>>
>>>
>>> I have access to an vf610 and can test CAN stuff.
>>>
>>> What is it more specifically we want to test? I read the thread but not
>>> completely clear to me.
>
>
> We want to know how the reporting of CAN error state changes "error-active"
> -> "warning" -> "error-passive" -> "bus-off" and back is working on that
> hardware.
>
> You can test such state changes as show below. First setup the interface and
> start a session calling "candump" to report the state changes:
>
>   # ip link set can0 up type can bitrate 500000 restart-ms 100
>   # candump -td -e any,0:0,#FFFFFFFF
>
> Then
>
> 1. disconnect the cable and send messages with "cangen"
>
>    # cangen -i can0
>
> "candump" should then report the error state changes "error-active" ->
> "warning" -> "error-passive". If you don't see "error-passive", the hardware
> needs the FLEXCAN_QUIRK_BROKEN_PERR_STATE as well. Then reconnect the cable
> and send messages till the "error active" state is reached (again with
> "cangen").

This was the result of this test:

root@colibri-vf:~# ./candump -td -e can0,0:0,#FFFFFFFF
 (000.000000)  can0  0C8   [8]  E7 D5 75 20 1C F8 AA 6D
 (000.200201)  can0  7CD   [8]  58 5F B1 1E D7 AB 3C 15
 (000.200123)  can0  7FD   [8]  EC 43 EF 11 BB 76 50 4F
 (000.200119)  can0  20D   [8]  64 E0 A6 74 A2 A4 22 42
 (000.200115)  can0  226   [7]  CB 4D 12 46 F3 37 F1
 (000.200000)  can0  42F   [0]
 (000.200245)  can0  0F9   [8]  AD 61 16 77 0A 64 50 5C
 (000.199983)  can0  76E   [0]
 (000.200206)  can0  3CB   [6]  53 28 03 34 98 43
 (000.200152)  can0  230   [8]  70 EF 66 38 2D BA 5D 4D
 (000.200106)  can0  568   [8]  E8 30 AE 1C 75 77 4E 5E
 (000.200274)  can0  20000004   [8]  00 04 00 00 00 00 00 00   ERRORFRAME
controller-problem{rx-error-warning}

and the statistics

root@colibri-vf:~# ip -d -s link show can0
2: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state
UNKNOWN mode DEFAULT group default qlen 10
    link/can  promiscuity 0
    can state ERROR-WARNING (berr-counter tx 0 rx 128) restart-ms 100
 bitrate 496240 sample-point 0.857
 tq 143 prop-seg 5 phase-seg1 6 phase-seg2 2 sjw 1
 flexcan: tseg1 4..16 tseg2 2..8 sjw 1..4 brp 1..256 brp-inc 1
 clock 83368421
 re-started bus-errors arbit-lost error-warn error-pass bus-off
 0          0          0          1          0          0         numtxqueues 1
    RX: bytes  packets  errors  dropped overrun mcast
    8          1        0       0       0       0
    TX: bytes  packets  errors  dropped carrier collsns
    69         11       0       0       0       0

I ran out of time as wanted to test a bit more as I was confused that
it is showing RX errors on the first test? I was not able to get it
back to ERROR-ACTIVE from ERROR-WARNING either. But posted result
anyway


> 2. The second test is quite similar. Instead of disconnecting the cable,
> short-circuit the CAN low and high lines. The device should then go to
> "bus-off".

And this one:

root@colibri-vf:~# ./candump -td -e any,0:0,#FFFFFFFF
 (000.000000)  can0  20000004   [8]  00 20 00 00 00 00 00 00   ERRORFRAME
controller-problem{tx-error-passive}
 (000.000809)  can0  20000040   [8]  00 00 00 00 00 00 00 00   ERRORFRAME
bus-off
 (000.109797)  can0  20000100   [8]  00 00 00 00 00 00 00 00   ERRORFRAME
restarted-after-bus-off
 (000.100551)  can0  20000004   [8]  00 20 00 00 00 00 00 00   ERRORFRAME
controller-problem{tx-error-passive}
 (000.000823)  can0  20000040   [8]  00 00 00 00 00 00 00 00   ERRORFRAME
bus-off
 (000.108644)  can0  20000100   [8]  00 00 00 00 00 00 00 00   ERRORFRAME
restarted-after-bus-off
 (000.090692)  can0  20000004   [8]  00 08 00 00 00 00 00 00   ERRORFRAME
controller-problem{tx-error-warning}
 (000.000797)  can0  20000040   [8]  00 00 00 00 00 00 00 00   ERRORFRAME
bus-off

Will try again next week when I am back at the office.

I ran my tests on 4.14 kernel.

Best Regards
Mirza

  reply	other threads:[~2017-11-24 16:02 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-10  9:59 [PATCH 1/2] can: flexcan: Remodel FlexCAN register r/w APIs for big endian FlexCAN controllers Pankaj Bansal
2017-11-10  9:59 ` [PATCH 2/2] can: flexcan: adding platform specific details for LS1021A Pankaj Bansal
2017-11-10 10:06 ` [PATCH 1/2] can: flexcan: Remodel FlexCAN register r/w APIs for big endian FlexCAN controllers Marc Kleine-Budde
2017-11-10 11:06   ` Pankaj Bansal
2017-11-10 11:09     ` Marc Kleine-Budde
2017-11-10 12:35       ` Pankaj Bansal
     [not found]         ` <AM0PR0402MB394051B0FAADBC45AF71439CF1540-mYCQpYF9suc3mfjNbz3WnI3W/0Ik+aLCnBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2017-11-10 12:49           ` Marc Kleine-Budde
2017-11-10 16:32             ` Pankaj Bansal
     [not found]               ` <AM0PR0402MB3940DE05B2BA456D0FF54498F1540-mYCQpYF9suc3mfjNbz3WnI3W/0Ik+aLCnBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2017-11-13 15:50                 ` Marc Kleine-Budde
2017-11-10 10:48 ` Marc Kleine-Budde
2017-11-14 11:56 ` [PATCH v2 " Pankaj Bansal
2017-11-14 11:56   ` [PATCH v2 2/2] can: flexcan: adding platform specific details for LS1021A Pankaj Bansal
2017-11-14 12:59     ` Marc Kleine-Budde
2017-11-16  5:34       ` Pankaj Bansal
2017-11-16  7:05         ` Wolfgang Grandegger
2017-11-16  7:23           ` ZHU Yi (ST-FIR/ENG1-Zhu)
2017-11-20 11:11             ` Pankaj Bansal
2017-11-21  2:13               ` ZHU Yi (ST-FIR/ENG1-Zhu)
2017-11-21  2:37                 ` Pankaj Bansal
2017-11-21  3:31                   ` ZHU Yi (ST-FIR/ENG1-Zhu)
2017-11-21 10:01                     ` Pankaj Bansal
2017-11-23  7:23                       ` ZHU Yi (ST-FIR/ENG1-Zhu)
2017-11-21 12:43                 ` Marc Kleine-Budde
2017-11-22  2:56                   ` ZHU Yi (ST-FIR/ENG1-Zhu)
2017-11-22  6:27                     ` Pankaj Bansal
2017-11-22 13:56                       ` Marc Kleine-Budde
2017-11-22 11:59                     ` Marc Kleine-Budde
2017-11-23  1:26                       ` ZHU Yi (ST-FIR/ENG1-Zhu)
     [not found]                       ` <CALw8SCUGuCmq+S_9-o-ZDYJuASveuj71WH97jYsEvNZX2N5ZXA@mail.gmail.com>
2017-11-23 20:17                         ` Mirza Krak
2017-11-23 21:05                           ` Wolfgang Grandegger
2017-11-24 16:02                             ` Mirza Krak [this message]
2017-11-24 19:19                               ` Wolfgang Grandegger
2017-11-26 21:11                                 ` Mirza Krak
2017-11-27 14:00                                   ` Marc Kleine-Budde
     [not found]                                     ` <CALw8SCVNqN0SM1e=bxXZFMVL0VN0iy0LgFj9Hv4BeRwAbb9Y6A@mail.gmail.com>
2017-11-28 22:11                                       ` Mirza Krak
2017-12-01 10:12                                         ` Mirza Krak
2017-12-01 10:32                                           ` Marc Kleine-Budde
2017-11-27 16:34                           ` Stefan Agner
2017-11-14 15:24   ` [PATCH v2 1/2] can: flexcan: Remodel FlexCAN register r/w APIs for big endian FlexCAN controllers Marc Kleine-Budde
2017-11-16  5:24     ` Pankaj Bansal
2017-11-16 12:04       ` Marc Kleine-Budde
2017-11-21 12:18     ` Pankaj Bansal
2017-11-21 12:38       ` Marc Kleine-Budde
2017-11-23  9:09   ` [PATCH v3 " Pankaj Bansal
2017-11-23  9:09     ` [PATCH v3 2/2] can: flexcan: adding platform specific details for LS1021A Pankaj Bansal
2017-11-23  9:16       ` Marc Kleine-Budde
2017-11-23 10:01         ` Pankaj Bansal
2017-11-23 10:07           ` Marc Kleine-Budde
2017-11-23 12:01             ` Pankaj Bansal
2017-11-23 12:33               ` Marc Kleine-Budde
2017-11-23  9:18     ` [PATCH v3 1/2] can: flexcan: Remodel FlexCAN register r/w APIs for big endian FlexCAN controllers Marc Kleine-Budde
2017-11-23  9:55       ` Pankaj Bansal

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='CALw8SCWFDt58x6zrbnoXuX=DkG0+OZtXnCO5CdK+MQb2JyubuA@mail.gmail.com' \
    --to=mirza.krak@gmail.com \
    --cc=V.Sethi@nxp.com \
    --cc=Yi.Zhu5@cn.bosch.com \
    --cc=linux-can@vger.kernel.org \
    --cc=mkl@pengutronix.de \
    --cc=pankaj.bansal@nxp.com \
    --cc=poonam.aggrwal@nxp.com \
    --cc=stefan@agner.ch \
    --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.