summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarek Vasut <marex@denx.de>2017-11-10 11:22:39 +0100
committerMarc Kleine-Budde <mkl@pengutronix.de>2017-11-10 11:35:09 +0100
commit4f7116757b4bd99e4ef2636c7d957a6d63035d11 (patch)
tree646683ff5425c5687d2c747e454a8567f972b4f6
parent4cbdd0ee67191481ec57ceed94febdfef95c9f25 (diff)
downloadlinux-stable-4f7116757b4bd99e4ef2636c7d957a6d63035d11.tar.gz
linux-stable-4f7116757b4bd99e4ef2636c7d957a6d63035d11.tar.bz2
linux-stable-4f7116757b4bd99e4ef2636c7d957a6d63035d11.zip
can: ifi: Fix transmitter delay calculation
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>
-rw-r--r--drivers/net/can/ifi_canfd/ifi_canfd.c6
1 files 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,