public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
From: Amit Walambe <amit.walambe-ymFC7zkAqBLaL3YF3Y4TSbVCufUGDwFn@public.gmane.org>
To: i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org
Subject: Re: [PATCH] fix i801_transaction() and ioctl return values for i2c-i801
Date: Mon, 9 Jun 2008 15:27:50 +0000 (UTC)	[thread overview]
Message-ID: <loom.20080609T150250-626@post.gmane.org> (raw)
In-Reply-To: 20080609152352.40f3b5eb@hyperion.delvare

Jean Delvare <khali@...> writes:

> 
> Hi Amit,
Hi Jean!
I didn't receive this reply in my inbox. Otherwise I wouldn't have sent my
corrected patch. Sorry about that.

> I don't understand. You just said yourself that the problem didn't show
> on a 2.6.23 kernel, meaning that we somehow fixed the bug already, but
> still you want your patch to be applied?
My patch only waits till the busy bit clears. As you have said in your reply, it
adds unconditional delay of atleast 1 ms, but it avoided a few subsequent user
requests from failing.
I agree this happened on a very old kernel with vastly different behaviour, but
there is nothing in the current code to prevent it from happening. Still, I make
it your call if too cautious (but slow) patch is a good idea or not.
Please let me know if you think.

> For example, this patch:
>
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ca8b9e32a11a7cbfecbef00c8451a79fe1af392e
> seems pretty relevant to me, as it attempts to cleanly stop the
> controller on transaction timeout. It went into kernel 2.6.23.
This patch is useful to handle the failure that has occured (a new request fails
since controller is still busy with previous operation). But it doesn't avoid
this situation.

> i2cset supports this functionality since October 2004.
Apologies.

> I asked for the output of i2cdetect (i2cdetect 0 in your case), not
> i2cdetect -l. I wanted to have an idea what chips were present on the
> bus.
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- 08 -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: 20 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: 30 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- 44 -- -- -- 48 -- -- -- -- -- -- -- 
50: 50 -- -- -- 54 -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- 69 6a -- -- -- -- -- 
70: -- -- -- -- -- -- -- --                         

> Please note that "resetting" is not really the correct term for what
I used the "resetting the status bits" at some other places in the my email.
Shouldn't have used it interchangebly.

> One important thing to notice is that the driver is still doing
> something wrong in this area. If the host is found busy (bit 0 of the
> status register) the driver attempts to write 1 to that bit. Given that
> the bit in question is read-only, I'd say the chances that it works are
> thin... 
Ok, so the bit manipulation part is useless and wait part is only relevant.

> One thing that might still be worth investigating is why some
> transactions do not complete in the first place.
> 
> This might be related to the fact that the timeout loop was written
> with HZ=100 in mind and is broken by design. It timeouts in count (100,
> where all but one drivers have 500), not time. Depending on various
> parameters (amongst which the value of HZ), the actual time it waits
> for is very different. At HZ=100 it was typically 2 seconds, but at
> HZ=1000 it would be 200 ms, which isn't that much. Although at 16 kHz,
> a 32-byte I2C block read transaction would take 20 ms if I count
> correctly, so it still fits.
> 
> Could it be that some slave on the customer's I2C bus is misbehaving
> and holding the clock line low for longer than it should?
I will investigate more on this line. 

Thanks a lot for your help. 
- Amit


_______________________________________________
i2c mailing list
i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org
http://lists.lm-sensors.org/mailman/listinfo/i2c

  reply	other threads:[~2008-06-09 15:27 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20080606124447.756f8262@eurotech-ltd.co.uk>
     [not found] ` <20080606124447.756f8262-ymFC7zkAqBLaL3YF3Y4TSbVCufUGDwFn@public.gmane.org>
2008-06-08 18:18   ` [PATCH] fix i801_transaction() and ioctl return values for i2c-i801 Jean Delvare
     [not found]     ` <20080608201828.18483a17-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2008-06-09 10:56       ` Amit Walambe
     [not found]         ` <20080609115656.27d37dc2-ymFC7zkAqBLaL3YF3Y4TSbVCufUGDwFn@public.gmane.org>
2008-06-09 13:23           ` Jean Delvare
2008-06-09 15:27             ` Amit Walambe [this message]
     [not found]               ` <loom.20080609T150250-626-eS7Uydv5nfjZ+VzJOa5vwg@public.gmane.org>
2008-06-14 20:26                 ` Jean Delvare
     [not found]                   ` <20080614222635.15b41914-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2008-06-17  7:56                     ` Amit Walambe
     [not found]             ` <20080609152352.40f3b5eb-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2008-06-11  8:15               ` Amit Walambe
2008-06-09 13:25           ` Amit Walambe

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=loom.20080609T150250-626@post.gmane.org \
    --to=amit.walambe-ymfc7zkaqblal3yf3y4tsbvcufugdwfn@public.gmane.org \
    --cc=i2c-GZX6beZjE8VD60Wz+7aTrA@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox