devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
To: Andrew Lunn <andrew-g2DYL2Zd6BY@public.gmane.org>,
	Rob Herring <rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org>,
	Grant Likely
	<grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
Cc: Jason Cooper <jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
	anton.vorontsov-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org,
	jm-Pj/HzkgeCk7QXOPxS62xeg@public.gmane.org,
	linux ARM
	<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>,
	gmbnomis-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Subject: Re: [PATCH v3 1/3] power: Add simple poweroff-gpio driver
Date: Tue, 20 Nov 2012 14:17:24 -0700	[thread overview]
Message-ID: <50ABF364.1010004@wwwdotorg.org> (raw)
In-Reply-To: <20121120203127.GX14643-g2DYL2Zd6BY@public.gmane.org>

On 11/20/2012 01:31 PM, Andrew Lunn wrote:
> On Tue, Nov 20, 2012 at 10:11:18AM -0700, Stephen Warren wrote:
>> On 11/20/2012 01:37 AM, Andrew Lunn wrote:
>>> Hi Jason
>>>
>>> These are good comments from Stephan that i want to address. However,
>>> i also don't want to delay the pull-requests direction arm-soc, the
>>> merge window is getting close. Both Linus and Anton have Acked the
>>> current version, so please go with what you have and i will produce a
>>> patch over the top. If its available before Arnd pulls, you can squash
>>> it, otherwise send it upstream as a standalone patch.
>>
>> I'm not sure I agree here; the comments I made re: the delays and
>> pulse-vs-level may affect the definition of the DT binding, and that's
>> something that should be correct from the start.
> 
> Hi Stephen
> 
> There should be no need to change the binding is a none-backwards
> compatible way. The current delays work for all current users.

Well, the binding isn't written for current users, the description is
just a generic "GPIO to turn off the system".

> If some
> other user comes along which needs longer delays, they can add an
> optional property which specified a longer delay.

The DT maintainers have in the past expressed a wish to define DT
bindings completely, rather than incrementally adding stuff if at all
possible. I guess they weren't CC'd on this patch; I've added them here
for comment. I'll defer to whatever they think here.

> The pulse-vs-level is needed for the potential PXA use case, which is
> where i took this code from. When we first proposed this driver,
> Russel King pointed to the PXA reset.c code and requested we create
> something which PXA could use. The configuring the GPIO as an input
> also come from PXA, which the current two uses user don't need.
> 
> I agree it need better documentation, but the current code covers all
> bases. It will turn off a level based system, it will also turn off an
> edge based system. There is no need to specify in the DT which is
> needed, it will just work.

I'm not convinced the pulse logic can be correct for arbitrary users who
expect a level-sensitive GPIO; what if the MPU (or whatever the GPIO is
connected to) is confused by the pulse and fails to power down when it
sees a pulse (e.g. as a safety measure), but would have worked fine with
just a regular level?

>> The implementation of gpio_poweroff_do_poweroff() really doesn't seem to
>> make sense; related to the above.
>>
>> Also, probe deferral doesn't work, which will likely make this code
>> completely ineffective.
> 
> This code has been tested by the two current users. It works. However,
> i agree about your comment here, and i will fix it in the follow up
> patch.

If this were a specific driver just for certain platforms, I think it
might be OK. Yet the driver purports to be generic. As such, I think we
need to make it explicitly work for the general case, not just happen to
work for the platforms that have been tested so far.

  parent reply	other threads:[~2012-11-20 21:17 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-17  8:51 [PATCH v3 0/3] GPIO driver to turn power off Andrew Lunn
     [not found] ` <1353142266-1289-1-git-send-email-andrew-g2DYL2Zd6BY@public.gmane.org>
2012-11-17  8:51   ` [PATCH v3 1/3] power: Add simple poweroff-gpio driver Andrew Lunn
     [not found]     ` <1353142266-1289-2-git-send-email-andrew-g2DYL2Zd6BY@public.gmane.org>
2012-11-19 17:38       ` Stephen Warren
     [not found]         ` <50AA6E7E.5060501-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2012-11-20  8:37           ` Andrew Lunn
2012-11-20  8:48             ` Anton Vorontsov
     [not found]             ` <20121120083749.GM10259-g2DYL2Zd6BY@public.gmane.org>
2012-11-20 17:11               ` Stephen Warren
     [not found]                 ` <50ABB9B6.1010506-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2012-11-20 20:31                   ` Andrew Lunn
     [not found]                     ` <20121120203127.GX14643-g2DYL2Zd6BY@public.gmane.org>
2012-11-20 21:17                       ` Stephen Warren [this message]
     [not found]                         ` <50ABF364.1010004-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2012-11-20 22:05                           ` Andrew Lunn
     [not found]                             ` <20121120220524.GZ14643-g2DYL2Zd6BY@public.gmane.org>
2012-11-21  0:17                               ` Stephen Warren
2012-11-17  8:51   ` [PATCH v3 2/3] ARM: Kirkwood: Convert DNSKW to use gpio-poweroff Andrew Lunn
2012-11-17  8:51   ` [PATCH v3 3/3] ARM: Kirkwood: Convert IB62x0 " Andrew Lunn

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=50ABF364.1010004@wwwdotorg.org \
    --to=swarren-3lzwwm7+weoh9zmkesr00q@public.gmane.org \
    --cc=andrew-g2DYL2Zd6BY@public.gmane.org \
    --cc=anton.vorontsov-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
    --cc=gmbnomis-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org \
    --cc=jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org \
    --cc=jm-Pj/HzkgeCk7QXOPxS62xeg@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.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).