* pull-request: can 2016-06-20
@ 2016-06-20 8:00 Marc Kleine-Budde
2016-06-20 8:00 ` [PATCH 1/3] can: c_can: Update D_CAN TX and RX functions to 32 bit - fix Altera Cyclone access Marc Kleine-Budde
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Marc Kleine-Budde @ 2016-06-20 8:00 UTC (permalink / raw)
To: netdev; +Cc: davem, linux-can, kernel
Hello David,
this is a pull request of 3 patches for the upcoming linux-4.7 release.
The first patch is by Thor Thayer for the c_can/d_can driver. It fixes the
registar access on Altera Cyclone devices, which caused CAN frames to have 0x0
in the first two bytes incorrectly. Wolfgang Grandegger's patch for the at91
driver fixes a hanging driver under high bus load situations. A patch for the
gs_usb driver by Maximilian Schneider adds support for the bytewerk.org
candleLight interface.
regards,
Marc
---
The following changes since commit ab522fd68bc78f3f81f6c553f785dae3462859fa:
Merge branch 'qed-fixes' (2016-06-19 10:47:33 -0700)
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.7-20160620
for you to fetch changes up to f155d9c0a138463c3c9380d35e54e433c1477336:
can: gs_usb: Add Basic support for the bytewerk.org candleLight interface (2016-06-20 09:32:40 +0200)
----------------------------------------------------------------
linux-can-fixes-for-4.7-20160620
----------------------------------------------------------------
Maximilian Schneider (1):
can: gs_usb: Add Basic support for the bytewerk.org candleLight interface
Thor Thayer (1):
can: c_can: Update D_CAN TX and RX functions to 32 bit - fix Altera Cyclone access
Wolfgang Grandegger (1):
can: at91_can: RX queue could get stuck at high bus load
drivers/net/can/at91_can.c | 5 +++--
drivers/net/can/c_can/c_can.c | 38 +++++++++++++++++++++++++++++++-------
drivers/net/can/usb/Kconfig | 3 ++-
drivers/net/can/usb/gs_usb.c | 14 +++++++++++---
4 files changed, 47 insertions(+), 13 deletions(-)
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/3] can: c_can: Update D_CAN TX and RX functions to 32 bit - fix Altera Cyclone access
2016-06-20 8:00 pull-request: can 2016-06-20 Marc Kleine-Budde
@ 2016-06-20 8:00 ` Marc Kleine-Budde
2016-06-20 8:00 ` [PATCH 2/3] can: at91_can: RX queue could get stuck at high bus load Marc Kleine-Budde
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Marc Kleine-Budde @ 2016-06-20 8:00 UTC (permalink / raw)
To: netdev; +Cc: davem, linux-can, kernel, Thor Thayer, stable, Marc Kleine-Budde
From: Thor Thayer <tthayer@opensource.altera.com>
When testing CAN write floods on Altera's CycloneV, the first 2 bytes
are sometimes 0x00, 0x00 or corrupted instead of the values sent. Also
observed bytes 4 & 5 were corrupted in some cases.
The D_CAN Data registers are 32 bits and changing from 16 bit writes to
32 bit writes fixes the problem.
Testing performed on Altera CycloneV (D_CAN). Requesting tests on other
C_CAN & D_CAN platforms.
Reported-by: Richard Andrysek <richard.andrysek@gomtec.de>
Signed-off-by: Thor Thayer <tthayer@opensource.altera.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
drivers/net/can/c_can/c_can.c | 38 +++++++++++++++++++++++++++++++-------
1 file changed, 31 insertions(+), 7 deletions(-)
diff --git a/drivers/net/can/c_can/c_can.c b/drivers/net/can/c_can/c_can.c
index f91b094288da..e3dccd3200d5 100644
--- a/drivers/net/can/c_can/c_can.c
+++ b/drivers/net/can/c_can/c_can.c
@@ -332,9 +332,23 @@ static void c_can_setup_tx_object(struct net_device *dev, int iface,
priv->write_reg(priv, C_CAN_IFACE(MSGCTRL_REG, iface), ctrl);
- for (i = 0; i < frame->can_dlc; i += 2) {
- priv->write_reg(priv, C_CAN_IFACE(DATA1_REG, iface) + i / 2,
- frame->data[i] | (frame->data[i + 1] << 8));
+ if (priv->type == BOSCH_D_CAN) {
+ u32 data = 0, dreg = C_CAN_IFACE(DATA1_REG, iface);
+
+ for (i = 0; i < frame->can_dlc; i += 4, dreg += 2) {
+ data = (u32)frame->data[i];
+ data |= (u32)frame->data[i + 1] << 8;
+ data |= (u32)frame->data[i + 2] << 16;
+ data |= (u32)frame->data[i + 3] << 24;
+ priv->write_reg32(priv, dreg, data);
+ }
+ } else {
+ for (i = 0; i < frame->can_dlc; i += 2) {
+ priv->write_reg(priv,
+ C_CAN_IFACE(DATA1_REG, iface) + i / 2,
+ frame->data[i] |
+ (frame->data[i + 1] << 8));
+ }
}
}
@@ -402,10 +416,20 @@ static int c_can_read_msg_object(struct net_device *dev, int iface, u32 ctrl)
} else {
int i, dreg = C_CAN_IFACE(DATA1_REG, iface);
- for (i = 0; i < frame->can_dlc; i += 2, dreg ++) {
- data = priv->read_reg(priv, dreg);
- frame->data[i] = data;
- frame->data[i + 1] = data >> 8;
+ if (priv->type == BOSCH_D_CAN) {
+ for (i = 0; i < frame->can_dlc; i += 4, dreg += 2) {
+ data = priv->read_reg32(priv, dreg);
+ frame->data[i] = data;
+ frame->data[i + 1] = data >> 8;
+ frame->data[i + 2] = data >> 16;
+ frame->data[i + 3] = data >> 24;
+ }
+ } else {
+ for (i = 0; i < frame->can_dlc; i += 2, dreg++) {
+ data = priv->read_reg(priv, dreg);
+ frame->data[i] = data;
+ frame->data[i + 1] = data >> 8;
+ }
}
}
--
2.8.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/3] can: at91_can: RX queue could get stuck at high bus load
2016-06-20 8:00 pull-request: can 2016-06-20 Marc Kleine-Budde
2016-06-20 8:00 ` [PATCH 1/3] can: c_can: Update D_CAN TX and RX functions to 32 bit - fix Altera Cyclone access Marc Kleine-Budde
@ 2016-06-20 8:00 ` Marc Kleine-Budde
2016-06-20 8:00 ` [PATCH 3/3] can: gs_usb: Add Basic support for the bytewerk.org candleLight interface Marc Kleine-Budde
2016-06-22 20:30 ` pull-request: can 2016-06-20 David Miller
3 siblings, 0 replies; 5+ messages in thread
From: Marc Kleine-Budde @ 2016-06-20 8:00 UTC (permalink / raw)
To: netdev
Cc: davem, linux-can, kernel, Wolfgang Grandegger, stable,
Marc Kleine-Budde
From: Wolfgang Grandegger <wg@grandegger.com>
At high bus load it could happen that "at91_poll()" enters with all RX
message boxes filled up. If then at the end the "quota" is exceeded as
well, "rx_next" will not be reset to the first RX mailbox and hence the
interrupts remain disabled.
Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
Tested-by: Amr Bekhit <amrbekhit@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
drivers/net/can/at91_can.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/net/can/at91_can.c b/drivers/net/can/at91_can.c
index 8b3275d7792a..8f5e93cb7975 100644
--- a/drivers/net/can/at91_can.c
+++ b/drivers/net/can/at91_can.c
@@ -712,9 +712,10 @@ static int at91_poll_rx(struct net_device *dev, int quota)
/* upper group completed, look again in lower */
if (priv->rx_next > get_mb_rx_low_last(priv) &&
- quota > 0 && mb > get_mb_rx_last(priv)) {
+ mb > get_mb_rx_last(priv)) {
priv->rx_next = get_mb_rx_first(priv);
- goto again;
+ if (quota > 0)
+ goto again;
}
return received;
--
2.8.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 3/3] can: gs_usb: Add Basic support for the bytewerk.org candleLight interface
2016-06-20 8:00 pull-request: can 2016-06-20 Marc Kleine-Budde
2016-06-20 8:00 ` [PATCH 1/3] can: c_can: Update D_CAN TX and RX functions to 32 bit - fix Altera Cyclone access Marc Kleine-Budde
2016-06-20 8:00 ` [PATCH 2/3] can: at91_can: RX queue could get stuck at high bus load Marc Kleine-Budde
@ 2016-06-20 8:00 ` Marc Kleine-Budde
2016-06-22 20:30 ` pull-request: can 2016-06-20 David Miller
3 siblings, 0 replies; 5+ messages in thread
From: Marc Kleine-Budde @ 2016-06-20 8:00 UTC (permalink / raw)
To: netdev
Cc: davem, linux-can, kernel, Maximilian Schneider, Hubert Denkmair,
Marc Kleine-Budde
From: Maximilian Schneider <max@schneidersoft.net>
This patchs adds basic support for the bytewerk.org candleLight interface,
a open hardware (CERN OHL) USB CAN adapter.
Signed-off-by: Hubert Denkmair <hubert@denkmair.de>
Signed-off-by: Maximilian Schneider <max@schneidersoft.net>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
drivers/net/can/usb/Kconfig | 3 ++-
drivers/net/can/usb/gs_usb.c | 14 +++++++++++---
2 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/drivers/net/can/usb/Kconfig b/drivers/net/can/usb/Kconfig
index bcb272f6c68a..2ff0df32b3d1 100644
--- a/drivers/net/can/usb/Kconfig
+++ b/drivers/net/can/usb/Kconfig
@@ -16,7 +16,8 @@ config CAN_ESD_USB2
config CAN_GS_USB
tristate "Geschwister Schneider UG interfaces"
---help---
- This driver supports the Geschwister Schneider USB/CAN devices.
+ This driver supports the Geschwister Schneider and bytewerk.org
+ candleLight USB CAN interfaces USB/CAN devices
If unsure choose N,
choose Y for built in support,
M to compile as module (module will be named: gs_usb).
diff --git a/drivers/net/can/usb/gs_usb.c b/drivers/net/can/usb/gs_usb.c
index 1556d4286235..acb0c8490673 100644
--- a/drivers/net/can/usb/gs_usb.c
+++ b/drivers/net/can/usb/gs_usb.c
@@ -1,7 +1,9 @@
-/* CAN driver for Geschwister Schneider USB/CAN devices.
+/* CAN driver for Geschwister Schneider USB/CAN devices
+ * and bytewerk.org candleLight USB CAN interfaces.
*
- * Copyright (C) 2013 Geschwister Schneider Technologie-,
+ * Copyright (C) 2013-2016 Geschwister Schneider Technologie-,
* Entwicklungs- und Vertriebs UG (Haftungsbeschränkt).
+ * Copyright (C) 2016 Hubert Denkmair
*
* Many thanks to all socketcan devs!
*
@@ -29,6 +31,9 @@
#define USB_GSUSB_1_VENDOR_ID 0x1d50
#define USB_GSUSB_1_PRODUCT_ID 0x606f
+#define USB_CANDLELIGHT_VENDOR_ID 0x1209
+#define USB_CANDLELIGHT_PRODUCT_ID 0x2323
+
#define GSUSB_ENDPOINT_IN 1
#define GSUSB_ENDPOINT_OUT 2
@@ -952,6 +957,8 @@ static void gs_usb_disconnect(struct usb_interface *intf)
static const struct usb_device_id gs_usb_table[] = {
{ USB_DEVICE_INTERFACE_NUMBER(USB_GSUSB_1_VENDOR_ID,
USB_GSUSB_1_PRODUCT_ID, 0) },
+ { USB_DEVICE_INTERFACE_NUMBER(USB_CANDLELIGHT_VENDOR_ID,
+ USB_CANDLELIGHT_PRODUCT_ID, 0) },
{} /* Terminating entry */
};
@@ -969,5 +976,6 @@ module_usb_driver(gs_usb_driver);
MODULE_AUTHOR("Maximilian Schneider <mws@schneidersoft.net>");
MODULE_DESCRIPTION(
"Socket CAN device driver for Geschwister Schneider Technologie-, "
-"Entwicklungs- und Vertriebs UG. USB2.0 to CAN interfaces.");
+"Entwicklungs- und Vertriebs UG. USB2.0 to CAN interfaces\n"
+"and bytewerk.org candleLight USB CAN interfaces.");
MODULE_LICENSE("GPL v2");
--
2.8.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: pull-request: can 2016-06-20
2016-06-20 8:00 pull-request: can 2016-06-20 Marc Kleine-Budde
` (2 preceding siblings ...)
2016-06-20 8:00 ` [PATCH 3/3] can: gs_usb: Add Basic support for the bytewerk.org candleLight interface Marc Kleine-Budde
@ 2016-06-22 20:30 ` David Miller
3 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2016-06-22 20:30 UTC (permalink / raw)
To: mkl; +Cc: netdev, linux-can, kernel
From: Marc Kleine-Budde <mkl@pengutronix.de>
Date: Mon, 20 Jun 2016 10:00:27 +0200
> this is a pull request of 3 patches for the upcoming linux-4.7 release.
>
> The first patch is by Thor Thayer for the c_can/d_can driver. It fixes the
> registar access on Altera Cyclone devices, which caused CAN frames to have 0x0
> in the first two bytes incorrectly. Wolfgang Grandegger's patch for the at91
> driver fixes a hanging driver under high bus load situations. A patch for the
> gs_usb driver by Maximilian Schneider adds support for the bytewerk.org
> candleLight interface.
Pulled, thanks.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2016-06-22 20:30 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-20 8:00 pull-request: can 2016-06-20 Marc Kleine-Budde
2016-06-20 8:00 ` [PATCH 1/3] can: c_can: Update D_CAN TX and RX functions to 32 bit - fix Altera Cyclone access Marc Kleine-Budde
2016-06-20 8:00 ` [PATCH 2/3] can: at91_can: RX queue could get stuck at high bus load Marc Kleine-Budde
2016-06-20 8:00 ` [PATCH 3/3] can: gs_usb: Add Basic support for the bytewerk.org candleLight interface Marc Kleine-Budde
2016-06-22 20:30 ` pull-request: can 2016-06-20 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).