Commit 92d28828 authored by David S. Miller's avatar David S. Miller

Merge tag 'linux-can-fixes-for-4.14-20171110' of...

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: default avatarDavid S. Miller <davem@davemloft.net>
parents be234ba9 4f711675
...@@ -178,7 +178,6 @@ static int c_can_pci_probe(struct pci_dev *pdev, ...@@ -178,7 +178,6 @@ static int c_can_pci_probe(struct pci_dev *pdev,
break; break;
case BOSCH_D_CAN: case BOSCH_D_CAN:
priv->regs = reg_map_d_can; priv->regs = reg_map_d_can;
priv->can.ctrlmode_supported |= CAN_CTRLMODE_3_SAMPLES;
break; break;
default: default:
ret = -EINVAL; ret = -EINVAL;
......
...@@ -320,7 +320,6 @@ static int c_can_plat_probe(struct platform_device *pdev) ...@@ -320,7 +320,6 @@ static int c_can_plat_probe(struct platform_device *pdev)
break; break;
case BOSCH_D_CAN: case BOSCH_D_CAN:
priv->regs = reg_map_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->read_reg = c_can_plat_read_reg_aligned_to_16bit;
priv->write_reg = c_can_plat_write_reg_aligned_to_16bit; priv->write_reg = c_can_plat_write_reg_aligned_to_16bit;
priv->read_reg32 = d_can_plat_read_reg32; priv->read_reg32 = d_can_plat_read_reg32;
......
...@@ -670,9 +670,9 @@ static void ifi_canfd_set_bittiming(struct net_device *ndev) ...@@ -670,9 +670,9 @@ static void ifi_canfd_set_bittiming(struct net_device *ndev)
priv->base + IFI_CANFD_FTIME); priv->base + IFI_CANFD_FTIME);
/* Configure transmitter delay */ /* Configure transmitter delay */
tdc = (dbt->brp * (dbt->phase_seg1 + 1)) & IFI_CANFD_TDELAY_MASK; tdc = dbt->brp * (dbt->prop_seg + dbt->phase_seg1);
writel(IFI_CANFD_TDELAY_EN | IFI_CANFD_TDELAY_ABS | tdc, tdc &= IFI_CANFD_TDELAY_MASK;
priv->base + IFI_CANFD_TDELAY); writel(IFI_CANFD_TDELAY_EN | tdc, priv->base + IFI_CANFD_TDELAY);
} }
static void ifi_canfd_set_filter(struct net_device *ndev, const u32 id, static void ifi_canfd_set_filter(struct net_device *ndev, const u32 id,
......
...@@ -29,14 +29,19 @@ ...@@ -29,14 +29,19 @@
#include "peak_canfd_user.h" #include "peak_canfd_user.h"
MODULE_AUTHOR("Stephane Grosjean <s.grosjean@peak-system.com>"); MODULE_AUTHOR("Stephane Grosjean <s.grosjean@peak-system.com>");
MODULE_DESCRIPTION("Socket-CAN driver for PEAK PCAN PCIe FD family cards"); MODULE_DESCRIPTION("Socket-CAN driver for PEAK PCAN PCIe/M.2 FD family cards");
MODULE_SUPPORTED_DEVICE("PEAK PCAN PCIe FD CAN cards"); MODULE_SUPPORTED_DEVICE("PEAK PCAN PCIe/M.2 FD CAN cards");
MODULE_LICENSE("GPL v2"); MODULE_LICENSE("GPL v2");
#define PCIEFD_DRV_NAME "peak_pciefd" #define PCIEFD_DRV_NAME "peak_pciefd"
#define PEAK_PCI_VENDOR_ID 0x001c /* The PCI device and vendor IDs */ #define PEAK_PCI_VENDOR_ID 0x001c /* The PCI device and vendor IDs */
#define PEAK_PCIEFD_ID 0x0013 /* for PCIe slot cards */ #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 */ /* PEAK PCIe board access description */
#define PCIEFD_BAR0_SIZE (64 * 1024) #define PCIEFD_BAR0_SIZE (64 * 1024)
...@@ -203,6 +208,11 @@ struct pciefd_board { ...@@ -203,6 +208,11 @@ struct pciefd_board {
/* supported device ids. */ /* supported device ids. */
static const struct pci_device_id peak_pciefd_tbl[] = { 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, 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,} {0,}
}; };
......
...@@ -539,6 +539,13 @@ static int sun4i_can_err(struct net_device *dev, u8 isrc, u8 status) ...@@ -539,6 +539,13 @@ static int sun4i_can_err(struct net_device *dev, u8 isrc, u8 status)
} }
stats->rx_over_errors++; stats->rx_over_errors++;
stats->rx_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 */ /* clear bit */
sun4i_can_write_cmdreg(priv, SUN4I_CMD_CLEAR_OR_FLAG); 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) ...@@ -653,8 +660,9 @@ static irqreturn_t sun4i_can_interrupt(int irq, void *dev_id)
netif_wake_queue(dev); netif_wake_queue(dev);
can_led_event(dev, CAN_LED_EVENT_TX); can_led_event(dev, CAN_LED_EVENT_TX);
} }
if (isrc & SUN4I_INT_RBUF_VLD) { if ((isrc & SUN4I_INT_RBUF_VLD) &&
/* receive interrupt */ !(isrc & SUN4I_INT_DATA_OR)) {
/* receive interrupt - don't read if overrun occurred */
while (status & SUN4I_STA_RBUF_RDY) { while (status & SUN4I_STA_RBUF_RDY) {
/* RX buffer is not empty */ /* RX buffer is not empty */
sun4i_can_rx(dev); sun4i_can_rx(dev);
......
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