devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: Javier Martinez Canillas
	<javier-0uQlZySMnqxg9hUCZPvPmw@public.gmane.org>
Cc: linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org,
	devicetree <devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	linux-fbdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Mike Turquette
	<mturquette-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>,
	Luc Verhaegen <libv-AgBVmzD5pcezQB+pC5nmwQ@public.gmane.org>,
	Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Geert Uytterhoeven
	<geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org>,
	David Herrmann
	<dh.herrmann-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Grant Likely
	<grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	Maxime Ripard
	<maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>,
	Jean-Christophe Plagniol-Villard
	<plagnioj-sclMFOaUSTBWk0Htik3J/w@public.gmane.org>,
	"linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org"
	<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>
Subject: Re: Re: [PATCH v4 0/5] simplefb: add clock handling code
Date: Fri, 31 Oct 2014 10:51:09 +0100	[thread overview]
Message-ID: <54535B8D.7040508@redhat.com> (raw)
In-Reply-To: <CABxcv=kdRTXKE8S-M_qRo_qz_Ap-e+qz393NQseNe=rkXZrxiw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

Hi,

On 10/31/2014 10:37 AM, Javier Martinez Canillas wrote:
> Hello Hans,
> 
> On Fri, Oct 31, 2014 at 10:00 AM, Hans de Goede <hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> wrote:
>> Hi Tomi,
>>
>> On 10/31/2014 09:15 AM, Tomi Valkeinen wrote:
>>> Hi Hans,
>>>
>>> On 22/10/14 19:45, Hans de Goede wrote:
>>>
>>>> -We will add a clocks property to the simplefb devicetree bindings, so
>>>>  that u-boot setup framebuffers passed to the kernel (for early console
>>>>  support) can properly list the clocks used, and simplefb can claim them to
>>>>  avoid them getting turned off, thereby breaking the early console
>>>
>>> Perhaps this has been discussed earlier, but I started to wonder if
>>> managing clocks is enough.
>>>
> 
> Managing clocks is definitely not enough. For example, adding some
> regulators to the Snow Chromebook DTS broke simplefb [0]. This has
> been mentioned on at least one of the many simplefb threads.

Ok.

>>> What about regulators (to power the LCD), gpios (to keep the LCD
>>> enabled) and pinctrl (for video signals)? I guess any those could be
>>> reset by the kernel if no driver uses them.
>>
>> Yes this has been discussed before, AFAIK gpio / pinctrls should not be
>> spontaneously reset by the kernels. Regulators will be a problem, but there
>> we can pretty much follow whatever solution we end up with for clocks, since
>> they work very much alike (e.g. we could add a supply property to the
>> simplefb node).
>>
> 
> I think someone already said this but with regulators is not that easy
> since you don't have an equivalent of the "clocks" property.
> 
> You need a "<name>-supply" property for each regulator that is an
> input supply. Some boards may need different regulators for their
> display (e.g: one to power the LCD and another to power the backlight)
> so adding a single supply property will not be enough.

Right so we can simply insert simplefbvdd1-supply, simplefbvdd2-supply, etc.
regulator nodes into the simplefb node, and have the simplefb kernel code look
for supplies with a name of simplefb_vdd%d in a loop until it fails to find one.

Note that the foo-supply names are local to the simplefb node, these do not
need to be the same as the ones in the nodes describing the actual hardware
blocks. Not having an array is somewhat inconvenient, but easily worked around
and once worked around this really is just the same problem as with clocks.

>> Note I've no intention to add regulator support atm, we can do that when the
>> need arises, so that we can actually test the code.
>>
> 
> AFAIU that's exactly what Thierry was complaining about. There seems
> to be only a focus on solving the clocks issue since that is needed
> for sunxi but ignoring how the problem for other resources should be
> solved.

That is simply not true, I'm fully aware that we may eventually need other
resources, e.g. regulators. I just want to take this one step at a time,
I really believe that once we have this figured out for one resource, it
becomes a lot easier to also figure out for other resources.

> The assumptions made by simplefb are quite fragile and only adding
> support for managing clocks is just a partial solution that will give
> a false sense of robustness since it could break later due to other
> resources.

The key word here being resources. We need to figure out how to do
resource management for simplefb, once we have that figured out for one
resource, the others can follow the same "design-pattern". As the long
thread about the clocks support has shown, getting consensus on this
with only one resource in play already is hard enough, so baby steps
is the way to go.

Regards,

