RE: [Uclinux-dist-devel] [PATCH 1/2] i2c-bfin-twi: integrate timeout timer withcompletion interface

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



OK. The definition of adapter->timeout changed in new kernel from 10 millisecond to jiffies. So, change accordingly.

Sonic 

-----Original Message-----
From: Mike Frysinger [mailto:vapier.adi@xxxxxxxxx] 
Sent: Friday, October 09, 2009 1:10 PM
To: Zhang, Sonic
Cc: Wolfram Sang; uclinux-dist-devel@xxxxxxxxxxxxxxxxxxxx; linux-i2c@xxxxxxxxxxxxxxx; Ben Dooks
Subject: Re: [Uclinux-dist-devel] [PATCH 1/2] i2c-bfin-twi: integrate timeout timer withcompletion interface

On Fri, Oct 9, 2009 at 00:49, Zhang, Sonic wrote:
> From: Wolfram Sang [mailto:w.sang@xxxxxxxxxxxxxx]
>> On Wed, Oct 07, 2009 at 11:38:15PM -0400, Mike Frysinger wrote:
>>> From: Sonic Zhang <sonic.zhang@xxxxxxxxxx>
>>>
>>> There isn't much point in managing our own custom timeout timer when 
>>> the completion interface already includes support for it.  This 
>>> makes the resulting code much simpler and robust.
>>
>> This sounds like a good thing to do, but keep in mind that
>> adapter->timeout values should be in jiffies (see
>> 8a52c6b4d55b2960d93a90a7cf6afd252357fa54).
>
> Yes, jiffies is used in this patch for timeout value.

no it isnt.  the commit he refers to does things like:
-   adap->timeout = 1;
+   adap->timeout = HZ;
        ret = wait_event_interruptible_timeout(dev->wq,
-           !(in_8(&iic->sts) & STS_PT), dev->adap.timeout * HZ);
+           !(in_8(&iic->sts) & STS_PT), dev->adap.timeout);

we need to make the same change as our code is currently wrong:
+               if (!wait_for_completion_timeout(&iface->complete,
+                       adap->timeout * HZ)) {
+       p_adap->timeout = 5;
-mike
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux