devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andreas Dannenberg <dannenberg@ti.com>
To: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Cc: Sebastian Reichel <sre@kernel.org>,
	Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Laurentiu Palcu <laurentiu.palcu@intel.com>,
	linux-pm@vger.kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH 13/13] dt: power: bq24257-charger: Cover additional devices
Date: Thu, 3 Sep 2015 11:09:26 -0500	[thread overview]
Message-ID: <20150903160926.GA26659@borg> (raw)
In-Reply-To: <55E7A8F8.7050300@samsung.com>

On Thu, Sep 03, 2015 at 10:57:12AM +0900, Krzysztof Kozlowski wrote:
> On 03.09.2015 10:47, Andreas Dannenberg wrote:
> > On Thu, Sep 03, 2015 at 10:31:20AM +0900, Krzysztof Kozlowski wrote:
> >> I still don't get why you need extra "ti,pg-gpio-disable" property. It
> >> could work like this:
> >> 1. Get rid of "ti,pg-gpio-disable" and make "pg-gpio" optional.
> >> 2. If it is present, use it.
> >> 3. If it is not present, use software based approach (the same as
> >> setting "ti,pg-gpio-disable" previously).
> >>
> >> Would that work?
> > 
> > Similar to the earlier comment - the idea was to have it more explicit.
> > Plus, the original driver would hard-fail when the "pg-gpio" pin is not
> > provided (since it was essential for that driver's ability to function).
> > If I change to automatically fallback to the SW solution such an error
> > case would in theory not be 100% backward compatible. I could however
> > more clearly indicate/log which method is being used (dev_info) so
> > somebody rummaging through the logs would still see it. Will simplify.
> 
> Right, the kernel's backward compatibility has to be preserved. However
> for bindings I am not sure.

Hi Krzysztof. Please see pages 3-5 in the below PDF, that's what I had
in mind. Maybe I mis-interpreted it or there is newer information.
http://events.linuxfoundation.org/sites/events/files/slides/petazzoni-dt-as-stable-abi-fairy-tale.pdf

With the proposed changes, while the existing bindings (strings) would
stay the same, the failure behavior in one specific use case would be
slightly different. The question is, where should we draw the line for
compatibility? I would argue in this case the general usage is not
affected so it should be OK making the change/simplification you propose
(getting rid of "ti,pg-gpio-disable"). 
 
> Let's assume booting on device with bq24257.
> 1. Old kernel booted with a DTB which doesn't have "pg-gpio" would print
> error (probe would fail).
> 2. New kernel booted in the same situation (1) would assume GPIOs have
> to be disabled.
> 
> 3. Old kernel booted with your previous solution (DTB containing both
> "pg-gpio" and "ti,pg-gpio-disable") would work fine ignoring the
> "disable" property.
> 4. New kernel in the same situation (3) would disable GPIOs.
> 
> There is a difference between (1) and (3). New DTB is not backward
> compatible with old kernels for existing bq24257 devices.
> 
> Am I understanding this correctly?

Well almost. I think the difference between case 1 and 3 isn't really an
issue from a use case point of view. The case I was trying to describe
is as follows (let's call it case 5):

5. An old DTB not containing "pg-gpio" (or with that property being
misconfigured) is booted with the new Kernel. The boot will succeed as
the SW approach for PG detection gets invoked automatically.

The difference now is between (1) and (5). If in (5) somebody specifies
"pg-gpio" they would want to explicitly use this pin and be notified if
the respective setup fails. My proposal earlier for this was to output
through dev_info() during driver probe whether an actual GPIO pin is
being used for power-good detection or whether the fall-back SW
algorithm has been invoked. This way, at least there is a notification.



Thanks and Regards,

--
Andreas Dannenberg
Texas Instruments Inc

> 
> Best regards,
> Krzysztof

  reply	other threads:[~2015-09-03 16:09 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-01  2:10 [PATCH 00/13] power: bq24257: Add support for bq24250/bq24251 Andreas Dannenberg
2015-09-01  2:10 ` [PATCH 01/13] power: bq24257: Add bit definition for temp sense enable Andreas Dannenberg
2015-09-01 19:42   ` Andrew F. Davis
2015-09-01  2:10 ` [PATCH 02/13] power: bq24257: Add dead battery reporting Andreas Dannenberg
2015-09-01 19:33   ` Andrew F. Davis
2015-09-01 21:04     ` Andreas Dannenberg
2015-09-01 21:16       ` Andrew F. Davis
2015-09-04 13:28         ` Laurentiu Palcu
2015-09-04 15:08           ` Andreas Dannenberg
     [not found] ` <1441073435-12349-1-git-send-email-dannenberg-l0cyMroinI0@public.gmane.org>
2015-09-01  2:10   ` [PATCH 03/13] power: bq24257: Add basic support for bq24250/bq24251 Andreas Dannenberg
2015-09-01 19:48     ` Andrew F. Davis
2015-09-01 21:24       ` Andreas Dannenberg
     [not found]     ` <1441073435-12349-4-git-send-email-dannenberg-l0cyMroinI0@public.gmane.org>
2015-09-02  8:19       ` Laurentiu Palcu
2015-09-02 14:16         ` Andreas Dannenberg
2015-09-02  8:07   ` [PATCH 00/13] power: bq24257: Add " Laurentiu Palcu
2015-09-02 14:09     ` Andreas Dannenberg
2015-09-01  2:10 ` [PATCH 04/13] power: bq24257: Allow manual setting of input current limit Andreas Dannenberg
2015-09-01 19:59   ` Andrew F. Davis
2015-09-02  8:23   ` Laurentiu Palcu
2015-09-01  2:10 ` [PATCH 05/13] power: bq24257: Add SW-based approach for Power Good determination Andreas Dannenberg
2015-09-01 20:01   ` Andrew F. Davis
     [not found]   ` <1441073435-12349-6-git-send-email-dannenberg-l0cyMroinI0@public.gmane.org>
2015-09-02  8:29     ` Laurentiu Palcu
2015-09-01  2:10 ` [PATCH 06/13] power: bq24257: Add over voltage protection setting support Andreas Dannenberg
2015-09-01 20:10   ` Andrew F. Davis
2015-09-01  2:10 ` [PATCH 07/13] power: bq24257: Add VINDPM voltage threshold " Andreas Dannenberg
2015-09-01 20:48   ` Andrew F. Davis
2015-09-01  2:10 ` [PATCH 08/13] power: bq24257: Extend scope of mutex protection Andreas Dannenberg
2015-09-01 20:34   ` Andrew F. Davis
2015-09-01 22:15     ` Andreas Dannenberg
2015-09-01  2:10 ` [PATCH 09/13] power: bq24257: Add charge type setting support Andreas Dannenberg
2015-09-01  2:10 ` [PATCH 10/13] power: bq24257: Add in_ilimit " Andreas Dannenberg
2015-09-01  2:10 ` [PATCH 11/13] power: bq24257: Add various device-specific sysfs properties Andreas Dannenberg
2015-09-01  2:10 ` [PATCH 12/13] power: bq24257: Add platform data based initialization Andreas Dannenberg
2015-09-01  2:10 ` [PATCH 13/13] dt: power: bq24257-charger: Cover additional devices Andreas Dannenberg
     [not found]   ` <1441073435-12349-14-git-send-email-dannenberg-l0cyMroinI0@public.gmane.org>
2015-09-02  5:24     ` Krzysztof Kozlowski
2015-09-02 14:03       ` Andreas Dannenberg
2015-09-03  1:31         ` Krzysztof Kozlowski
2015-09-03  1:47           ` Andreas Dannenberg
2015-09-03  1:57             ` Krzysztof Kozlowski
2015-09-03 16:09               ` Andreas Dannenberg [this message]
2015-09-03 23:50                 ` Krzysztof Kozlowski

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=20150903160926.GA26659@borg \
    --to=dannenberg@ti.com \
    --cc=dbaryshkov@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dwmw2@infradead.org \
    --cc=k.kozlowski@samsung.com \
    --cc=laurentiu.palcu@intel.com \
    --cc=linux-pm@vger.kernel.org \
    --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;
as well as URLs for NNTP newsgroup(s).