From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mirza Krak Subject: Re: [PATCH v2 2/2] can: flexcan: adding platform specific details for LS1021A Date: Fri, 24 Nov 2017 17:02:31 +0100 Message-ID: References: <1510307990-15418-1-git-send-email-pankaj.bansal@nxp.com> <1510660589-16125-1-git-send-email-pankaj.bansal@nxp.com> <1510660589-16125-2-git-send-email-pankaj.bansal@nxp.com> <828fba89-66dc-a2c5-e095-8554b9dce5d5@pengutronix.de> <343d8c69-a01a-5ff7-75a2-99523391f97c@grandegger.com> <3e201945af364c5a8a92dd6a931f4448@SGPMBX1017.APAC.bosch.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Return-path: Received: from mail-qt0-f180.google.com ([209.85.216.180]:43458 "EHLO mail-qt0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751838AbdKXQCd (ORCPT ); Fri, 24 Nov 2017 11:02:33 -0500 Received: by mail-qt0-f180.google.com with SMTP id w10so19950793qtb.10 for ; Fri, 24 Nov 2017 08:02:32 -0800 (PST) In-Reply-To: Sender: linux-can-owner@vger.kernel.org List-ID: To: Wolfgang Grandegger Cc: Marc Kleine-Budde , "ZHU Yi (ST-FIR/ENG1-Zhu)" , Pankaj Bansal , "linux-can@vger.kernel.org" , Varun Sethi , Poonam Aggrwal , Stefan Agner 2017-11-23 22:05 GMT+01:00 Wolfgang Grandegger : > Hello Mirza, > > Am 23.11.2017 um 21:17 schrieb Mirza Krak: >> >> 2017-11-23 21:12 GMT+01:00 Mirza Krak : >>> >>> On Nov 22, 2017 13:00, "Marc Kleine-Budde" 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: 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