lkml.org 
[lkml]   [2014]   [Aug]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    SubjectRE: [PATCH v6 1/2] i2c: imx: add DMA support for freescale i2c driver
    Date
    From: Yuan Yao-B46683 Data: Thursday, August 07, 2014 4:05 PM
    >To: Duan Fugang-B38611; wsa@the-dreams.de; marex@denx.de
    >Cc: LW@KARO-electronics.de; mark.rutland@arm.com; shawn.guo@linaro.org;
    >linux-kernel@vger.kernel.org; linux-arm-kernel@lists.infradead.org; linux-
    >i2c@vger.kernel.org; Li Frank-B20596
    >Subject: RE: [PATCH v6 1/2] i2c: imx: add DMA support for freescale i2c
    >driver
    >
    >Hi Fugang,
    >
    >> >> >+ /* Waiting for Transfer complete. */
    >> >> >+ while (timeout--) {
    >> >> >+ temp = imx_i2c_read_reg(i2c_imx, IMX_I2C_I2SR);
    >> >> >+ if (temp & I2SR_ICF)
    >> >> >+ break;
    >> >> >+ udelay(10);
    >> >> >+ }
    >> >> Whether there have better method like interrupt to avoid dead wait
    >> >> here until timeout ?
    >> >
    >> >Can you give me more suggestion? We have discussed it with our team,
    >> >It seems the short query wait is necessary.
    >> >
    >> At least, you can use schdule_timeout() instead of udelay() ?
    >
    >In fact, the waiting time normally is less than 10-50us, but the minimum
    >time interval for schdule_timeout() is 1 jiffies.
    >So maybe schdule_timeout() is not very necessary?
    >
    Oh, if the waiting time is 10 ~ 50us, you can use usleep_range(10, 50).


    \
     
     \ /
      Last update: 2014-08-07 12:21    [W:4.038 / U:0.276 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site