From: Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>
To: Amit Walambe
<amit.walambe-ymFC7zkAqBLaL3YF3Y4TSbVCufUGDwFn@public.gmane.org>
Cc: i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org
Subject: Re: [PATCH] fix i801_transaction() and ioctl return values for i2c-i801
Date: Sat, 14 Jun 2008 22:26:35 +0200 [thread overview]
Message-ID: <20080614222635.15b41914@hyperion.delvare> (raw)
In-Reply-To: <loom.20080609T150250-626-eS7Uydv5nfjZ+VzJOa5vwg@public.gmane.org>
Hi Amit,
Sorry for the late reply, I wanted to have some code to show before
replying and it took longer to write than expected.
On Mon, 9 Jun 2008 15:27:50 +0000 (UTC), Amit Walambe wrote:
> > 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.
The slowdown caused by your patch is clearly not acceptable. It would
be very easy to rewrite it to only delay as necessary. But the reason
why I dislike your patch goes beyond this: I think it's broken by
design. I can't see how it is different from simply changing the value
of MAX_TIMEOUT from 100 to 200 as far as delay is concerned. And
increasing MAX_TIMEOUT to 200 would have the added benefit that the
first transaction would even succeed instead of failing (if the issue
is that the transaction takes more time than the driver expects.)
Have you tried increasing MAX_TIMEOUT to 200 or even 500, to see if it
would solve your problem?
> > 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.
It is supposed to address exactly the problem you reported, by not
leaving the controller in a busy state at the end of a "failing"
transaction (where "failing" can mean "takes too long" too). Whether
this actually works or not, is another story... I gave it a try today
on an ICH5-based system, and the only error case I could test (SMBus
block read with invalid size) was not recovered properly. The code
looks good though, so maybe it's a hardware issue. I would really like
to know if it works in your case.
> > 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: -- -- -- -- -- -- -- --
I/O, EEPROM, thermal sensor, clock chips... lot of stuff on this bus!
> > 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.
Correct.
As you may have seen already, I've just sent the i2c-i801 patches I've
been working on. The 4th one:
http://lists.lm-sensors.org/pipermail/i2c/2008-June/004070.html
fixes the handling of the HOST_BUSY bit, amongst other error handling
cleanups. It would be great if you could test it, although I understand
that it might be difficult, or even impossible, if your customer has to
stick to kernel 2.6.9. But one thing for sure, is that I won't take
your patch, unless you test both kernel 2.6.25 and Linus' latest with
my patches applied, and both keep failing in your situation.
--
Jean Delvare
_______________________________________________
i2c mailing list
i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org
http://lists.lm-sensors.org/mailman/listinfo/i2c
next prev parent reply other threads:[~2008-06-14 20:26 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
[not found] ` <loom.20080609T150250-626-eS7Uydv5nfjZ+VzJOa5vwg@public.gmane.org>
2008-06-14 20:26 ` Jean Delvare [this message]
[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=20080614222635.15b41914@hyperion.delvare \
--to=khali-puyad+kwke1g9huczpvpmw@public.gmane.org \
--cc=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