linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [RFC] Fix D_CAN corrupted bytes by using 32 bit register r/w
@ 2016-06-16 16:10 tthayer at opensource.altera.com
  2016-06-16 16:10 ` [RFC] can: c_can: Update D_CAN TX and RX functions to 32 bit tthayer at opensource.altera.com
  2016-06-17  8:48 ` [RFC] Fix D_CAN corrupted bytes by using 32 bit register r/w Marc Kleine-Budde
  0 siblings, 2 replies; 5+ messages in thread
From: tthayer at opensource.altera.com @ 2016-06-16 16:10 UTC (permalink / raw)
  To: linux-arm-kernel

From: Thor Thayer <tthayer@opensource.altera.com>

Corrupted bytes in CAN transmission on the Altera CycloneV seem
to be an issue because the D_CAN registers are 32 bits [1].
Changing to a 32 bit write fixes the problem and this patch
includes one method of fixing the problem by selecting 32 bit
writes for D_CAN or 16 bit writes for C_CAN.

Another option would be to remove the D_CAN if test and always use
the priv->read_reg32() and priv->write_reg32() for both C_CAN and
D_CAN. The C_CAN read_reg32() function performs two 16 bit writes.
The code is cleaner without the D_CAN if branch but it adds additional
overhead for C_CAN (2nd 16 bit write may not be needed in many cases).

This patch isolates the changes to D_CAN and has been tesed on
on the Altera CycloneV devkit using a flood write test.

[1] http://comments.gmane.org/gmane.linux.can/9402

Thor Thayer (1):
  can: c_can: Update D_CAN TX and RX functions to 32 bit.

 drivers/net/can/c_can/c_can.c |   38 +++++++++++++++++++++++++++++++-------
 1 file changed, 31 insertions(+), 7 deletions(-)

-- 
1.7.9.5

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

end of thread, other threads:[~2016-06-22 18:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-16 16:10 [RFC] Fix D_CAN corrupted bytes by using 32 bit register r/w tthayer at opensource.altera.com
2016-06-16 16:10 ` [RFC] can: c_can: Update D_CAN TX and RX functions to 32 bit tthayer at opensource.altera.com
2016-06-17  9:04   ` Marc Kleine-Budde
2016-06-22 18:43     ` AW: " Richard Andrysek
2016-06-17  8:48 ` [RFC] Fix D_CAN corrupted bytes by using 32 bit register r/w Marc Kleine-Budde

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).