* [PATCH RFC] iio: iadc: wait_for_completion_timeout time in jiffies
@ 2014-12-31 8:59 Nicholas Mc Guire
[not found] ` <1420016386-19638-1-git-send-email-der.herr-kA1LtwSENNE@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Nicholas Mc Guire @ 2014-12-31 8:59 UTC (permalink / raw)
To: Jonathan Cameron
Cc: Hartmut Knaack, Lars-Peter Clausen, Peter Meerwald, Grant Likely,
Rob Herring, Ivan T. Ivanov, linux-iio-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA, Nicholas Mc Guire
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 <der.herr-kA1LtwSENNE@public.gmane.org>
---
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
--
1.7.10.4
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH RFC] iio: iadc: wait_for_completion_timeout time in jiffies
[not found] ` <1420016386-19638-1-git-send-email-der.herr-kA1LtwSENNE@public.gmane.org>
@ 2015-01-04 11:16 ` Jonathan Cameron
[not found] ` <54A9212B.8050709-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Jonathan Cameron @ 2015-01-04 11:16 UTC (permalink / raw)
To: Nicholas Mc Guire
Cc: Hartmut Knaack, Lars-Peter Clausen, Peter Meerwald, Grant Likely,
Rob Herring, Ivan T. Ivanov, linux-iio-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA
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 <der.herr-kA1LtwSENNE@public.gmane.org>
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.
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
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH RFC] iio: iadc: wait_for_completion_timeout time in jiffies
[not found] ` <54A9212B.8050709-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
@ 2015-01-05 15:33 ` Ivan T. Ivanov
0 siblings, 0 replies; 3+ messages in thread
From: Ivan T. Ivanov @ 2015-01-05 15:33 UTC (permalink / raw)
To: Jonathan Cameron
Cc: Nicholas Mc Guire, Hartmut Knaack, Lars-Peter Clausen,
Peter Meerwald, Grant Likely, Rob Herring,
linux-iio-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA
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-kA1LtwSENNE@public.gmane.org>
> 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-NEYub+7Iv8PQT0dZR+AlfA@public.gmane.org>
>
> 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
> >
>
>
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-01-05 15:33 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-31 8:59 [PATCH RFC] iio: iadc: wait_for_completion_timeout time in jiffies Nicholas Mc Guire
[not found] ` <1420016386-19638-1-git-send-email-der.herr-kA1LtwSENNE@public.gmane.org>
2015-01-04 11:16 ` Jonathan Cameron
[not found] ` <54A9212B.8050709-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2015-01-05 15:33 ` Ivan T. Ivanov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).