From: Jonathan Cameron <jic23@kernel.org>
To: Nicholas Mc Guire <hofrat@osadl.org>
Cc: Hartmut Knaack <knaack.h@gmx.de>,
Lars-Peter Clausen <lars@metafoo.de>,
Peter Meerwald <pmeerw@pmeerw.net>,
"Ivan T. Ivanov" <iivanov@mm-sol.com>,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/3] iio: qcom-spmi-iadc: cleanup wait_for_completion return handling
Date: Wed, 04 Feb 2015 16:59:10 +0000 [thread overview]
Message-ID: <54D24FDE.7000908@kernel.org> (raw)
In-Reply-To: <1422866227-10484-1-git-send-email-hofrat@osadl.org>
On 02/02/15 08:37, Nicholas Mc Guire wrote:
> This patch fixes two issues:
> * return type of wait_for_completion_timeout is unsigned long not int,
> rather than adding a dedicated variable the wait_for_completion_timeout
> is moved into the condition directly
> * the timeout of wait_for_completion_timeout is in jiffies but the value
> being passed was a unsigned long not converted to jiffies and thus was
> dependent on the HZ settings which is probably not what you want.
>
> Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Ivan, need your Ack / Reviewed-by on this one.
Looks superficially fine to me, but as Nicholas has observed, hardware
knowledge / testing required!
J
> ---
>
> Note that the timeout value changed very significantly as wait was
> initially in the range of 2 milliseconds, so this converts to 1 jiffies
> for HZ < 1000 and 2 jiffies for HZ=1000 - thus the timeout value changed
> by 3 orders of magnitude. This needs a review by someone that knows the
> details of the hardware to judge if this change is ok - in any case the
> timeout passed should go through usecs_to_jiffies or msecs_to_jiffis and
> to ensure it is no longer HZ dependent.
>
> Patch was compile tested only for imx_v6_v7_defconfig + CONFIG_IIO=m
> CONFIG_COMPILE_TEST=y, CONFIG_SPMI=m, CONFIG_QCOM_SPMI_IADC=m
>
> Patch is against 3.19.0-rc6 -next-20150130
>
> drivers/iio/adc/qcom-spmi-iadc.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/iio/adc/qcom-spmi-iadc.c b/drivers/iio/adc/qcom-spmi-iadc.c
> index b9666f2..61fb88d 100644
> --- a/drivers/iio/adc/qcom-spmi-iadc.c
> +++ b/drivers/iio/adc/qcom-spmi-iadc.c
> @@ -296,8 +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);
> - if (!ret)
> + if (!wait_for_completion_timeout(&iadc->complete,
> + usecs_to_jiffies(wait)))
> ret = -ETIMEDOUT;
> else
> /* double check conversion status */
>
next prev parent reply other threads:[~2015-02-04 18:40 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-02 8:37 [PATCH 2/3] iio: qcom-spmi-iadc: cleanup wait_for_completion return handling Nicholas Mc Guire
2015-02-04 16:59 ` Jonathan Cameron [this message]
2015-02-05 12:23 ` Ivan T. Ivanov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=54D24FDE.7000908@kernel.org \
--to=jic23@kernel.org \
--cc=hofrat@osadl.org \
--cc=iivanov@mm-sol.com \
--cc=knaack.h@gmx.de \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pmeerw@pmeerw.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.