Patch "can: esd_usb: Allow REC and TEC to return to zero" has been added to the 5.10-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: Allow REC and TEC to return to zero

to the 5.10-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-allow-rec-and-tec-to-return-to-zero.patch
and it can be found in the queue-5.10 subdirectory.

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



commit 59fe01a0cd4a74e2849548c5b99ad26ad6c39c8b
Author: Frank Jungclaus <frank.jungclaus@xxxxxx>
Date:   Wed Nov 30 21:22:42 2022 +0100

    can: esd_usb: Allow REC and TEC to return to zero
    
    [ Upstream commit 918ee4911f7a41fb4505dff877c1d7f9f64eb43e ]
    
    We don't get any further EVENT from an esd CAN USB device for changes
    on REC or TEC while those counters converge to 0 (with ecc == 0). So
    when handling the "Back to Error Active"-event force txerr = rxerr =
    0, otherwise the berr-counters might stay on values like 95 forever.
    
    Also, to make life easier during the ongoing development a
    netdev_dbg() has been introduced to allow dumping error events send by
    an esd CAN USB device.
    
    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/20221130202242.3998219-2-frank.jungclaus@xxxxxx
    Cc: stable@xxxxxxxxxxxxxxx
    Signed-off-by: Marc Kleine-Budde <mkl@xxxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/can/usb/esd_usb2.c b/drivers/net/can/usb/esd_usb2.c
index 8847942a8d97..73c5343e609b 100644
--- a/drivers/net/can/usb/esd_usb2.c
+++ b/drivers/net/can/usb/esd_usb2.c
@@ -227,6 +227,10 @@ static void esd_usb2_rx_event(struct esd_usb2_net_priv *priv,
 		u8 rxerr = msg->msg.rx.data[2];
 		u8 txerr = msg->msg.rx.data[3];
 
+		netdev_dbg(priv->netdev,
+			   "CAN_ERR_EV_EXT: dlc=%#02x state=%02x ecc=%02x rec=%02x tec=%02x\n",
+			   msg->msg.rx.dlc, state, ecc, rxerr, txerr);
+
 		skb = alloc_can_err_skb(priv->netdev, &cf);
 		if (skb == NULL) {
 			stats->rx_dropped++;
@@ -253,6 +257,8 @@ static void esd_usb2_rx_event(struct esd_usb2_net_priv *priv,
 				break;
 			default:
 				priv->can.state = CAN_STATE_ERROR_ACTIVE;
+				txerr = 0;
+				rxerr = 0;
 				break;
 			}
 		} else {



[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