Hans

  parent reply	other threads:[~2014-10-31  9:51 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-22 16:45 [PATCH v4 0/5] simplefb: add clock handling code Hans de Goede
     [not found] ` <1413996311-4287-1-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-10-22 16:45   ` [PATCH v4 1/5] simplefb: Add simplefb MAINTAINERS entry Hans de Goede
     [not found]     ` <1413996311-4287-2-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-11-11 16:27       ` Grant Likely
2014-10-22 16:45   ` [PATCH v4 2/5] dt-bindings: Add a clocks property to the simple-framebuffer binding Hans de Goede
     [not found]     ` <1413996311-4287-3-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-11-11 21:42       ` Grant Likely
     [not found]         ` <546373C6.4010001@redhat.com>
     [not found]           ` <546373C6.4010001-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-11-12 14:56             ` Grant Likely
     [not found]               ` <CACxGe6v15EjpALit4ZJLXDgCkwEYM4t1mryjoQpa3=wpKmXWEg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-11-12 15:27                 ` Hans de Goede
2014-11-12 16:38                 ` Grant Likely
     [not found]                   ` <CACxGe6vBq5Y6HbogbpVUy9VLaocfrAsR_XRbio4zBB_vY5GRsw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-11-12 17:43                     ` Rob Herring
2014-10-22 16:45   ` [PATCH v4 3/5] simplefb: formalize pseudo palette handling Hans de Goede
     [not found]     ` <1413996311-4287-4-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-11-11 16:34       ` Grant Likely
2014-10-22 16:45   ` [PATCH v4 4/5] simplefb: add goto error path to probe Hans de Goede
2014-10-22 16:45   ` [PATCH v4 5/5] simplefb: add clock handling code Hans de Goede
2014-10-28 10:44   ` [PATCH v4 0/5] " Tomi Valkeinen
     [not found]     ` <544F737A.7000109-l0cyMroinI0@public.gmane.org>
2014-10-28 11:08       ` Hans de Goede
2014-10-28 11:11       ` Rob Herring
     [not found]         ` <CAL_JsqJ2JRg7k21CEVe4-At7enD+y3TN_7wfqhY0OHZm-_j17w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-10-28 11:30           ` Hans de Goede
     [not found]             ` <544F7E5D.60104-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-10-29 11:08               ` Tomi Valkeinen
     [not found]                 ` <5450CAA5.5020205-l0cyMroinI0@public.gmane.org>
2014-10-31 20:47                   ` Rob Herring
     [not found]                     ` <CAL_JsqKWqq+H5ymUW3n8tkmLJHEUGaKDLX5+orJmGUQ3ECQwUQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-11-02 14:39                       ` Hans de Goede
2014-11-02 15:27                       ` jonsmirl-Re5JQEeQqe8AvxtiuMwx3w
2014-11-02 15:28                       ` jonsmirl-Re5JQEeQqe8AvxtiuMwx3w
     [not found]                         ` <CAKON4Oyw46zjq8QJNAFi9qWA9-6MpXtGavzVmXQT3SPqH=NpjQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-11-05  3:36                           ` Neal Peacock
2014-11-05  8:02                           ` Luc Verhaegen
2014-11-11 21:49                       ` Grant Likely
     [not found]                         ` <20141111214950.7FCABC41610-WNowdnHR2B42iJbIjFUEsiwD8/FfD2ys@public.gmane.org>
2014-11-12  8:34                           ` Geert Uytterhoeven
     [not found]                             ` <CAMuHMdUoPK_s7OP1Aop4eOyhec+abFij7ZoAAdA5fqpJJy-Dgg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-11-12  9:57                               ` Grant Likely
     [not found]                                 ` <CACxGe6sMF2C6hvRNNnB_i6a44fh0WC7JjjisFOh5GMV66mC6Fw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-11-12 10:08                                   ` Geert Uytterhoeven
     [not found]                                     ` <CAMuHMdVX72ve9TqpA9GUtumZGDnCjYqKemMxyNf=a4AxWR44iQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-11-12 10:28                                       ` Grant Likely
2014-10-31  8:15   ` Tomi Valkeinen
     [not found]     ` <54534523.8080801-l0cyMroinI0@public.gmane.org>
2014-10-31  9:00       ` Hans de Goede
     [not found]         ` <54534FAE.1060401-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-10-31  9:37           ` Javier Martinez Canillas
     [not found]             ` <CABxcv=kdRTXKE8S-M_qRo_qz_Ap-e+qz393NQseNe=rkXZrxiw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-10-31  9:51               ` Hans de Goede [this message]
     [not found]                 ` <54535B8D.7040508-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-10-31 10:19                   ` Javier Martinez Canillas
2014-11-06 14:18       ` Tomi Valkeinen
     [not found]         ` <545B8338.8060908-l0cyMroinI0@public.gmane.org>
2014-11-06 15:05           ` Hans de Goede
     [not found]             ` <545B8E29.90807-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-11-11 21:54               ` Grant Likely

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=54535B8D.7040508@redhat.com \
    --to=hdegoede-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=dh.herrmann-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org \
    --cc=grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=javier-0uQlZySMnqxg9hUCZPvPmw@public.gmane.org \
    --cc=libv-AgBVmzD5pcezQB+pC5nmwQ@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-fbdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
    --cc=maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org \
    --cc=mturquette-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=plagnioj-sclMFOaUSTBWk0Htik3J/w@public.gmane.org \
    --cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=swarren-3lzwWm7+Weoh9ZMKESR00Q@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).