All of lore.kernel.org
 help / color / mirror / Atom feed
From: Radu Rendec <radu.rendec@gmail.com>
To: linux-i2c@vger.kernel.org
Cc: Radu Rendec <radu.rendec@gmail.com>
Subject: [PATCH 0/2] i2c: ismt: align the DMA buffer to avoid parity errors
Date: Fri, 18 Aug 2017 17:01:26 +0100	[thread overview]
Message-ID: <20170818160128.21228-1-radu.rendec@gmail.com> (raw)

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

             reply	other threads:[~2017-08-18 16:01 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-18 16:01 Radu Rendec [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170818160128.21228-1-radu.rendec@gmail.com \
    --to=radu.rendec@gmail.com \
    --cc=linux-i2c@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.