Received: by 10.213.65.68 with SMTP id h4csp866096imn; Wed, 14 Mar 2018 02:27:43 -0700 (PDT) X-Google-Smtp-Source: AG47ELubg539UKFTERTNzJEU9nIOAmaR3kwm8/wdh606d8NRBpe84OGreDb6YMNBt+ZYygCtCy2C X-Received: by 10.101.82.10 with SMTP id o10mr3121036pgp.271.1521019663232; Wed, 14 Mar 2018 02:27:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521019663; cv=none; d=google.com; s=arc-20160816; b=AoDJhRPADHgVfBBVM0c3mxYg69Z316ArgesLDZex1hHaLunlY4YwHRoWXslDmVtSW7 cGrkE232dAwZrEl4ywx+sIdutszY2EUufGHEsN/J24hMx5yhGACloNDPpIPWDbX0oHlL cqM5UkKA52AKldOm2sOKwqFdvjX2yjXArqiq+MWvgZZcH5JV2l2D4wtsDaOonNfkPk+p 6ZidX2rQrARY+YmCR1vtJwkTdzxvHCMMa/BoNY8RxJ16ZsgbQoOkvHeF4i8OIMi3rjfV ZDUGDp/e5UCJEAu4v1hrUPEjDXloxLFAReu0pQJXchcr6Yo2Rdb0Bi65wEvYQfDRPthm pIMA== 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:references:cc:to:from:subject:arc-authentication-results; bh=DBQz6btDQqKLSNawTM0lbHErYYhG8HcuP2reMP8BB8Y=; b=0IYzfL/f+nsuMglnJigsk7vQ5lvlMZbMAs7fu/jVlfDEwHXwiAyWxGnvJAXvL0DkTR OTd3p6mRrSDd0303UiheNRZnOsUifA07qMU+ox40su1O8aROtDwhJBYxPGzDW3X9CLGB wBHtRXCazuUJVMmZmscw71hVoeZtOTNPiIAwRhcxHL+8aHGppjXr8JVkvadKJOjDNzAE gzKxD2GU+Dln2PKhRSII1Y4Eqwb1Ay8d6qW9hXTU44dYML6oh90Fjz+iAoVdY3glKk/u P9eR9Tv2fzFGJ1iI9O0vu7wMAtg42Xy+2t+9kwRr+Aqpq++8Ln0Gx3Y4+6ejPqSE0nVh yqzA== 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 p91-v6si1665153plb.705.2018.03.14.02.27.28; Wed, 14 Mar 2018 02:27:43 -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 S1751835AbeCNJZI (ORCPT + 99 others); Wed, 14 Mar 2018 05:25:08 -0400 Received: from mailproxy03.manitu.net ([217.11.48.67]:33128 "EHLO mailproxy03.manitu.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751651AbeCNJZG (ORCPT ); Wed, 14 Mar 2018 05:25:06 -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 A160CD40050; Wed, 14 Mar 2018 10:25:04 +0100 (CET) Subject: Re: [PATCH v2 1/1] can: ucan: add driver for Theobroma Systems UCAN devices From: Wolfgang Grandegger 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> Message-ID: <92e559b1-d392-015e-1aa1-0497cbd4c071@grandegger.com> Date: Wed, 14 Mar 2018 10:25:04 +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: <68564c40-396b-9081-8534-67fe96a6fb3f@grandegger.com> Content-Type: text/plain; charset=utf-8; format=flowed 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 Am 14.03.2018 um 10:17 schrieb Wolfgang Grandegger: > > > Am 14.03.2018 um 10:14 schrieb Jakob Unterwurzacher: >> On 14.03.18 10:11, Wolfgang Grandegger wrote: >>>> +    /* handle error frames */ >>>> +    canid = le32_to_cpu(m->msg.can_msg.id); >>>> +    if (canid & CAN_ERR_FLAG) { >>>> +        ucan_handle_error_frame(up, m, canid); >>>> +        /* drop frame if berr-reporting is off */ >>>> +        if (!(up->can.ctrlmode & CAN_CTRLMODE_BERR_REPORTING)) >>>> +            return; >>>> +    } >>> >>> You still do not generate error messages for state changes, IIUC. >> >> The hardware generates error frames on state changes - is that what >> you mean? >> >> In our testing, the state shows up (and updates) correctly in >> >>      ip -details -statistics link show can0 > > 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. Wolfgang.