* pull-request: can 2017-10-24
@ 2017-10-24 11:27 Marc Kleine-Budde
2017-10-24 11:27 ` [PATCH 1/3] can: sun4i: fix loopback mode Marc Kleine-Budde
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Marc Kleine-Budde @ 2017-10-24 11:27 UTC (permalink / raw)
To: netdev; +Cc: davem, linux-can, kernel
Hello David,
here's another pull request for net/master.
The patch by Gerhard Bertelsmann fixes the CAN_CTRLMODE_LOOPBACK in the
sun4i driver. Two patches by Jimmy Assarsson for the kvaser_usb driver
fix a print in the error path of the kvaser_usb_close() and remove a
wrong warning message with the Leaf v2 firmware version v4.1.844.
regards,
Marc
---
The following changes since commit b71d21c274eff20a9db8158882b545b141b73ab8:
sctp: full support for ipv6 ip_nonlocal_bind & IP_FREEBIND (2017-10-24 18:39:46 +0900)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can.git tags/linux-can-fixes-for-4.14-20171024
for you to fetch changes up to e1d2d1329a5722dbecc9c278303fcc4aa01f8790:
can: kvaser_usb: Ignore CMD_FLUSH_QUEUE_REPLY messages (2017-10-24 13:00:36 +0200)
----------------------------------------------------------------
linux-can-fixes-for-4.14-20171024
----------------------------------------------------------------
Gerhard Bertelsmann (1):
can: sun4i: fix loopback mode
Jimmy Assarsson (2):
can: kvaser_usb: Correct return value in printout
can: kvaser_usb: Ignore CMD_FLUSH_QUEUE_REPLY messages
drivers/net/can/sun4i_can.c | 3 +--
drivers/net/can/usb/kvaser_usb.c | 9 ++++++++-
2 files changed, 9 insertions(+), 3 deletions(-)
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/3] can: sun4i: fix loopback mode
2017-10-24 11:27 pull-request: can 2017-10-24 Marc Kleine-Budde
@ 2017-10-24 11:27 ` Marc Kleine-Budde
2017-10-24 11:27 ` [PATCH 2/3] can: kvaser_usb: Correct return value in printout Marc Kleine-Budde
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Marc Kleine-Budde @ 2017-10-24 11:27 UTC (permalink / raw)
To: netdev
Cc: davem, linux-can, kernel, Gerhard Bertelsmann, linux-stable,
Marc Kleine-Budde
From: Gerhard Bertelsmann <info@gerhard-bertelsmann.de>
Fix loopback mode by setting the right flag and remove presume mode.
Signed-off-by: Gerhard Bertelsmann <info@gerhard-bertelsmann.de>
Cc: linux-stable <stable@vger.kernel.org>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
drivers/net/can/sun4i_can.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/net/can/sun4i_can.c b/drivers/net/can/sun4i_can.c
index 68ef0a4cd821..b0c80859f746 100644
--- a/drivers/net/can/sun4i_can.c
+++ b/drivers/net/can/sun4i_can.c
@@ -342,7 +342,7 @@ static int sun4i_can_start(struct net_device *dev)
/* enter the selected mode */
mod_reg_val = readl(priv->base + SUN4I_REG_MSEL_ADDR);
- if (priv->can.ctrlmode & CAN_CTRLMODE_PRESUME_ACK)
+ if (priv->can.ctrlmode & CAN_CTRLMODE_LOOPBACK)
mod_reg_val |= SUN4I_MSEL_LOOPBACK_MODE;
else if (priv->can.ctrlmode & CAN_CTRLMODE_LISTENONLY)
mod_reg_val |= SUN4I_MSEL_LISTEN_ONLY_MODE;
@@ -811,7 +811,6 @@ static int sun4ican_probe(struct platform_device *pdev)
priv->can.ctrlmode_supported = CAN_CTRLMODE_BERR_REPORTING |
CAN_CTRLMODE_LISTENONLY |
CAN_CTRLMODE_LOOPBACK |
- CAN_CTRLMODE_PRESUME_ACK |
CAN_CTRLMODE_3_SAMPLES;
priv->base = addr;
priv->clk = clk;
--
2.14.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/3] can: kvaser_usb: Correct return value in printout
2017-10-24 11:27 pull-request: can 2017-10-24 Marc Kleine-Budde
2017-10-24 11:27 ` [PATCH 1/3] can: sun4i: fix loopback mode Marc Kleine-Budde
@ 2017-10-24 11:27 ` Marc Kleine-Budde
2017-10-24 11:27 ` [PATCH 3/3] can: kvaser_usb: Ignore CMD_FLUSH_QUEUE_REPLY messages Marc Kleine-Budde
2017-10-26 8:18 ` pull-request: can 2017-10-24 David Miller
3 siblings, 0 replies; 5+ messages in thread
From: Marc Kleine-Budde @ 2017-10-24 11:27 UTC (permalink / raw)
To: netdev
Cc: davem, linux-can, kernel, Jimmy Assarsson, linux-stable,
Marc Kleine-Budde
From: Jimmy Assarsson <jimmyassarsson@gmail.com>
If the return value from kvaser_usb_send_simple_msg() was non-zero, the
return value from kvaser_usb_flush_queue() was printed in the kernel
warning.
Signed-off-by: Jimmy Assarsson <jimmyassarsson@gmail.com>
Cc: linux-stable <stable@vger.kernel.org>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
drivers/net/can/usb/kvaser_usb.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/can/usb/kvaser_usb.c b/drivers/net/can/usb/kvaser_usb.c
index 18cc529fb807..861e90efab86 100644
--- a/drivers/net/can/usb/kvaser_usb.c
+++ b/drivers/net/can/usb/kvaser_usb.c
@@ -1609,7 +1609,8 @@ static int kvaser_usb_close(struct net_device *netdev)
if (err)
netdev_warn(netdev, "Cannot flush queue, error %d\n", err);
- if (kvaser_usb_send_simple_msg(dev, CMD_RESET_CHIP, priv->channel))
+ err = kvaser_usb_send_simple_msg(dev, CMD_RESET_CHIP, priv->channel);
+ if (err)
netdev_warn(netdev, "Cannot reset card, error %d\n", err);
err = kvaser_usb_stop_chip(priv);
--
2.14.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 3/3] can: kvaser_usb: Ignore CMD_FLUSH_QUEUE_REPLY messages
2017-10-24 11:27 pull-request: can 2017-10-24 Marc Kleine-Budde
2017-10-24 11:27 ` [PATCH 1/3] can: sun4i: fix loopback mode Marc Kleine-Budde
2017-10-24 11:27 ` [PATCH 2/3] can: kvaser_usb: Correct return value in printout Marc Kleine-Budde
@ 2017-10-24 11:27 ` Marc Kleine-Budde
2017-10-26 8:18 ` pull-request: can 2017-10-24 David Miller
3 siblings, 0 replies; 5+ messages in thread
From: Marc Kleine-Budde @ 2017-10-24 11:27 UTC (permalink / raw)
To: netdev
Cc: davem, linux-can, kernel, Jimmy Assarsson, linux-stable,
Marc Kleine-Budde
From: Jimmy Assarsson <jimmyassarsson@gmail.com>
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: Jimmy Assarsson <jimmyassarsson@gmail.com>
Cc: linux-stable <stable@vger.kernel.org>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
drivers/net/can/usb/kvaser_usb.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/net/can/usb/kvaser_usb.c b/drivers/net/can/usb/kvaser_usb.c
index 861e90efab86..9b18d96ef526 100644
--- a/drivers/net/can/usb/kvaser_usb.c
+++ b/drivers/net/can/usb/kvaser_usb.c
@@ -137,6 +137,7 @@ static inline bool kvaser_is_usbcan(const struct usb_device_id *id)
#define CMD_RESET_ERROR_COUNTER 49
#define CMD_TX_ACKNOWLEDGE 50
#define CMD_CAN_ERROR_EVENT 51
+#define CMD_FLUSH_QUEUE_REPLY 68
#define CMD_LEAF_USB_THROTTLE 77
#define CMD_LEAF_LOG_MESSAGE 106
@@ -1301,6 +1302,11 @@ static void kvaser_usb_handle_message(const struct kvaser_usb *dev,
goto warn;
break;
+ case CMD_FLUSH_QUEUE_REPLY:
+ if (dev->family != KVASER_LEAF)
+ goto warn;
+ break;
+
default:
warn: dev_warn(dev->udev->dev.parent,
"Unhandled message (%d)\n", msg->id);
--
2.14.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: pull-request: can 2017-10-24
2017-10-24 11:27 pull-request: can 2017-10-24 Marc Kleine-Budde
` (2 preceding siblings ...)
2017-10-24 11:27 ` [PATCH 3/3] can: kvaser_usb: Ignore CMD_FLUSH_QUEUE_REPLY messages Marc Kleine-Budde
@ 2017-10-26 8:18 ` David Miller
3 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2017-10-26 8:18 UTC (permalink / raw)
To: mkl; +Cc: netdev, linux-can, kernel
From: Marc Kleine-Budde <mkl@pengutronix.de>
Date: Tue, 24 Oct 2017 13:27:22 +0200
> here's another pull request for net/master.
>
> The patch by Gerhard Bertelsmann fixes the CAN_CTRLMODE_LOOPBACK in the
> sun4i driver. Two patches by Jimmy Assarsson for the kvaser_usb driver
> fix a print in the error path of the kvaser_usb_close() and remove a
> wrong warning message with the Leaf v2 firmware version v4.1.844.
Pulled, thanks Marc.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2017-10-26 8:18 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-24 11:27 pull-request: can 2017-10-24 Marc Kleine-Budde
2017-10-24 11:27 ` [PATCH 1/3] can: sun4i: fix loopback mode Marc Kleine-Budde
2017-10-24 11:27 ` [PATCH 2/3] can: kvaser_usb: Correct return value in printout Marc Kleine-Budde
2017-10-24 11:27 ` [PATCH 3/3] can: kvaser_usb: Ignore CMD_FLUSH_QUEUE_REPLY messages Marc Kleine-Budde
2017-10-26 8:18 ` pull-request: can 2017-10-24 David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).