lkml.org 
[lkml]   [2015]   [Jan]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectRe: [PATCH RFC] iio: iadc: wait_for_completion_timeout time in jiffies
From
Date

On Sun, 2015-01-04 at 11:16 +0000, Jonathan Cameron wrote:
> On 31/12/14 08:59, Nicholas Mc Guire wrote:
> > The timeout value to wait_for_completion_timeout is in jiffies but
> > the value being passed seems like it was intended to by microseconds
> > Note that the timeout was extremely long thus it might be too short
> > now. In any case it probably should be passed through usecs_to_jiffies()
> > or msecs_to_jiffies()
> >
> > patch is against linux-next 3.19.0-rc1 -next-20141226
> >
> > patch was only compile-tested x86_64_defcofnig + CONFIG_SPMI=m
> > CONFIG_IIO=m, CONFIG_QCOM_SPMI_IADC=m
> >
> > Signed-off-by: Nicholas Mc Guire herr@hofr.at>
> Certainly suspicious and I'd draw the same conclusion you did!
> Anyhow just waiting for Ivan to take a look as it's his driver.

Oops, true. Timeout is calculated in microseconds and have to
be converted to jiffies.

Thanks.

Acked-by: Ivan T. Ivanov <iivanov@mm-sol.com>


>
> Thanks,
>
> Jonathan
> > ---
> > drivers/iio/adc/qcom-spmi-iadc.c | 3 ++-
> > 1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/iio/adc/qcom-spmi-iadc.c b/drivers/iio/adc/qcom-spmi-iadc.c
> > index b9666f2..3080562 100644
> > --- a/drivers/iio/adc/qcom-spmi-iadc.c
> > +++ b/drivers/iio/adc/qcom-spmi-iadc.c
> > @@ -296,7 +296,8 @@ static int iadc_do_conversion(struct iadc_chip *iadc, int chan, u16 *data)
> > if (iadc->poll_eoc) {
> > ret = iadc_poll_wait_eoc(iadc, wait);
> > } else {
> > - ret = wait_for_completion_timeout(&iadc->complete, wait);
> > + ret = wait_for_completion_timeout(&iadc->complete,
> > + usecs_to_jiffies(wait));
> > if (!ret)
> > ret = -ETIMEDOUT;
> > else
> >
>
>


\
 
 \ /
  Last update: 2015-01-05 16:41    [W:2.035 / U:0.264 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site