Re: Re: Re: [PATCH] I2C: Change the value of octeon i2c adapter timeout value

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

 



> 
> Have you been writing to EEPROMS? Their erase/write cycle might be
> longer. But I am not forcing you to change the value, just giving some
> suggestions.

My board has i2c mux, temp sensor, eeprom.  And I added some debugging code for measuring i2c response time as below  and 
run i2c operation for each device. 
The maximum respeonse time was 500usec(under 1msec). So 20 msec is enough for adapter timeout. 
Thanks. 
static int octeon_i2c_wait(struct octeon_i2c *i2c)
{
        int result;
+        struct timeval start, end;

        octeon_i2c_int_enable(i2c);

+        do_gettimeofday(&start);
        result = wait_event_timeout(i2c->queue,
                                          octeon_i2c_test_iflg(i2c),
                                          i2c->adap.timeout);

+        do_gettimeofday(&end);

+        if(end.tv_usec < start.tv_usec){
+               end.tv_usec += 1000000;
+               end.tv_sec--;
+       }

+        if(result > 0)
+                printk("octeon_i2c_wait elapse time: %ld msecs\n", (end.tv_sec - start.tv_sec)*1000000 + (end.tv_usec - start.tv_usec));
+        else
+                printk("octeon_i2c_wait fail!!\n");
}ÿ淸º{.nÇ+돴윯돪†+%듚ÿ깁負¥Šwÿº{.nÇ+돴¥Š{깸-쒩)í끾èw*jgП¨¶‰šŽ듶¢jÿ¾?G«앶ÿ◀◁¦j:+v돣ŠwèjØm¶Ÿÿ?®w?듺þf"·hš뤴얎ÿ녪¥





[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