All of lore.kernel.org
 help / color / mirror / Atom feed
* pull-request: can 2017-11-10
@ 2017-11-10 13:07 Marc Kleine-Budde
  2017-11-10 13:07 ` [PATCH 1/4] can: c_can: don't indicate triple sampling support for D_CAN Marc Kleine-Budde
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Marc Kleine-Budde @ 2017-11-10 13:07 UTC (permalink / raw)
  To: netdev; +Cc: davem, linux-can, kernel

Hello David,

this is a pull request for net/master.

The first patch by Richard Schütz for the c_can driver removes the false
indication to support triple sampling for d_can. Gerhard Bertelsmann's
patch for the sun4i driver improves the RX overrun handling. The patch
by Stephane Grosjean for the peak_canfd driver adds the PCI ids for
various new PCIe/M2 interfaces. Marek Vasut's patch for the ifi driver
fix transmitter delay calculation.

regards,
Marc

---

The following changes since commit 1cb483a5cc84b497afb51a6c5dfb5a38a0b67086:

  rds: ib: Fix NULL pointer dereference in debug code (2017-11-10 14:54:47 +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-20171110

for you to fetch changes up to 4f7116757b4bd99e4ef2636c7d957a6d63035d11:

  can: ifi: Fix transmitter delay calculation (2017-11-10 11:35:09 +0100)

----------------------------------------------------------------
linux-can-fixes-for-4.14-20171110

----------------------------------------------------------------
Gerhard Bertelsmann (1):
      can: sun4i: handle overrun in RX FIFO

Marek Vasut (1):
      can: ifi: Fix transmitter delay calculation

Richard Schütz (1):
      can: c_can: don't indicate triple sampling support for D_CAN

Stephane Grosjean (1):
      can: peak: Add support for new PCIe/M2 CAN FD interfaces

 drivers/net/can/c_can/c_can_pci.c             |  1 -
 drivers/net/can/c_can/c_can_platform.c        |  1 -
 drivers/net/can/ifi_canfd/ifi_canfd.c         |  6 +++---
 drivers/net/can/peak_canfd/peak_pciefd_main.c | 14 ++++++++++++--
 drivers/net/can/sun4i_can.c                   | 12 ++++++++++--
 5 files changed, 25 insertions(+), 9 deletions(-)

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/4] can: c_can: don't indicate triple sampling support for D_CAN
  2017-11-10 13:07 pull-request: can 2017-11-10 Marc Kleine-Budde
@ 2017-11-10 13:07 ` Marc Kleine-Budde
  2017-11-10 13:07 ` [PATCH 2/4] can: sun4i: handle overrun in RX FIFO Marc Kleine-Budde
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Marc Kleine-Budde @ 2017-11-10 13:07 UTC (permalink / raw)
  To: netdev
  Cc: davem, linux-can, kernel, Richard Schütz, linux-stable,
	Marc Kleine-Budde

From: Richard Schütz <rschuetz@uni-koblenz.de>

The D_CAN controller doesn't provide a triple sampling mode, so don't set
the CAN_CTRLMODE_3_SAMPLES flag in ctrlmode_supported. Currently enabling
triple sampling is a no-op.

Signed-off-by: Richard Schütz <rschuetz@uni-koblenz.de>
Cc: linux-stable <stable@vger.kernel.org> # >= v3.6
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 drivers/net/can/c_can/c_can_pci.c      | 1 -
 drivers/net/can/c_can/c_can_platform.c | 1 -
 2 files changed, 2 deletions(-)

diff --git a/drivers/net/can/c_can/c_can_pci.c b/drivers/net/can/c_can/c_can_pci.c
index cf7c18947189..d065c0e2d18e 100644
--- a/drivers/net/can/c_can/c_can_pci.c
+++ b/drivers/net/can/c_can/c_can_pci.c
@@ -178,7 +178,6 @@ static int c_can_pci_probe(struct pci_dev *pdev,
 		break;
 	case BOSCH_D_CAN:
 		priv->regs = reg_map_d_can;
-		priv->can.ctrlmode_supported |= CAN_CTRLMODE_3_SAMPLES;
 		break;
 	default:
 		ret = -EINVAL;
diff --git a/drivers/net/can/c_can/c_can_platform.c b/drivers/net/can/c_can/c_can_platform.c
index 46a746ee80bb..b5145a7f874c 100644
--- a/drivers/net/can/c_can/c_can_platform.c
+++ b/drivers/net/can/c_can/c_can_platform.c
@@ -320,7 +320,6 @@ static int c_can_plat_probe(struct platform_device *pdev)
 		break;
 	case BOSCH_D_CAN:
 		priv->regs = reg_map_d_can;
-		priv->can.ctrlmode_supported |= CAN_CTRLMODE_3_SAMPLES;
 		priv->read_reg = c_can_plat_read_reg_aligned_to_16bit;
 		priv->write_reg = c_can_plat_write_reg_aligned_to_16bit;
 		priv->read_reg32 = d_can_plat_read_reg32;
-- 
2.15.0

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/4] can: sun4i: handle overrun in RX FIFO
  2017-11-10 13:07 pull-request: can 2017-11-10 Marc Kleine-Budde
  2017-11-10 13:07 ` [PATCH 1/4] can: c_can: don't indicate triple sampling support for D_CAN Marc Kleine-Budde
