Patch "can: esd_usb: Move mislocated storage of SJA1000_ECC_SEG bits in case of a bus error" has been added to the 6.1-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: esd_usb: Move mislocated storage of SJA1000_ECC_SEG bits in case of a bus error

to the 6.1-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-esd_usb-move-mislocated-storage-of-sja1000_ecc_s.patch
and it can be found in the queue-6.1 subdirectory.

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



commit f2e3f4f37396f4a56dcc8fc0256dc696617af03a
Author: Frank Jungclaus <frank.jungclaus@xxxxxx>
Date:   Thu Feb 16 20:04:48 2023 +0100

    can: esd_usb: Move mislocated storage of SJA1000_ECC_SEG bits in case of a bus error
    
    [ Upstream commit 118469f88180438ef43dee93d71f77c00e7b425d ]
    
    Move the supply for cf->data[3] (bit stream position of CAN error), in
    case of a bus- or protocol-error, outside of the "switch (ecc &
    SJA1000_ECC_MASK){}"-statement, because this bit stream position is
    independent of the error type.
    
    Fixes: 96d8e90382dc ("can: Add driver for esd CAN-USB/2 device")
    Signed-off-by: Frank Jungclaus <frank.jungclaus@xxxxxx>
    Link: https://lore.kernel.org/all/20230216190450.3901254-2-frank.jungclaus@xxxxxx
    Signed-off-by: Marc Kleine-Budde <mkl@xxxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/can/usb/esd_usb.c b/drivers/net/can/usb/esd_usb.c
index 42323f5e6f3a0..5e182fadd875e 100644
--- a/drivers/net/can/usb/esd_usb.c
+++ b/drivers/net/can/usb/esd_usb.c
@@ -286,7 +286,6 @@ static void esd_usb_rx_event(struct esd_usb_net_priv *priv,
 				cf->data[2] |= CAN_ERR_PROT_STUFF;
 				break;
 			default:
-				cf->data[3] = ecc & SJA1000_ECC_SEG;
 				break;
 			}
 
@@ -294,6 +293,9 @@ static void esd_usb_rx_event(struct esd_usb_net_priv *priv,
 			if (!(ecc & SJA1000_ECC_DIR))
 				cf->data[2] |= CAN_ERR_PROT_TX;
 
+			/* Bit stream position in CAN frame as the error was detected */
+			cf->data[3] = ecc & SJA1000_ECC_SEG;
+
 			if (priv->can.state == CAN_STATE_ERROR_WARNING ||
 			    priv->can.state == CAN_STATE_ERROR_PASSIVE) {
 				cf->data[1] = (txerr > rxerr) ?



[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