diff options
author | David S. Miller <davem@davemloft.net> | 2017-11-11 07:52:01 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-11-11 07:52:01 -0500 |
commit | 92d28828179675176cd90293699b394b6d22ce68 (patch) | |
tree | a59ab85f275679d36aeea7bc998f0c350569f0f0 | |
parent | be234ba93c61927fd881e7c033a1cf31237d2742 (diff) | |
parent | 4f7116757b4bd99e4ef2636c7d957a6d63035d11 (diff) |
Merge tag 'linux-can-fixes-for-4.14-20171110' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can
Marc Kleine-Budde says:
====================
pull-request: can 2017-11-10
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.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/can/c_can/c_can_pci.c | 1 | ||||
-rw-r--r-- | drivers/net/can/c_can/c_can_platform.c | 1 | ||||
-rw-r--r-- | drivers/net/can/ifi_canfd/ifi_canfd.c | 6 | ||||
-rw-r--r-- | drivers/net/can/peak_canfd/peak_pciefd_main.c | 14 | ||||
-rw-r--r-- | drivers/net/can/sun4i_can.c | 12 |
5 files changed, 25 insertions, 9 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, | |||
178 | break; | 178 | break; |
179 | case BOSCH_D_CAN: | 179 | case BOSCH_D_CAN: |
180 | priv->regs = reg_map_d_can; | 180 | priv->regs = reg_map_d_can; |
181 | priv->can.ctrlmode_supported |= CAN_CTRLMODE_3_SAMPLES; | ||
182 | break; | 181 | break; |
183 | default: | 182 | default: |
184 | ret = -EINVAL; | 183 | 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) | |||
320 | break; | 320 | break; |
321 | case BOSCH_D_CAN: | 321 | case BOSCH_D_CAN: |
322 | priv->regs = reg_map_d_can; | 322 | priv->regs = reg_map_d_can; |
323 | priv->can.ctrlmode_supported |= CAN_CTRLMODE_3_SAMPLES; | ||
324 | priv->read_reg = c_can_plat_read_reg_aligned_to_16bit; | 323 | priv->read_reg = c_can_plat_read_reg_aligned_to_16bit; |
325 | priv->write_reg = c_can_plat_write_reg_aligned_to_16bit; | 324 | priv->write_reg = c_can_plat_write_reg_aligned_to_16bit; |
326 | priv->read_reg32 = d_can_plat_read_reg32; | 325 | priv->read_reg32 = d_can_plat_read_reg32; |
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) | |||
670 | priv->base + IFI_CANFD_FTIME); | 670 | priv->base + IFI_CANFD_FTIME); |
671 | 671 | ||
672 | /* Configure transmitter delay */ | 672 | /* Configure transmitter delay */ |
673 | tdc = (dbt->brp * (dbt->phase_seg1 + 1)) & IFI_CANFD_TDELAY_MASK; | 673 | tdc = dbt->brp * (dbt->prop_seg + dbt->phase_seg1); |
674 | writel(IFI_CANFD_TDELAY_EN | IFI_CANFD_TDELAY_ABS | tdc, | 674 | tdc &= IFI_CANFD_TDELAY_MASK; |
675 | priv->base + IFI_CANFD_TDELAY); | 675 | writel(IFI_CANFD_TDELAY_EN | tdc, priv->base + IFI_CANFD_TDELAY); |
676 | } | 676 | } |
677 | 677 | ||
678 | static void ifi_canfd_set_filter(struct net_device *ndev, const u32 id, | 678 | static void ifi_canfd_set_filter(struct net_device *ndev, const u32 id, |
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 @@ | |||
29 | #include "peak_canfd_user.h" | 29 | #include "peak_canfd_user.h" |
30 | 30 | ||
31 | MODULE_AUTHOR("Stephane Grosjean <s.grosjean@peak-system.com>"); | 31 | MODULE_AUTHOR("Stephane Grosjean <s.grosjean@peak-system.com>"); |
32 | MODULE_DESCRIPTION("Socket-CAN driver for PEAK PCAN PCIe FD family cards"); | 32 | MODULE_DESCRIPTION("Socket-CAN driver for PEAK PCAN PCIe/M.2 FD family cards"); |
33 | MODULE_SUPPORTED_DEVICE("PEAK PCAN PCIe FD CAN cards"); | 33 | MODULE_SUPPORTED_DEVICE("PEAK PCAN PCIe/M.2 FD CAN cards"); |
34 | MODULE_LICENSE("GPL v2"); | 34 | MODULE_LICENSE("GPL v2"); |
35 | 35 | ||
36 | #define PCIEFD_DRV_NAME "peak_pciefd" | 36 | #define PCIEFD_DRV_NAME "peak_pciefd" |
37 | 37 | ||
38 | #define PEAK_PCI_VENDOR_ID 0x001c /* The PCI device and vendor IDs */ | 38 | #define PEAK_PCI_VENDOR_ID 0x001c /* The PCI device and vendor IDs */ |
39 | #define PEAK_PCIEFD_ID 0x0013 /* for PCIe slot cards */ | 39 | #define PEAK_PCIEFD_ID 0x0013 /* for PCIe slot cards */ |
40 | #define PCAN_CPCIEFD_ID 0x0014 /* for Compact-PCI Serial slot cards */ | ||
41 | #define PCAN_PCIE104FD_ID 0x0017 /* for PCIe-104 Express slot cards */ | ||
42 | #define PCAN_MINIPCIEFD_ID 0x0018 /* for mini-PCIe slot cards */ | ||
43 | #define PCAN_PCIEFD_OEM_ID 0x0019 /* for PCIe slot OEM cards */ | ||
44 | #define PCAN_M2_ID 0x001a /* for M2 slot cards */ | ||
40 | 45 | ||
41 | /* PEAK PCIe board access description */ | 46 | /* PEAK PCIe board access description */ |
42 | #define PCIEFD_BAR0_SIZE (64 * 1024) | 47 | #define PCIEFD_BAR0_SIZE (64 * 1024) |
@@ -203,6 +208,11 @@ struct pciefd_board { | |||
203 | /* supported device ids. */ | 208 | /* supported device ids. */ |
204 | static const struct pci_device_id peak_pciefd_tbl[] = { | 209 | static const struct pci_device_id peak_pciefd_tbl[] = { |
205 | {PEAK_PCI_VENDOR_ID, PEAK_PCIEFD_ID, PCI_ANY_ID, PCI_ANY_ID,}, | 210 | {PEAK_PCI_VENDOR_ID, PEAK_PCIEFD_ID, PCI_ANY_ID, PCI_ANY_ID,}, |
211 | {PEAK_PCI_VENDOR_ID, PCAN_CPCIEFD_ID, PCI_ANY_ID, PCI_ANY_ID,}, | ||
212 | {PEAK_PCI_VENDOR_ID, PCAN_PCIE104FD_ID, PCI_ANY_ID, PCI_ANY_ID,}, | ||
213 | {PEAK_PCI_VENDOR_ID, PCAN_MINIPCIEFD_ID, PCI_ANY_ID, PCI_ANY_ID,}, | ||
214 | {PEAK_PCI_VENDOR_ID, PCAN_PCIEFD_OEM_ID, PCI_ANY_ID, PCI_ANY_ID,}, | ||
215 | {PEAK_PCI_VENDOR_ID, PCAN_M2_ID, PCI_ANY_ID, PCI_ANY_ID,}, | ||
206 | {0,} | 216 | {0,} |
207 | }; | 217 | }; |
208 | 218 | ||
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) | |||
539 | } | 539 | } |
540 | stats->rx_over_errors++; | 540 | stats->rx_over_errors++; |
541 | stats->rx_errors++; | 541 | stats->rx_errors++; |
542 | |||
543 | /* reset the CAN IP by entering reset mode | ||
544 | * ignoring timeout error | ||
545 | */ | ||
546 | set_reset_mode(dev); | ||
547 | set_normal_mode(dev); | ||
548 | |||
542 | /* clear bit */ | 549 | /* clear bit */ |
543 | sun4i_can_write_cmdreg(priv, SUN4I_CMD_CLEAR_OR_FLAG); | 550 | sun4i_can_write_cmdreg(priv, SUN4I_CMD_CLEAR_OR_FLAG); |
544 | } | 551 | } |
@@ -653,8 +660,9 @@ static irqreturn_t sun4i_can_interrupt(int irq, void *dev_id) | |||
653 | netif_wake_queue(dev); | 660 | netif_wake_queue(dev); |
654 | can_led_event(dev, CAN_LED_EVENT_TX); | 661 | can_led_event(dev, CAN_LED_EVENT_TX); |
655 | } | 662 | } |
656 | if (isrc & SUN4I_INT_RBUF_VLD) { | 663 | if ((isrc & SUN4I_INT_RBUF_VLD) && |
657 | /* receive interrupt */ | 664 | !(isrc & SUN4I_INT_DATA_OR)) { |
665 | /* receive interrupt - don't read if overrun occurred */ | ||
658 | while (status & SUN4I_STA_RBUF_RDY) { | 666 | while (status & SUN4I_STA_RBUF_RDY) { |
659 | /* RX buffer is not empty */ | 667 | /* RX buffer is not empty */ |
660 | sun4i_can_rx(dev); | 668 | sun4i_can_rx(dev); |