@ 2017-11-10 13:07 ` Marc Kleine-Budde
  2017-11-10 13:07 ` [PATCH 3/4] can: peak: Add support for new PCIe/M2 CAN FD interfaces Marc Kleine-Budde
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Marc Kleine-Budde @ 2017-11-10 13:07 UTC (permalink / raw)
  To: netdev
  Cc: davem, linux-can, kernel, Gerhard Bertelsmann, linux-stable,
	Marc Kleine-Budde

From: Gerhard Bertelsmann <info@gerhard-bertelsmann.de>

SUN4Is CAN IP has a 64 byte deep FIFO buffer. If the buffer is not
drained fast enough (overrun) it's getting mangled. Already received
frames are dropped - the data can't be restored.

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 | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/net/can/sun4i_can.c b/drivers/net/can/sun4i_can.c
index b0c80859f746..1ac2090a1721 100644
--- a/drivers/net/can/sun4i_can.c
+++ b/drivers/net/can/sun4i_can.c
@@ -539,6 +539,13 @@ static int sun4i_can_err(struct net_device *dev, u8 isrc, u8 status)
 		}
 		stats->rx_over_errors++;
 		stats->rx_errors++;
+
+		/* reset the CAN IP by entering reset mode
+		 * ignoring timeout error
+		 */
+		set_reset_mode(dev);
+		set_normal_mode(dev);
+
 		/* clear bit */
 		sun4i_can_write_cmdreg(priv, SUN4I_CMD_CLEAR_OR_FLAG);
 	}
@@ -653,8 +660,9 @@ static irqreturn_t sun4i_can_interrupt(int irq, void *dev_id)
 			netif_wake_queue(dev);
 			can_led_event(dev, CAN_LED_EVENT_TX);
 		}
