Patch "can: error: specify the values of data[5..7] of CAN error frames" has been added to the 4.19-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    can: error: specify the values of data[5..7] of CAN error frames

to the 4.19-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     can-error-specify-the-values-of-data-5.7-of-can-erro.patch
and it can be found in the queue-4.19 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 257e4a3e93043d576f4b8666b3dca03559a73518
Author: Vincent Mailhol <mailhol.vincent@xxxxxxxxxx>
Date:   Tue Jul 19 23:35:48 2022 +0900

    can: error: specify the values of data[5..7] of CAN error frames
    
    [ 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@xxxxxxxxxx
    Signed-off-by: Vincent Mailhol <mailhol.vincent@xxxxxxxxxx>
    Signed-off-by: Marc Kleine-Budde <mkl@xxxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/include/uapi/linux/can/error.h b/include/uapi/linux/can/error.h
index bfc4b5d22a5e..383f3d508a53 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 */



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux