All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>
To: Felix Rubinstein <felixru-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: Intel ICHx bus driver
Date: Wed, 3 Mar 2010 17:59:46 +0100	[thread overview]
Message-ID: <20100303175946.1ea5387e@hyperion.delvare> (raw)
In-Reply-To: <20100302222203.1eb67c3a-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>

Hi again Felix,

On Tue, 2 Mar 2010 22:22:03 +0100, Jean Delvare wrote:
> Obviously, if disabling the block buffer makes the same transaction
> work, then it has to be a bug in the driver. And the good news is: I
> was able to reproduce the bug using your test program, on an ICH5
> running kernel 2.6.27.45. On the same system, I can get SMBus block
> reads to work with or without the block buffer, so block buffer support
> is not entirely broken (if it was, we'd certainly have noticed earlier.)
> 
> Now ideally we need to figure out whether SMBus block writes are
> affected as well. We already know that SMBus block reads are not, and
> I2C block writes are. As I2C block reads are excluded (the block buffer
> can not be used for them according to the datasheet, and the driver
> already does the right thing), checking whether SMBus block writes are
> affected will tell us whether all block writes are affected, or if I2C
> block writes only are affected. This should help us find out where and
> what the bug could be.

Further testing today shows that SMBus block writes work just fine with
the block buffer feature enabled. So, the only problem is with I2C
block writes. My last attempt locked the SMBus, but I was able to
recover by repeatedly writing to the HST_STS register, as may times as
the block length. That is, the device operates in byte-by-byte mode
regardless of the block buffer mode being set. This leads me to the
conclusion that the E32B flag is ignored for I2C block write
transactions, exactly as it is for I2C block read transactions in my
experience.

Digging up a mailing list post dating to when I added support for I2C
block read support [1], I found the following statement of mine which is
certainly relevant:

"Note that I could not get the I2C block read to work with the block
buffer enabled, so for now it is implemented with the block buffer
disabled, which means that the performance isn't that good. I couldn't
find anything in the ICH datasheets suggesting that the two features
are mutually exclusive, so maybe I did something wrong, or maybe the
hardware really can't do it and it should be documented."

This was about I2C block reads, not writes, but given that the
datasheet doesn't mention anything about a possible incompatibility
between I2C block transactions and the use of the block buffer anyway,
what seems to apply to I2C block reads in practice might reasonably
apply to I2C block writes as well. So, at this point, I am inclined to
simply disable the block buffer for I2C block writes as we already do
for I2C block reads. This should be a rather simple fix, I'll post a
patch later today or tomorrow.

That being said, I can't exclude that I missed something and block
buffer support could work with I2C block transactions with some more
work, maybe using a trick not mentioned in the datasheet. If someone
can get it to work, I would be very grateful, as the block buffer is a
great feature.

While working on this issue, I noticed that the piece of code which is
supposed to let the i2c-i801 driver recover in case of a transaction
timeout, did not always work. I will try to improve it to correctly
handle the bug you reported, before we fix that bug. Hopefully it will
help recovery from other cases as well in the future.

[1] http://marc.info/?l=linux-i2c&m=119780045620870&w=2

-- 
Jean Delvare
http://khali.linux-fr.org/wishlist.html

  parent reply	other threads:[~2010-03-03 16:59 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-27 17:56 Intel ICHx bus driver Felix Rubinstein
     [not found] ` <af0693f01001270956h781f2832r928364574d3406aa-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-01-28  7:59   ` Jean Delvare
     [not found]     ` <20100128085904.4e202de1-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2010-01-28  9:32       ` Felix Rubinstein
     [not found]         ` <af0693f01001280132l4002af0fgf3137fa27ce8555e-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-01-28  9:53           ` Jean Delvare
     [not found]             ` <20100128105340.41aecf64-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2010-01-28 12:46               ` Felix Rubinstein
     [not found]                 ` <af0693f01001280446u66923c70ld707d10b9fcee068-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-01-28 13:29                   ` Jean Delvare
     [not found]             ` <af0693f01002182310i6678e4b5h80feb14b24b37742@mail.gmail.com>
     [not found]               ` <af0693f01002182310i6678e4b5h80feb14b24b37742-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-02-19  9:58                 ` Jean Delvare
     [not found]                   ` <20100219105841.2bd8b16c-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2010-02-22 16:12                     ` Felix Rubinstein
     [not found]                       ` <af0693f01002220812n5a6060cejc00d1ebbd7b9424d-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-02-22 21:58                         ` Jean Delvare
     [not found]                           ` <af0693f01002231521q4f99eb63ocd607670625fadfa@mail.gmail.com>
     [not found]                             ` <af0693f01002231521q4f99eb63ocd607670625fadfa-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-02-24 12:01                               ` Felix Rubinstein
     [not found]                                 ` <af0693f01002240401g1aeaf840ld06a156a06be9dbf-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-03-02 21:22                                   ` Jean Delvare
     [not found]                                     ` <20100302222203.1eb67c3a-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2010-03-03 16:36                                       ` Felix Rubinstein
2010-03-03 16:59                                       ` Jean Delvare [this message]
2010-02-28 11:08                               ` Jean Delvare
     [not found]                                 ` <20100228120817.275ef279-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2010-02-28 13:45                                   ` Felix Rubinstein
     [not found]                                     ` <af0693f01002280545n622b1c41v1f8c104e57fb51b6-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-02-28 20:19                                       ` Jean Delvare
     [not found]                                         ` <20100228211949.3297a0ff-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2010-03-02 12:53                                           ` Felix Rubinstein
     [not found]                                             ` <af0693f01003020453m7ca6891bjca4833c7fa45f44d-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-03-12 13:19                                               ` Jean Delvare
     [not found]                                                 ` <20100312141901.04299a55-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2010-03-12 16:24                                                   ` Jean Delvare
     [not found]                                                     ` <20100312172421.5b4907e6-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2010-03-15  9:43                                                       ` Felix Rubinstein
     [not found]                                                         ` <af0693f01003150243u4d4d76e7t71b37ecd452896ea-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-03-15 10:06                                                           ` Jean Delvare
     [not found]                                                             ` <20100315110645.1df3e4f0-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2010-03-15 11:12                                                               ` Felix Rubinstein
     [not found]                                                                 ` <af0693f01003150412p5823d8e0j678b035b1c7cc4bb-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-03-15 11:46                                                                   ` Jean Delvare
     [not found]                                                                     ` <20100315124648.6dafae21-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2010-03-15 13:12                                                                       ` Felix Rubinstein

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=20100303175946.1ea5387e@hyperion.delvare \
    --to=khali-puyad+kwke1g9huczpvpmw@public.gmane.org \
    --cc=felixru-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.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.