-		if (isrc & SUN4I_INT_RBUF_VLD) {
-			/* receive interrupt */
+		if ((isrc & SUN4I_INT_RBUF_VLD) &&
+		    !(isrc & SUN4I_INT_DATA_OR)) {
+			/* receive interrupt - don't read if overrun occurred */
 			while (status & SUN4I_STA_RBUF_RDY) {
 				/* RX buffer is not empty */
 				sun4i_can_rx(dev);
-- 
2.15.0

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 3/4] can: peak: Add support for new PCIe/M2 CAN FD interfaces
  2017-11-10 13:07 pull-request: can 2017-11-10 Marc Kleine-Budde
  2017-11-10 13:07 ` [PATCH 1/4] can: c_can: don't indicate triple sampling support for D_CAN Marc Kleine-Budde
  2017-11-10 13:07 ` [PATCH 2/4] can: sun4i: handle overrun in RX FIFO Marc Kleine-Budde
@ 2017-11-10 13:07 ` Marc Kleine-Budde
  2017-11-10 13:07 ` [PATCH 4/4] can: ifi: Fix transmitter delay calculation Marc Kleine-Budde
  2017-11-11 12:52 ` pull-request: can 2017-11-10 David Miller
  4 siblings, 0 replies; 6+ messages in thread
From: Marc Kleine-Budde @ 2017-11-10 13:07 UTC (permalink / raw)
  To: netdev
  Cc: davem, linux-can, kernel, Stephane Grosjean, linux-stable,
	Marc Kleine-Budde

From: Stephane Grosjean <s.grosjean@peak-system.com>

This adds support for the following PEAK-System CAN FD interfaces:

PCAN-cPCIe FD         CAN FD Interface for cPCI Serial (2 or 4 channels)
PCAN-PCIe/104-Express CAN FD Interface for PCIe/104-Express (1, 2 or 4 ch.)
PCAN-miniPCIe FD      CAN FD Interface for PCIe Mini (1, 2 or 4 channels)
PCAN-PCIe FD OEM      CAN FD Interface for PCIe OEM version (1, 2 or 4 ch.)
PCAN-M.2              CAN FD Interface for M.2 (1 or 2 channels)

Like the PCAN-PCIe FD interface, all of these boards run the same IP Core
that is able to handle CAN FD (see also http://www.peak-system.com).

Signed-off-by: Stephane Grosjean <s.grosjean@peak-system.com>
Cc: linux-stable <stable@vger.kernel.org>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 drivers/net/can/peak_canfd/peak_pciefd_main.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/drivers/net/can/peak_canfd/peak_pciefd_main.c b/drivers/net/can/peak_canfd/peak_pciefd_main.c
index 51c2d182a33a..b4efd711f824 100644
--- a/drivers/net/can/peak_canfd/peak_pciefd_main.c
+++ b/drivers/net/can/peak_canfd/peak_pciefd_main.c
@@ -29,14 +29,19 @@
 #include "peak_canfd_user.h"
 
 MODULE_AUTHOR("Stephane Grosjean <s.grosjean@peak-system.com>");
-MODULE_DESCRIPTION("Socket-CAN driver for PEAK PCAN PCIe FD family cards");
-MODULE_SUPPORTED_DEVICE("PEAK PCAN PCIe FD CAN cards");
+MODULE_DESCRIPTION("Socket-CAN driver for PEAK PCAN PCIe/M.2 FD family cards");
+MODULE_SUPPORTED_DEVICE("PEAK PCAN PCIe/M.2 FD CAN cards");
 MODULE_LICENSE("GPL v2");
 
 #define PCIEFD_DRV_NAME		"peak_pciefd"
 
 #define PEAK_PCI_VENDOR_ID	0x001c	/* The PCI device and vendor IDs */
 #define PEAK_PCIEFD_ID		0x0013	/* for PCIe slot cards */
+#define PCAN_CPCIEFD_ID		0x0014	/* for Compact-PCI Serial slot cards */
+#define PCAN_PCIE104FD_ID	0x0017	/* for PCIe-104 Express slot cards */
+#define PCAN_MINIPCIEFD_ID      0x0018	/* for mini-PCIe slot cards */
+#define PCAN_PCIEFD_OEM_ID      0x0019	/* for PCIe slot OEM cards */
+#define PCAN_M2_ID		0x001a	/* for M2 slot cards */
 
 /* PEAK PCIe board access description */
 #define PCIEFD_BAR0_SIZE		(64 * 1024)
@@ -203,6 +208,11 @@ struct pciefd_board {
 /* supported device ids. */
 static const struct pci_device_id peak_pciefd_tbl[] = {
 	{PEAK_PCI_VENDOR_ID, PEAK_PCIEFD_ID, PCI_ANY_ID, PCI_ANY_ID,},
+	{PEAK_PCI_VENDOR_ID, PCAN_CPCIEFD_ID, PCI_ANY_ID, PCI_ANY_ID,},
+	{PEAK_PCI_VENDOR_ID, PCAN_PCIE104FD_ID, PCI_ANY_ID, PCI_ANY_ID,},
+	{PEAK_PCI_VENDOR_ID, PCAN_MINIPCIEFD_ID, PCI_ANY_ID, PCI_ANY_ID,},
+	{PEAK_PCI_VENDOR_ID, PCAN_PCIEFD_OEM_ID, PCI_ANY_ID, PCI_ANY_ID,},
+	{PEAK_PCI_VENDOR_ID, PCAN_M2_ID, PCI_ANY_ID, PCI_ANY_ID,},
 	{0,}
 };
 
-- 
2.15.0

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 4/4] can: ifi: Fix transmitter delay calculation
  2017-11-10 13:07 pull-request: can 2017-11-10 Marc Kleine-Budde
                   ` (2 preceding siblings ...)
  2017-11-10 13:07 ` [PATCH 3/4] can: peak: Add support for new PCIe/M2 CAN FD interfaces Marc Kleine-Budde
@ 2017-11-10 13:07 ` Marc Kleine-Budde
  2017-11-11 12:52 ` pull-request: can 2017-11-10 David Miller
  4 siblings, 0 replies; 6+ messages in thread
From: Marc Kleine-Budde @ 2017-11-10 13:07 UTC (permalink / raw)
  To: netdev
  Cc: davem, linux-can, kernel, Marek Vasut, Markus Marb, linux-stable,
	Marc Kleine-Budde

From: Marek Vasut <marex@denx.de>

The CANFD transmitter delay calculation formula was updated in the
latest software drop from IFI and improves the behavior of the IFI
CANFD core during bitrate switching. Use the new formula to improve
stability of the CANFD operation.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Markus Marb <markus@marb.org>
Cc: linux-stable <stable@vger.kernel.org>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 drivers/net/can/ifi_canfd/ifi_canfd.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/can/ifi_canfd/ifi_canfd.c b/drivers/net/can/ifi_canfd/ifi_canfd.c
index 4d1fe8d95042..2772d05ff11c 100644
--- a/drivers/net/can/ifi_canfd/ifi_canfd.c
+++ b/drivers/net/can/ifi_canfd/ifi_canfd.c
@@ -670,9 +670,9 @@ static void ifi_canfd_set_bittiming(struct net_device *ndev)
 	       priv->base + IFI_CANFD_FTIME);
 
 	/* Configure transmitter delay */
-	tdc = (dbt->brp * (dbt->phase_seg1 + 1)) & IFI_CANFD_TDELAY_MASK;
-	writel(IFI_CANFD_TDELAY_EN | IFI_CANFD_TDELAY_ABS | tdc,
-	       priv->base + IFI_CANFD_TDELAY);
+	tdc = dbt->brp * (dbt->prop_seg + dbt->phase_seg1);
+	tdc &= IFI_CANFD_TDELAY_MASK;
+	writel(IFI_CANFD_TDELAY_EN | tdc, priv->base + IFI_CANFD_TDELAY);
 }
 
 static void ifi_canfd_set_filter(struct net_device *ndev, const u32 id,
-- 
2.15.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: pull-request: can 2017-11-10
  2017-11-10 13:07 pull-request: can 2017-11-10 Marc Kleine-Budde
                   ` (3 preceding siblings ...)
  2017-11-10 13:07 ` [PATCH 4/4] can: ifi: Fix transmitter delay calculation Marc Kleine-Budde
@ 2017-11-11 12:52 ` David Miller
  4 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2017-11-11 12:52 UTC (permalink / raw)
  To: mkl; +Cc: netdev, linux-can, kernel

From: Marc Kleine-Budde <mkl@pengutronix.de>
Date: Fri, 10 Nov 2017 14:07:26 +0100

> this is a pull request for net/master.
> 
> The first patch by Richard Schütz for the c_can driver removes the false
> indication to support triple sampling for d_can. Gerhard Bertelsmann's
> patch for the sun4i driver improves the RX overrun handling. The patch
> by Stephane Grosjean for the peak_canfd driver adds the PCI ids for
> various new PCIe/M2 interfaces. Marek Vasut's patch for the ifi driver
> fix transmitter delay calculation.

Pulled, thanks Marc.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-11-11 12:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-10 13:07 pull-request: can 2017-11-10 Marc Kleine-Budde
2017-11-10 13:07 ` [PATCH 1/4] can: c_can: don't indicate triple sampling support for D_CAN Marc Kleine-Budde
2017-11-10 13:07 ` [PATCH 2/4] can: sun4i: handle overrun in RX FIFO Marc Kleine-Budde
2017-11-10 13:07 ` [PATCH 3/4] can: peak: Add support for new PCIe/M2 CAN FD interfaces Marc Kleine-Budde
2017-11-10 13:07 ` [PATCH 4/4] can: ifi: Fix transmitter delay calculation Marc Kleine-Budde
2017-11-11 12:52 ` pull-request: can 2017-11-10 David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.