All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] i2c: ismt: align the DMA buffer to avoid parity errors
@ 2017-08-18 16:01 Radu Rendec
  2017-08-18 16:01 ` [PATCH 1/2] i2c: ismt: 16-byte align the DMA buffer address Radu Rendec
  2017-08-18 16:01 ` [PATCH 2/2] i2c: ismt: dump registers at the end of transactions Radu Rendec
  0 siblings, 2 replies; 15+ messages in thread
From: Radu Rendec @ 2017-08-18 16:01 UTC (permalink / raw)
  To: linux-i2c; +Cc: Radu Rendec

Hello all,

I ran into an issue where write transfers were randomly failing with
"data parity" errors (bit 9 set in ERRSTS). This seems to be caused by a
hardware bug, probably the same as v3.12-rc2-5-gbf41691 addresses.

The problem appeared on an x86_64 kernel after enabling Xen support
(CONFIG_XEN), which appears to be completely unrelated but, as a side
effect, changed the alignment of the private structure (struct ismt_priv)
allocated at the beginning of ismt_probe().

On x86_64, addresses returned by kmalloc are guaranteed to be only 8-byte
aligned. However, i2c-ismt apparently was always getting a 16-byte
aligned address.

Since the hardware seems to have issues with unaligned DMA buffers (at
least in some revisions), I believe it is safer to always align the
buffer at the cost of 15 extra bytes of memory.

The first patch tackles this.

The second patch in the series adds a register dump at the end of
transactions (when debugging is enabled). This is not critical, but
probably helps debugging issues where some general/master registers are
changed as result of a failed transaction.

-Radu

Radu Rendec (2):
  i2c: ismt: 16-byte align the DMA buffer address
  i2c: ismt: dump registers at the end of transactions

 drivers/i2c/busses/i2c-ismt.c | 39 +++++++++++++++++++++------------------
 1 file changed, 21 insertions(+), 18 deletions(-)

-- 
2.9.5

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

end of thread, other threads:[~2018-01-15 19:53 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-18 16:01 [PATCH 0/2] i2c: ismt: align the DMA buffer to avoid parity errors Radu Rendec
2017-08-18 16:01 ` [PATCH 1/2] i2c: ismt: 16-byte align the DMA buffer address Radu Rendec
2017-08-27 14:37   ` Wolfram Sang
2017-08-29 16:37     ` radu.rendec
2018-01-04 13:46   ` [1/2] " Neil Horman
2018-01-04 15:42     ` Radu Rendec
2018-01-04 16:22       ` Neil Horman
2018-01-04 17:01         ` Radu Rendec
2018-01-05  1:47           ` Neil Horman
2018-01-15 12:33             ` Radu Rendec
2018-01-15 18:53               ` Neil Horman
2018-01-15 19:02                 ` Wolfram Sang
2018-01-15 19:53                   ` Neil Horman
2017-08-18 16:01 ` [PATCH 2/2] i2c: ismt: dump registers at the end of transactions Radu Rendec
2018-01-04 13:52   ` [2/2] " Neil Horman

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.