All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] can: ifi: Fix transmitter delay calculation
@ 2017-11-10 10:22 Marek Vasut
  2017-11-10 13:07 ` Marc Kleine-Budde
  0 siblings, 1 reply; 2+ messages in thread
From: Marek Vasut @ 2017-11-10 10:22 UTC (permalink / raw)
  To: linux-can; +Cc: Marek Vasut, Markus Marb, Marc Kleine-Budde

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: 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 0e22599dfe4a..6c37f5d4fe7e 100644
--- a/drivers/net/can/ifi_canfd/ifi_canfd.c
+++ b/drivers/net/can/ifi_canfd/ifi_canfd.c
@@ -671,9 +671,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.11.0


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

* Re: [PATCH] can: ifi: Fix transmitter delay calculation
  2017-11-10 10:22 [PATCH] can: ifi: Fix transmitter delay calculation Marek Vasut
@ 2017-11-10 13:07 ` Marc Kleine-Budde
  0 siblings, 0 replies; 2+ messages in thread
From: Marc Kleine-Budde @ 2017-11-10 13:07 UTC (permalink / raw)
  To: Marek Vasut, linux-can; +Cc: Markus Marb


[-- Attachment #1.1: Type: text/plain, Size: 733 bytes --]

On 11/10/2017 11:22 AM, Marek Vasut wrote:
> 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: Marc Kleine-Budde <mkl@pengutronix.de>

added to can.

Tnx,
Marc

-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

end of thread, other threads:[~2017-11-10 13:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-10 10:22 [PATCH] can: ifi: Fix transmitter delay calculation Marek Vasut
2017-11-10 13:07 ` Marc Kleine-Budde

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.