Patch "net: can: ifi: Configure transmitter delay" has been added to the 4.7-stable tree
Subsystems (2)
This is a note to let you know that I've just added the patch titled
net: can: ifi: Configure transmitter delay
to the 4.7-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
net-can-ifi-configure-transmitter-delay.patch
and it can be found in the queue-4.7 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From
8d58790b832e13d6006d842037732304af357c3cMon Sep 17 00:00:00 2001
From: Marek Vasut <[email protected]>
Date: Mon, 19 Sep 2016 21:34:01 +0200
Subject: net: can: ifi: Configure transmitter delay
From: Marek Vasut <[email protected]>
commit 8d58790b832e13d6006d842037732304af357c3c upstream.
Configure the transmitter delay register at +0x1c to correctly handle the CAN FD bitrate switch (BRS). This moves the SSP (secondary sample point) to a proper offset, so that the TDC mechanism works and won't generate error frames on the CAN link.
--- drivers/net/can/ifi_canfd/ifi_canfd.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)
drivers/net/can/ifi_canfd/ifi_canfd.c +10 -1
@@ -81,6 +81,10 @@#define IFI_CANFD_TIME_SET_TIMEA_4_12_6_6 BIT(15)#define IFI_CANFD_TDELAY 0x1c +#define IFI_CANFD_TDELAY_DEFAULT 0xb +#define IFI_CANFD_TDELAY_MASK 0x3fff +#define IFI_CANFD_TDELAY_ABS BIT(14) +#define IFI_CANFD_TDELAY_EN BIT(15)#define IFI_CANFD_ERROR 0x20#define IFI_CANFD_ERROR_TX_OFFSET 0
@@ -641,7 +645,7 @@ static void ifi_canfd_set_bittiming(strustruct ifi_canfd_priv *priv =netdev_priv (ndev);const struct can_bittiming *bt = &priv->can.bittiming;const struct can_bittiming *dbt = &priv->can.data_bittiming; -u16 brp, sjw, tseg1, tseg2; +u16 brp, sjw, tseg1, tseg2, tdc;/* Configure bit timing */ brp = bt->brp -2 ;
@@ -664,6 +668,11 @@ static void ifi_canfd_set_bittiming(stru (brp <<IFI_CANFD_TIME_PRESCALE_OFF ) | (sjw <<IFI_CANFD_TIME_SJW_OFF_7_9_8_8 ), 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 ); } static void ifi_canfd_set_filter(struct net_device *ndev, const u32 id,
Patches currently in stable-queue which might be from [email protected] are
queue-4.7/net-can-ifi-configure-transmitter-delay.patch