Commit a81d1bf8 authored by Jimmy Assarsson's avatar Jimmy Assarsson Committed by Thadeu Lima de Souza Cascardo

can: kvaser_usb: Ignore CMD_FLUSH_QUEUE_REPLY messages

BugLink: http://bugs.launchpad.net/bugs/1731882

commit e1d2d132 upstream.

To avoid kernel warning "Unhandled message (68)", ignore the
CMD_FLUSH_QUEUE_REPLY message for now.

As of Leaf v2 firmware version v4.1.844 (2017-02-15), flush tx queue is
synchronous. There is a capability bit indicating whether flushing tx
queue is synchronous or asynchronous.

A proper solution would be to query the device for capabilities. If the
synchronous tx flush capability bit is set, we should wait for
CMD_FLUSH_QUEUE_REPLY message, while flushing the tx queue.
Signed-off-by: default avatarJimmy Assarsson <jimmyassarsson@gmail.com>
Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarStefan Bader <stefan.bader@canonical.com>
Signed-off-by: default avatarThadeu Lima de Souza Cascardo <cascardo@canonical.com>
parent 245c1c90
...@@ -134,6 +134,7 @@ static inline bool kvaser_is_usbcan(const struct usb_device_id *id) ...@@ -134,6 +134,7 @@ static inline bool kvaser_is_usbcan(const struct usb_device_id *id)
#define CMD_RESET_ERROR_COUNTER 49 #define CMD_RESET_ERROR_COUNTER 49
#define CMD_TX_ACKNOWLEDGE 50 #define CMD_TX_ACKNOWLEDGE 50
#define CMD_CAN_ERROR_EVENT 51 #define CMD_CAN_ERROR_EVENT 51
#define CMD_FLUSH_QUEUE_REPLY 68
#define CMD_LEAF_USB_THROTTLE 77 #define CMD_LEAF_USB_THROTTLE 77
#define CMD_LEAF_LOG_MESSAGE 106 #define CMD_LEAF_LOG_MESSAGE 106
...@@ -1297,6 +1298,11 @@ static void kvaser_usb_handle_message(const struct kvaser_usb *dev, ...@@ -1297,6 +1298,11 @@ static void kvaser_usb_handle_message(const struct kvaser_usb *dev,
goto warn; goto warn;
break; break;
case CMD_FLUSH_QUEUE_REPLY:
if (dev->family != KVASER_LEAF)
goto warn;
break;
default: default:
warn: dev_warn(dev->udev->dev.parent, warn: dev_warn(dev->udev->dev.parent,
"Unhandled message (%d)\n", msg->id); "Unhandled message (%d)\n", msg->id);
......
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