Received: by 10.213.65.68 with SMTP id h4csp882454imn; Wed, 14 Mar 2018 03:06:10 -0700 (PDT) X-Google-Smtp-Source: AG47ELvjgRzXdciq80xiHF+ZQihwVlhDtmLkTj3Na7q2jsnx4Tdr4JBfAAPEyWyKz4M9bJkDjavY X-Received: by 2002:a17:902:8f89:: with SMTP id z9-v6mr3437972plo.370.1521021970146; Wed, 14 Mar 2018 03:06:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521021970; cv=none; d=google.com; s=arc-20160816; b=b8bnnqTleKpDFryjwpEEKnbtI8judiy5out3hzg6xggTOwGusSqHgWm1IafkiEG6yw uK668bBfEAj4TFjRnEsBp6SRZVZnc2VQNPmlsvsJ4roONcPEYcLjn9Q3BRIbttYvNDGI RDNe6Q9+9dm4Nz3K00xm3+jbi53jLRkNMo+8OcKLjsZ0mMi+CPfmVu9WkiGFEvv1MTmL VMMWulTXfGbcst1sYUavwmFP79I80tvJ0o3IJgnB4lxPHM00c5lOmxbO1ziwE8Oedjyd lqxgcyucefqCxyE0LvuEsryRMNWnHSBtPs1kZ5z2Zq4OoHZXswY0Xzhx/4rk1vxkJRyE nvTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=udhrQYMTe95V0h3dnlpw2DbgWFAVLn0oW+2xIM02drg=; b=1COJbdlg6619sXsXGYm1gUxsi8huPYCEx2qtMG711wd4m5Y8H0tIVxp15h4sB+I3z2 EucviW+BNHOxRciH0ZXdHI2N4RXOWXhEzjF98RwZ1+hm2I/fB+aarkzlAexup8ob2LI1 0vg/76tfiNk03YiPpd6ThIOwxOS7AUlyVDMaY/j8fwQgXnxpa7r1rmbisD5CrO1AkNTg f/v373/ZaDMKsr0s8Yc3jk8F6drE36X+zQI/ONNl1KW6ZkuCsAVUXVnBtnT9ubDvh4jj NUA2zq8Kh83sWkl8kaMouqSzTFQuQ6WfcSN6ha1xc4lUcL9aiAQT1E6hd5v0TnUv4EJZ tEcQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y1-v6si1824252pli.586.2018.03.14.03.05.55; Wed, 14 Mar 2018 03:06:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751420AbeCNKFA (ORCPT + 99 others); Wed, 14 Mar 2018 06:05:00 -0400 Received: from mailproxy03.manitu.net ([217.11.48.67]:56196 "EHLO mailproxy03.manitu.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750879AbeCNKE6 (ORCPT ); Wed, 14 Mar 2018 06:04:58 -0400 Received: from [192.168.178.20] (aftr-185-17-207-68.dynamic.mnet-online.de [185.17.207.68]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: wg@grandegger.com) by mailproxy03.manitu.net (Postfix) with ESMTPSA id 99BDFD40055; Wed, 14 Mar 2018 11:04:56 +0100 (CET) Subject: Re: [PATCH v2 1/1] can: ucan: add driver for Theobroma Systems UCAN devices To: Jakob Unterwurzacher Cc: Martin Elshuber , Philipp Tomsich , Marc Kleine-Budde , linux-can@vger.kernel.org, linux-kernel@vger.kernel.org References: <20180313173520.21257-1-jakob.unterwurzacher@theobroma-systems.com> <20180313173520.21257-2-jakob.unterwurzacher@theobroma-systems.com> <03024ab7-5386-3bcf-76f2-ef2e0e9e7a78@theobroma-systems.com> <68564c40-396b-9081-8534-67fe96a6fb3f@grandegger.com> <92e559b1-d392-015e-1aa1-0497cbd4c071@grandegger.com> <5b3df9d5-3e65-1114-4b51-9dcc329cbc31@theobroma-systems.com> From: Wolfgang Grandegger Message-ID: Date: Wed, 14 Mar 2018 11:04:56 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <5b3df9d5-3e65-1114-4b51-9dcc329cbc31@theobroma-systems.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Jakob, Am 14.03.2018 um 10:48 schrieb Jakob Unterwurzacher: > On 14.03.18 10:25, Wolfgang Grandegger wrote: >>> Counting the state changes is one thing but you should also generate >>> error messages for them. >> >> The usual test here is: >> >> $ candump -td -e any,0:0,#FFFFFFFF >> >> should report proper state changes, if you send messages with >> >> 1. no cable connected >> 2. CAN high and low short-circuited >> >> Also downwards if the hardware error is gone and you continue to send >> messages. > Yes, we do, the hardware does it. Testcases: > > (1) no cable connected > >> root@rk3399-q7:~# candump -td -e any,0:0,#FFFFFFFF | head -n 1000 >>  (000.000000)  can0  178   [0] >>  (000.000410)  can0  20000030   [8]  00 00 00 00 00 00 08 00   ERRORFRAME >>     transceiver-status >>     no-acknowledgement-on-tx >>     error-counter-tx-rx{{8}{0}} >>  (000.000445)  can0  20000030   [8]  00 00 00 00 00 00 10 00   ERRORFRAME >>     transceiver-status >>     no-acknowledgement-on-tx >>     error-counter-tx-rx{{16}{0}} >>  (000.000425)  can0  20000030   [8]  00 00 00 00 00 00 18 00   ERRORFRAME >>     transceiver-status >>     no-acknowledgement-on-tx >>     error-counter-tx-rx{{24}{0}} >>  (000.000451)  can0  20000030   [8]  00 00 00 00 00 00 20 00   ERRORFRAME >>     transceiver-status >>     no-acknowledgement-on-tx >>     error-counter-tx-rx{{32}{0}} >>  (000.000429)  can0  20000030   [8]  00 00 00 00 00 00 28 00   ERRORFRAME >>     transceiver-status >>     no-acknowledgement-on-tx >>     error-counter-tx-rx{{40}{0}} >>  (000.000448)  can0  20000030   [8]  00 00 00 00 00 00 30 00   ERRORFRAME >>     transceiver-status >>     no-acknowledgement-on-tx >>     error-counter-tx-rx{{48}{0}} >>  (000.000433)  can0  20000030   [8]  00 00 00 00 00 00 38 00   ERRORFRAME >>     transceiver-status >>     no-acknowledgement-on-tx >>     error-counter-tx-rx{{56}{0}} >>  (000.000437)  can0  20000030   [8]  00 00 00 00 00 00 40 00   ERRORFRAME >>     transceiver-status >>     no-acknowledgement-on-tx >>     error-counter-tx-rx{{64}{0}} >>  (000.000443)  can0  20000030   [8]  00 00 00 00 00 00 48 00   ERRORFRAME >>     transceiver-status >>     no-acknowledgement-on-tx >>     error-counter-tx-rx{{72}{0}} >>  (000.000437)  can0  20000030   [8]  00 00 00 00 00 00 50 00   ERRORFRAME >>     transceiver-status >>     no-acknowledgement-on-tx >>     error-counter-tx-rx{{80}{0}} >>  (000.000498)  can0  20000030   [8]  00 00 00 00 00 00 58 00   ERRORFRAME >>     transceiver-status >>     no-acknowledgement-on-tx >>     error-counter-tx-rx{{88}{0}} >>  (000.000394)  can0  20000034   [8]  00 0C 00 00 00 00 60 00   ERRORFRAME >>     controller-problem{rx-error-warning,tx-error-warning} >>     transceiver-status >>     no-acknowledgement-on-tx >>     error-counter-tx-rx{{96}{0}} >>  (000.000433)  can0  20000034   [8]  00 0C 00 00 00 00 68 00   ERRORFRAME >>     controller-problem{rx-error-warning,tx-error-warning} >>     transceiver-status >>     no-acknowledgement-on-tx >>     error-counter-tx-rx{{104}{0}} >>  (000.000437)  can0  20000034   [8]  00 0C 00 00 00 00 70 00   ERRORFRAME >>     controller-problem{rx-error-warning,tx-error-warning} >>     transceiver-status >>     no-acknowledgement-on-tx >>     error-counter-tx-rx{{112}{0}} >>  (000.000443)  can0  20000034   [8]  00 0C 00 00 00 00 78 00   ERRORFRAME >>     controller-problem{rx-error-warning,tx-error-warning} >>     transceiver-status >>     no-acknowledgement-on-tx >>     error-counter-tx-rx{{120}{0}} >>  (000.000444)  can0  20000034   [8]  00 3C 00 00 00 00 80 00   ERRORFRAME >>     controller-problem{rx-error-warning,tx-error-warning,rx-error-passive,tx-error-passive} Just, controller-problem{rx-error-passive,tx-error-passive} >> >>     transceiver-status >>     no-acknowledgement-on-tx >>     error-counter-tx-rx{{128}{0}} >>  (000.000495)  can0  20000024   [8]  00 3C 00 00 00 00 80 00   ERRORFRAME >>     controller-problem{rx-error-warning,tx-error-warning,rx-error-passive,tx-error-passive} >> >>     no-acknowledgement-on-tx >>     error-counter-tx-rx{{128}{0}} > > Repeats ad infinitum... Good! And without "berr-reporting" just the state changes should show up. > > > (1b) cable gets connected: > >>  (000.000883)  can0  20000034   [8]  00 3C 00 00 00 00 80 00   ERRORFRAME >>     controller-problem{rx-error-warning,tx-error-warning,rx-error-passive,tx-error-passive} >> >>     transceiver-status >>     no-acknowledgement-on-tx >>     error-counter-tx-rx{{128}{0}} >>  (000.000996)  can0  20000004   [8]  00 0C 00 00 00 00 7F 00   ERRORFRAME >>     controller-problem{rx-error-warning,tx-error-warning} >>     error-counter-tx-rx{{127}{0}} Back to error active is missing!? Have a look to: https://elixir.bootlin.com/linux/latest/source/drivers/net/can/dev.c#L364 Wolfgang.