From: ChiYuan Huang <cy_huang@richtek.com>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: Sebastian Reichel <sre@kernel.org>,
ChiaEn Wu <chiaen_wu@richtek.com>, <linux-kernel@vger.kernel.org>,
<kernel-janitors@vger.kernel.org>,
Sebastian Reichel <sebastian.reichel@collabora.com>,
<linux-pm@vger.kernel.org>
Subject: Re: [PATCH] power: supply: rt9467: Fix rt9467_run_aicl()
Date: Fri, 17 Feb 2023 13:51:22 +0800 [thread overview]
Message-ID: <20230217055122.GA5502@linuxcarl2.richtek.com> (raw)
In-Reply-To: <2ed01020fa8a135c36dbaa871095ded47d926507.1676464968.git.christophe.jaillet@wanadoo.fr>
Hi, Christophe:
On Wed, Feb 15, 2023 at 01:43:04PM +0100, Christophe JAILLET wrote:
> It is spurious to bail-out on a wait_for_completion_timeout() call that
> does NOT timeout.
>
> Reverse the logic to return -ETIMEDOUT instead, in case of tiemout.
>
Thanks. It's really our coding issue.
Reviewed-by: ChiYuan Huang <cy_huang@richtek.com>
> Fixes: 6f7f70e3a8dd ("power: supply: rt9467: Add Richtek RT9467 charger driver")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> Compile tested only.
>
> This is spurious, because if I'm right, it means that it does not work!
> Testing on a real hardware is really welcomed.
> ---
> drivers/power/supply/rt9467-charger.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/power/supply/rt9467-charger.c b/drivers/power/supply/rt9467-charger.c
> index 96ad0d7d3af4..bb737fd1cca6 100644
> --- a/drivers/power/supply/rt9467-charger.c
> +++ b/drivers/power/supply/rt9467-charger.c
> @@ -598,8 +598,8 @@ static int rt9467_run_aicl(struct rt9467_chg_data *data)
>
> reinit_completion(&data->aicl_done);
> ret = wait_for_completion_timeout(&data->aicl_done, msecs_to_jiffies(3500));
> - if (ret)
> - return ret;
> + if (ret == 0)
> + return -ETIMEDOUT;
>
> ret = rt9467_get_value_from_ranges(data, F_IAICR, RT9467_RANGE_IAICR, &aicr_get);
> if (ret) {
> --
> 2.34.1
>
next prev parent reply other threads:[~2023-02-17 5:51 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-15 12:43 [PATCH] power: supply: rt9467: Fix rt9467_run_aicl() Christophe JAILLET
2023-02-17 5:51 ` ChiYuan Huang [this message]
2023-08-20 6:24 ` Christophe JAILLET
2023-09-14 16:14 ` Sebastian Reichel
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=20230217055122.GA5502@linuxcarl2.richtek.com \
--to=cy_huang@richtek.com \
--cc=chiaen_wu@richtek.com \
--cc=christophe.jaillet@wanadoo.fr \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=sebastian.reichel@collabora.com \
--cc=sre@kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox