devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org>
To: "jonsmirl-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org"
	<jonsmirl-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: linux-sunxi <linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>,
	Hans de Goede <hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
	Tomi Valkeinen <tomi.valkeinen-l0cyMroinI0@public.gmane.org>,
	Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>,
	Jean-Christophe Plagniol-Villard
	<plagnioj-sclMFOaUSTBWk0Htik3J/w@public.gmane.org>,
	Grant Likely
	<grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Luc Verhaegen <libv-AgBVmzD5pcezQB+pC5nmwQ@public.gmane.org>,
	Maxime Ripard
	<maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>,
	Mike Turquette
	<mturquette-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	"linux-fbdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-fbdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org"
	<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>,
	devicetree <devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: Re: [PATCH v3] dt-bindings: Add a clocks property to the simple-framebuffer binding
Date: Fri, 3 Oct 2014 23:26:33 +0200	[thread overview]
Message-ID: <CAMuHMdVSyqJA6uTPiemco0guhG1MKgkCBV7Tik-Ndd_fs28=NQ@mail.gmail.com> (raw)
In-Reply-To: <CAKON4OxrcgWvJM_BCKwLDRBodaFC1h8Csu_srzjJSM=L+gpuaA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

On Fri, Oct 3, 2014 at 10:55 PM, jonsmirl-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org <jonsmirl-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> On Thu, Oct 2, 2014 at 9:46 AM, Geert Uytterhoeven <geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org> wrote:
>> On Thu, Oct 2, 2014 at 3:34 PM, jonsmirl-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org <jonsmirl-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>>> Does the clock and regulator cleanup happen before drivers can load
>>> off from initrd? I didn't think it did but I might be wrong.
>>
>> Yes
>>
>> drivers/base/power/domain.c:late_initcall(genpd_poweroff_unused);
>> drivers/clk/clk.c:late_initcall_sync(clk_disable_unused);
>> drivers/regulator/core.c:late_initcall_sync(regulator_init_complete);
>
> What do you think about putting these calls onto an ioctl somewhere
> and then eliminating the late_initcall(..)? A tiny user space app
> could then hit that ioctl after all of the loadable device drivers are
> loaded. Add the command to make this ioctl call to busybox or udev.
> After all, it is not fatal if these calls aren't made, all they do is
> save power. Add a link in rc.d or somewhere similar to run this app at
> the appropriate time.
>
> Switching these over to an ioctl allows a window to be opened for
> device specific driver loading before the clock/regulator clean up
> happens.
>
> Now all of this mess of protecting clocks and regulator disappears.
> Instead get the device specific drivers written and loaded, then run
> the cleanup app which hits the ioctl(). All of the correct
> clock/regulators will be claimed and then this clean code will do the
> right thing.
>
> From my perspective it appears that this cleanup is being done too
> early which then triggers a need to protect things from cleanup.

Not doing the cleanup doesn't help.

If someone else calls clk_disable() on a clock which shares a parent
with the clock you're silently using, that clock will still be disabled.
This can happen at any time.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

  parent reply	other threads:[~2014-10-03 21:26 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-03 14:05 [PATCH v3] dt-bindings: Add a clocks property to the simple-framebuffer binding Hans de Goede
     [not found] ` <1412345120-24588-1-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-10-03 15:57   ` Rob Herring
     [not found]     ` <CAL_JsqKU2n8p=YfJua3k-mR40bG_4SiZY8_-SL-MXtuWN5NeHg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-10-03 16:04       ` Geert Uytterhoeven
     [not found]         ` <CAMuHMdVgaXoGXyJdD8PRufZQYLTSY=_ZWRRo=OtRo3mrg3uEug-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-10-03 16:19           ` Rob Herring
     [not found]             ` <CAL_Jsq+_uFAQ-LjRtmqTW8CQvAwUVkYNu6STVEgeqsHA684rtw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-10-03 17:41               ` Hans de Goede
2014-10-03 17:34       ` Hans de Goede
     [not found]         ` <542EDE11.3010802-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-10-03 20:08           ` Rob Herring
     [not found]             ` <CAL_Jsq+3c7ToCGaR4Nz7dDXvebBKzzMv85swzy2mzOou+gM5iw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-10-03 20:55               ` jonsmirl-Re5JQEeQqe8AvxtiuMwx3w
     [not found]                 ` <CAKON4OxrcgWvJM_BCKwLDRBodaFC1h8Csu_srzjJSM=L+gpuaA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-10-03 21:26                   ` Geert Uytterhoeven [this message]
     [not found]                     ` <CAMuHMdVSyqJA6uTPiemco0guhG1MKgkCBV7Tik-Ndd_fs28=NQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-10-03 21:50                       ` jonsmirl-Re5JQEeQqe8AvxtiuMwx3w
     [not found]                         ` <CAKON4OwZahPqPPqorFvgK+YNeYfqH87FTuX=umhZ42uGR32MMA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-10-04 20:38                           ` Mike Turquette
2014-10-03 22:56               ` jonsmirl-Re5JQEeQqe8AvxtiuMwx3w
     [not found]                 ` <CAKON4OxxQ3hp0npr1Zh6w-2-HwMyC+8OxOCBmFFmBZ0N+6N0dw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-10-04  9:50                   ` Hans de Goede
     [not found]                     ` <542FC2E6.5040800-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-10-04 12:38                       ` [linux-sunxi] " jonsmirl-Re5JQEeQqe8AvxtiuMwx3w
     [not found]                         ` <CAKON4Owg_ABPJ9JfXqZwj9TQQNSPa8LKgr7U762B6--NTrOVFQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-10-05  9:03                           ` Hans de Goede
     [not found]                             ` <54310955.2090708-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-10-05 12:52                               ` jonsmirl-Re5JQEeQqe8AvxtiuMwx3w
     [not found]                                 ` <CAKON4OwYg8obyjPp9VL5O4fq6zK5jhd+Jr-v59yisoHqX09iag-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-10-05 14:27                                   ` Hans de Goede
     [not found]                                     ` <54315556.2050308-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-10-05 15:07                                       ` jonsmirl-Re5JQEeQqe8AvxtiuMwx3w
     [not found]                                         ` <CAKON4Ozo3qZjdweUpkF8kwyisjgwmHeQx_jzh6S5TzGEBnVpnw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-10-05 15:16                                           ` Hans de Goede
     [not found]                                             ` <543160D6.5040703-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-10-05 15:17                                               ` jonsmirl-Re5JQEeQqe8AvxtiuMwx3w
     [not found]                                                 ` <CAKON4OyE8Zw-yA-mKhPEs=yz-R4=wkZSwA1g8-61pD4RPp1gNQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-10-06  7:12                                                   ` Hans de Goede
2014-10-05 15:17                                           ` Chen-Yu Tsai
     [not found]                                             ` <CAGb2v67SYW0mS1tLmcNBnNRugwiGEX3ZrDwQMx4B_dUB4-PPuA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-10-05 15:29                                               ` jonsmirl-Re5JQEeQqe8AvxtiuMwx3w
     [not found]                                                 ` <CAKON4Oxi_2wVfjMhZKYDbbMXeGnKAyRZyH_SYhTjJCfJbDve6w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-10-05 15:36                                                   ` Chen-Yu Tsai
     [not found]                                                     ` <CAGb2v65yPKSxUrwKdkK_sEq_R4vaV60LCycEYJfUcYrmfMOqwg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-10-05 16:34                                                       ` jonsmirl-Re5JQEeQqe8AvxtiuMwx3w
2014-10-04  9:32               ` Hans de Goede

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='CAMuHMdVSyqJA6uTPiemco0guhG1MKgkCBV7Tik-Ndd_fs28=NQ@mail.gmail.com' \
    --to=geert-td1emuhucqxl1znqvxdv9g@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=jonsmirl-Re5JQEeQqe8AvxtiuMwx3w@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 \
    --cc=tomi.valkeinen-l0cyMroinI0@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).