Commit 3f1c7aa2 authored by Stephane Grosjean's avatar Stephane Grosjean Committed by Marc Kleine-Budde

can: peak_usb: always ask for BERR reporting for PCAN-USB devices

Since for the PCAN-USB, the management of the transition to the
ERROR_WARNING or ERROR_PASSIVE state is done according to the error
counters, these must be requested unconditionally.

Link: https://lore.kernel.org/all/20211021081505.18223-2-s.grosjean@peak-system.com
Fixes: c11dcee7 ("can: peak_usb: pcan_usb_decode_error(): upgrade handling of bus state changes")
Cc: stable@vger.kernel.org
Signed-off-by: default avatarStephane Grosjean <s.grosjean@peak-system.com>
Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
parent d9447f76
...@@ -841,14 +841,14 @@ static int pcan_usb_start(struct peak_usb_device *dev) ...@@ -841,14 +841,14 @@ static int pcan_usb_start(struct peak_usb_device *dev)
pdev->bec.rxerr = 0; pdev->bec.rxerr = 0;
pdev->bec.txerr = 0; pdev->bec.txerr = 0;
/* be notified on error counter changes (if requested by user) */ /* always ask the device for BERR reporting, to be able to switch from
if (dev->can.ctrlmode & CAN_CTRLMODE_BERR_REPORTING) { * WARNING to PASSIVE state
err = pcan_usb_set_err_frame(dev, PCAN_USB_BERR_MASK); */
if (err) err = pcan_usb_set_err_frame(dev, PCAN_USB_BERR_MASK);
netdev_warn(dev->netdev, if (err)
"Asking for BERR reporting error %u\n", netdev_warn(dev->netdev,
err); "Asking for BERR reporting error %u\n",
} err);
/* if revision greater than 3, can put silent mode on/off */ /* if revision greater than 3, can put silent mode on/off */
if (dev->device_rev > 3) { if (dev->device_rev > 3) {
...@@ -986,7 +986,6 @@ const struct peak_usb_adapter pcan_usb = { ...@@ -986,7 +986,6 @@ const struct peak_usb_adapter pcan_usb = {
.device_id = PCAN_USB_PRODUCT_ID, .device_id = PCAN_USB_PRODUCT_ID,
.ctrl_count = 1, .ctrl_count = 1,
.ctrlmode_supported = CAN_CTRLMODE_3_SAMPLES | CAN_CTRLMODE_LISTENONLY | .ctrlmode_supported = CAN_CTRLMODE_3_SAMPLES | CAN_CTRLMODE_LISTENONLY |
CAN_CTRLMODE_BERR_REPORTING |
CAN_CTRLMODE_CC_LEN8_DLC, CAN_CTRLMODE_CC_LEN8_DLC,
.clock = { .clock = {
.freq = PCAN_USB_CRYSTAL_HZ / 2, .freq = PCAN_USB_CRYSTAL_HZ / 2,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment