Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1855632rwb; Fri, 19 Aug 2022 10:30:24 -0700 (PDT) X-Google-Smtp-Source: AA6agR43MwommaFZ4MpqziBPQYGaLWNTZzMbhjGOzq+YzCqlkPJGTHeT+zWO3huYv3CXoT7RRSU0 X-Received: by 2002:a17:90b:35d2:b0:1f5:4e69:3dd3 with SMTP id nb18-20020a17090b35d200b001f54e693dd3mr9269400pjb.22.1660930224462; Fri, 19 Aug 2022 10:30:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660930224; cv=none; d=google.com; s=arc-20160816; b=WWmFmVugMlUtD9kCYA9oIVrv+EX9lwt++xv4qnJKOiCr1z8oixUDo90PgRo8RijZ9q XY009HYSgd+2qBPMMOju5jDtzfDaG1VeOusNLJpt0WzHHEqCaO14Bp7x8kSAoJ1HyUhb Ly+t87ujDBPXpHxXUJ9zs1R+sp4v4bwwaA0G600jW4C9TLl7GvxG51SWGTu5Ei8ebOMa X/e40T6dybr6/jIQ75+xgPT8v4NHCOkeM7I4fQVPh77St2zqLwulLwRaU89/kQ/tlEdW VCewixI8qWCfjPe53IyuZCiJlmQtSIImlPUscqDiP0voBwHEhgVb7GthM+jWEbU1mf92 /i7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=+F/EOplnXpBTqfCJZCG4gWbYoSjdMiCeanbHBsYof4o=; b=zEN2eHjmkUkm8SWHcgSqMwbWHMYohG75lRl8yVF2kghDIzXMwTJefeS4zaqxrhjhiP RjkR2r/Od+rG73qKlI6UtbTrdb0WWtHLR2kGA8pBZewtn+MZd6SPiXwVmlHjK1qrM6iE xZilOwrfBF/rzlg3le0VfrYwNMJJlSHt9iMvNqisxdbq/Z/3weGIjizJhC+4FdjkLHnU VItcIVAASe0RNtKFAon1HZlc/E2ZsT4yANgUSKEoj7lCAq0ucNY9paAo8kfAjjxVpQu/ W+0O69tT6mrPRCTyZ9vfc6YSEqk7KXwV8hioVrK4kSOWk8hoXFM1GyN+bV3TLZ7tSgzB PiyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=1Mh+65p7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r139-20020a632b91000000b0042a59edc558si1028222pgr.244.2022.08.19.10.30.13; Fri, 19 Aug 2022 10:30:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=1Mh+65p7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351860AbiHSQOa (ORCPT + 99 others); Fri, 19 Aug 2022 12:14:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36968 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351794AbiHSQNv (ORCPT ); Fri, 19 Aug 2022 12:13:51 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 65C26114A7B; Fri, 19 Aug 2022 08:57:53 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 78C61B8281D; Fri, 19 Aug 2022 15:57:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D3DF8C433C1; Fri, 19 Aug 2022 15:57:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660924669; bh=jGYDKm0Tw+bfYKYZH5hqWm2mnwiYORDMGSxt/7Z6A0k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1Mh+65p7cEjY7SubeDFmMbkCRbePmSy/s90y86WGYpOmGqOuWYJQqP81lG3IgNJEw Z4lPHn3Dc/dD3LmkKqW/6mVBKyY2mCEzcjCErv+7x/NMdD2Aemitn7qertTckDkRdC oUz8xTjfmbjTcnE5dZSNRhRsv78fTaILyb6ZVyf4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Vincent Mailhol , Marc Kleine-Budde , Sasha Levin Subject: [PATCH 5.10 243/545] can: error: specify the values of data[5..7] of CAN error frames Date: Fri, 19 Aug 2022 17:40:13 +0200 Message-Id: <20220819153840.239190610@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220819153829.135562864@linuxfoundation.org> References: <20220819153829.135562864@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Vincent Mailhol [ Upstream commit e70a3263a7eed768d5f947b8f2aff8d2a79c9d97 ] Currently, data[5..7] of struct can_frame, when used as a CAN error frame, are defined as being "controller specific". Device specific behaviours are problematic because it prevents someone from writing code which is portable between devices. As a matter of fact, data[5] is never used, data[6] is always used to report TX error counter and data[7] is always used to report RX error counter. can-utils also relies on this. This patch updates the comment in the uapi header to specify that data[5] is reserved (and thus should not be used) and that data[6..7] are used for error counters. Fixes: 0d66548a10cb ("[CAN]: Add PF_CAN core module") Link: https://lore.kernel.org/all/20220719143550.3681-11-mailhol.vincent@wanadoo.fr Signed-off-by: Vincent Mailhol Signed-off-by: Marc Kleine-Budde Signed-off-by: Sasha Levin --- include/uapi/linux/can/error.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/uapi/linux/can/error.h b/include/uapi/linux/can/error.h index 34633283de64..a1000cb63063 100644 --- a/include/uapi/linux/can/error.h +++ b/include/uapi/linux/can/error.h @@ -120,6 +120,9 @@ #define CAN_ERR_TRX_CANL_SHORT_TO_GND 0x70 /* 0111 0000 */ #define CAN_ERR_TRX_CANL_SHORT_TO_CANH 0x80 /* 1000 0000 */ -/* controller specific additional information / data[5..7] */ +/* data[5] is reserved (do not use) */ + +/* TX error counter / data[6] */ +/* RX error counter / data[7] */ #endif /* _UAPI_CAN_ERROR_H */ -- 2.35.1