linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Liam Breck <liam@networkimprov.net>
To: Hans de Goede <hdegoede@redhat.com>
Cc: Sebastian Reichel <sre@kernel.org>,
	linux-pm@vger.kernel.org, Tony Lindgren <tony@atomide.com>,
	Liam Breck <kernel@networkimprov.net>
Subject: Re: [PATCH v3 4/4] power: bq24190_charger: Delay before polling reset flag
Date: Sun, 2 Apr 2017 13:16:59 -0700	[thread overview]
Message-ID: <CAKvHMgSq5LAo7294p4X4EuzzBii9yB5pgajW7HJtuw-X7MehUw@mail.gmail.com> (raw)
In-Reply-To: <66a0a8ca-16e2-ecbb-a5c3-73ef94d869c7@redhat.com>

On Sun, Apr 2, 2017 at 5:29 AM, Hans de Goede <hdegoede@redhat.com> wrote:
> Hi,
>
> On 01-04-17 22:25, Liam Breck wrote:
>>
>> From: Liam Breck <kernel@networkimprov.net>
>>
>> On chip reset, polling loop was reading reset register immediately.
>> Instead, call udelay() before reading chip register.
>
>
> Why ? What does this buy us ?
>
> Also I've yet to hear back from you on my patch to remove doing
> resets of the device altogether have you find any bad side-effects
> of that patch in your testing ?

On a DT-configured device, we don't want any charger settings done
prior to probe(), as we are going to apply DT values. So
register_reset() on probe seems right. If that can trigger a charger
bug, we should find a way to make the charger recover.

I will test for the possible bug you described when I have a chance;
I'm occupied with other stuff near-future. For the time being, let's
use the no_register_reset property from your first patchset.


> If not I would like us to proceed with simply removing the reset
> code as my patch does.
>
> Regards,
>
> Hans
>
>
>
>
>>
>> Cc: Tony Lindgren <tony@atomide.com>
>> Cc: Hans de Goede <hdegoede@redhat.com>
>> Signed-off-by: Liam Breck <kernel@networkimprov.net>
>> ---
>>  drivers/power/supply/bq24190_charger.c | 8 ++------
>>  1 file changed, 2 insertions(+), 6 deletions(-)
>>
>> diff --git a/drivers/power/supply/bq24190_charger.c
>> b/drivers/power/supply/bq24190_charger.c
>> index 52389c5..898faed 100644
>> --- a/drivers/power/supply/bq24190_charger.c
>> +++ b/drivers/power/supply/bq24190_charger.c
>> @@ -543,18 +543,14 @@ static int bq24190_register_reset(struct
>> bq24190_dev_info *bdi)
>>
>>         /* Reset bit will be cleared by hardware so poll until it is */
>>         do {
>> +               udelay(10);
>>                 ret = bq24190_read_mask(bdi, BQ24190_REG_POC,
>>                                 BQ24190_REG_POC_RESET_MASK,
>>                                 BQ24190_REG_POC_RESET_SHIFT,
>>                                 &v);
>>                 if (ret < 0)
>>                         return ret;
>> -
>> -               if (!v)
>> -                       break;
>> -
>> -               udelay(10);
>> -       } while (--limit);
>> +       } while (v && --limit);
>>
>>         if (!limit)
>>                 return -EIO;
>>
>

  reply	other threads:[~2017-04-02 20:17 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-01 20:25 [PATCH v3 0/4] BQ24190 charger fixes Liam Breck
2017-04-01 20:25 ` [PATCH v3 1/4] power: bq24190_charger: Limit over/under voltage fault logging Liam Breck
2017-04-01 20:25 ` [PATCH v3 2/4] power: bq24190_charger: Clean up extcon code Liam Breck
2017-04-02 12:27   ` Hans de Goede
2017-04-02 22:03     ` Liam Breck
2017-04-03  6:53       ` Hans de Goede
2017-04-03  8:17         ` Hans de Goede
2017-04-03 21:40         ` Liam Breck
2017-04-01 20:25 ` [PATCH v3 3/4] power: bq24190_charger: Uniform pm_runtime_get() failure handling Liam Breck
2017-04-01 20:25 ` [PATCH v3 4/4] power: bq24190_charger: Delay before polling reset flag Liam Breck
2017-04-02 12:29   ` Hans de Goede
2017-04-02 20:16     ` Liam Breck [this message]
2017-04-02 20:35       ` Hans de Goede
2017-04-04  4:36         ` Liam Breck

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=CAKvHMgSq5LAo7294p4X4EuzzBii9yB5pgajW7HJtuw-X7MehUw@mail.gmail.com \
    --to=liam@networkimprov.net \
    --cc=hdegoede@redhat.com \
    --cc=kernel@networkimprov.net \
    --cc=linux-pm@vger.kernel.org \
    --cc=sre@kernel.org \
    --cc=tony@atomide.com \
    /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;
as well as URLs for NNTP newsgroup(s).