All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Turquette <mturquette@linaro.org>
To: linux-arm-kernel@lists.infradead.org
Subject: Re: [linux-sunxi] Re: [PATCH v3] dt-bindings: Add a clocks property to the simple-framebuffer bindin
Date: Sat, 04 Oct 2014 20:38:37 +0000	[thread overview]
Message-ID: <20141004203837.4379.55504@quantum> (raw)
In-Reply-To: <CAKON4OwZahPqPPqorFvgK+YNeYfqH87FTuX=umhZ42uGR32MMA@mail.gmail.com>

Quoting jonsmirl@gmail.com (2014-10-03 14:50:24)
> On Fri, Oct 3, 2014 at 5:26 PM, Geert Uytterhoeven <geert@linux-m68k.org> wrote:
> > On Fri, Oct 3, 2014 at 10:55 PM, jonsmirl@gmail.com <jonsmirl@gmail.com> wrote:
> >> On Thu, Oct 2, 2014 at 9:46 AM, Geert Uytterhoeven <geert@linux-m68k.org> wrote:
> >>> On Thu, Oct 2, 2014 at 3:34 PM, jonsmirl@gmail.com <jonsmirl@gmail.com> 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.
> 
> Could we start all of the regulators and clocks off with a reference
> count of one, but not do anything to change their state? Then this
> ioctl() would decrement that extra reference. Removing the extra
> reference would then disable everything that isn't claimed.

No. That is too ugly.

Regards,
Mike

> 
> 
> >
> > Gr{oetje,eeting}s,
> >
> >                         Geert
> >
> > --
> > Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.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
> 
> 
> 
> -- 
> Jon Smirl
> jonsmirl@gmail.com

WARNING: multiple messages have this Message-ID (diff)
From: mturquette@linaro.org (Mike Turquette)
To: linux-arm-kernel@lists.infradead.org
Subject: [linux-sunxi] Re: [PATCH v3] dt-bindings: Add a clocks property to the simple-framebuffer binding
Date: Sat, 04 Oct 2014 13:38:37 -0700	[thread overview]
Message-ID: <20141004203837.4379.55504@quantum> (raw)
In-Reply-To: <CAKON4OwZahPqPPqorFvgK+YNeYfqH87FTuX=umhZ42uGR32MMA@mail.gmail.com>

Quoting jonsmirl at gmail.com (2014-10-03 14:50:24)
> On Fri, Oct 3, 2014 at 5:26 PM, Geert Uytterhoeven <geert@linux-m68k.org> wrote:
> > On Fri, Oct 3, 2014 at 10:55 PM, jonsmirl at gmail.com <jonsmirl@gmail.com> wrote:
> >> On Thu, Oct 2, 2014 at 9:46 AM, Geert Uytterhoeven <geert@linux-m68k.org> wrote:
> >>> On Thu, Oct 2, 2014 at 3:34 PM, jonsmirl at gmail.com <jonsmirl@gmail.com> 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.
> 
> Could we start all of the regulators and clocks off with a reference
> count of one, but not do anything to change their state? Then this
> ioctl() would decrement that extra reference. Removing the extra
> reference would then disable everything that isn't claimed.

No. That is too ugly.

Regards,
Mike

> 
> 
> >
> > Gr{oetje,eeting}s,
> >
> >                         Geert
> >
> > --
> > Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at linux-m68k.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
> 
> 
> 
> -- 
> Jon Smirl
> jonsmirl at gmail.com

WARNING: multiple messages have this Message-ID (diff)
From: Mike Turquette <mturquette-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
To: "jonsmirl-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org"
	<jonsmirl-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Geert Uytterhoeven
	<geert-Td1EMuHUCqxL1ZNQvxDV9g@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>,
	"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: Sat, 04 Oct 2014 13:38:37 -0700	[thread overview]
Message-ID: <20141004203837.4379.55504@quantum> (raw)
In-Reply-To: <CAKON4OwZahPqPPqorFvgK+YNeYfqH87FTuX=umhZ42uGR32MMA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

Quoting jonsmirl-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org (2014-10-03 14:50:24)
> On Fri, Oct 3, 2014 at 5:26 PM, Geert Uytterhoeven <geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org> wrote:
> > 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.
> 
> Could we start all of the regulators and clocks off with a reference
> count of one, but not do anything to change their state? Then this
> ioctl() would decrement that extra reference. Removing the extra
> reference would then disable everything that isn't claimed.

No. That is too ugly.

Regards,
Mike

> 
> 
> >
> > 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
> 
> 
> 
> -- 
> Jon Smirl
> jonsmirl-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

  reply	other threads:[~2014-10-04 20:38 UTC|newest]

Thread overview: 78+ 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
2014-10-03 14:05 ` Hans de Goede
2014-10-03 14:05 ` Hans de Goede
2014-10-03 15:57 ` Rob Herring
2014-10-03 15:57   ` Rob Herring
2014-10-03 15:57   ` Rob Herring
2014-10-03 16:04   ` Geert Uytterhoeven
2014-10-03 16:04     ` Geert Uytterhoeven
2014-10-03 16:04     ` Geert Uytterhoeven
2014-10-03 16:19     ` Rob Herring
2014-10-03 16:19       ` Rob Herring
2014-10-03 16:19       ` Rob Herring
2014-10-03 17:41       ` Hans de Goede
2014-10-03 17:41         ` Hans de Goede
2014-10-03 17:41         ` Hans de Goede
2014-10-03 17:34   ` [linux-sunxi] Re: [PATCH v3] dt-bindings: Add a clocks property to the simple-framebuffer bindin Hans de Goede
2014-10-03 17:34     ` Re: [PATCH v3] dt-bindings: Add a clocks property to the simple-framebuffer binding Hans de Goede
2014-10-03 17:34     ` [linux-sunxi] " Hans de Goede
2014-10-03 20:08     ` [linux-sunxi] Re: [PATCH v3] dt-bindings: Add a clocks property to the simple-framebuffer bindin Rob Herring
2014-10-03 20:08       ` Re: [PATCH v3] dt-bindings: Add a clocks property to the simple-framebuffer binding Rob Herring
2014-10-03 20:08       ` [linux-sunxi] " Rob Herring
2014-10-03 20:55       ` [linux-sunxi] Re: [PATCH v3] dt-bindings: Add a clocks property to the simple-framebuffer bindin jonsmirl
2014-10-03 20:55         ` Re: [PATCH v3] dt-bindings: Add a clocks property to the simple-framebuffer binding jonsmirl-Re5JQEeQqe8AvxtiuMwx3w
2014-10-03 20:55         ` [linux-sunxi] " jonsmirl at gmail.com
2014-10-03 21:26         ` [linux-sunxi] Re: [PATCH v3] dt-bindings: Add a clocks property to the simple-framebuffer bindin Geert Uytterhoeven
2014-10-03 21:26           ` Re: [PATCH v3] dt-bindings: Add a clocks property to the simple-framebuffer binding Geert Uytterhoeven
2014-10-03 21:26           ` [linux-sunxi] " Geert Uytterhoeven
2014-10-03 21:50           ` [linux-sunxi] Re: [PATCH v3] dt-bindings: Add a clocks property to the simple-framebuffer bindin jonsmirl
2014-10-03 21:50             ` Re: [PATCH v3] dt-bindings: Add a clocks property to the simple-framebuffer binding jonsmirl-Re5JQEeQqe8AvxtiuMwx3w
2014-10-03 21:50             ` [linux-sunxi] " jonsmirl at gmail.com
2014-10-04 20:38             ` Mike Turquette [this message]
2014-10-04 20:38               ` Mike Turquette
2014-10-04 20:38               ` [linux-sunxi] " Mike Turquette
2014-10-03 22:56       ` [linux-sunxi] Re: [PATCH v3] dt-bindings: Add a clocks property to the simple-framebuffer bindin jonsmirl
2014-10-03 22:56         ` Re: [PATCH v3] dt-bindings: Add a clocks property to the simple-framebuffer binding jonsmirl-Re5JQEeQqe8AvxtiuMwx3w
2014-10-03 22:56         ` [linux-sunxi] " jonsmirl at gmail.com
2014-10-04  9:50         ` [linux-sunxi] Re: [PATCH v3] dt-bindings: Add a clocks property to the simple-framebuffer bindin Hans de Goede
2014-10-04  9:50           ` Re: [PATCH v3] dt-bindings: Add a clocks property to the simple-framebuffer binding Hans de Goede
2014-10-04  9:50           ` [linux-sunxi] " Hans de Goede
2014-10-04 12:38           ` [linux-sunxi] Re: [PATCH v3] dt-bindings: Add a clocks property to the simple-framebuffer bindin jonsmirl
2014-10-04 12:38             ` [linux-sunxi] Re: [PATCH v3] dt-bindings: Add a clocks property to the simple-framebuffer binding jonsmirl-Re5JQEeQqe8AvxtiuMwx3w
2014-10-04 12:38             ` jonsmirl at gmail.com
2014-10-05  9:03             ` [linux-sunxi] Re: [PATCH v3] dt-bindings: Add a clocks property to the simple-framebuffer bindin Hans de Goede
2014-10-05  9:03               ` Re: [PATCH v3] dt-bindings: Add a clocks property to the simple-framebuffer binding Hans de Goede
2014-10-05  9:03               ` [linux-sunxi] " Hans de Goede
2014-10-05 12:52               ` [linux-sunxi] Re: [PATCH v3] dt-bindings: Add a clocks property to the simple-framebuffer bindin jonsmirl
2014-10-05 12:52                 ` Re: [PATCH v3] dt-bindings: Add a clocks property to the simple-framebuffer binding jonsmirl-Re5JQEeQqe8AvxtiuMwx3w
2014-10-05 12:52                 ` [linux-sunxi] " jonsmirl at gmail.com
2014-10-05 14:27                 ` [linux-sunxi] Re: [PATCH v3] dt-bindings: Add a clocks property to the simple-framebuffer bindin Hans de Goede
2014-10-05 14:27                   ` Re: [PATCH v3] dt-bindings: Add a clocks property to the simple-framebuffer binding Hans de Goede
2014-10-05 14:27                   ` [linux-sunxi] " Hans de Goede
2014-10-05 15:07                   ` [linux-sunxi] Re: [PATCH v3] dt-bindings: Add a clocks property to the simple-framebuffer bindin jonsmirl
2014-10-05 15:07                     ` Re: [PATCH v3] dt-bindings: Add a clocks property to the simple-framebuffer binding jonsmirl-Re5JQEeQqe8AvxtiuMwx3w
2014-10-05 15:07                     ` [linux-sunxi] " jonsmirl at gmail.com
2014-10-05 15:16                     ` [linux-sunxi] Re: [PATCH v3] dt-bindings: Add a clocks property to the simple-framebuffer bindin Hans de Goede
2014-10-05 15:16                       ` Re: [PATCH v3] dt-bindings: Add a clocks property to the simple-framebuffer binding Hans de Goede
2014-10-05 15:16                       ` [linux-sunxi] " Hans de Goede
2014-10-05 15:17                       ` [linux-sunxi] Re: [PATCH v3] dt-bindings: Add a clocks property to the simple-framebuffer bindin jonsmirl
2014-10-05 15:17                         ` Re: [PATCH v3] dt-bindings: Add a clocks property to the simple-framebuffer binding jonsmirl-Re5JQEeQqe8AvxtiuMwx3w
2014-10-05 15:17                         ` [linux-sunxi] " jonsmirl at gmail.com
2014-10-06  7:12                         ` [linux-sunxi] Re: [PATCH v3] dt-bindings: Add a clocks property to the simple-framebuffer bindin Hans de Goede
2014-10-06  7:12                           ` Re: [PATCH v3] dt-bindings: Add a clocks property to the simple-framebuffer binding Hans de Goede
2014-10-06  7:12                           ` [linux-sunxi] " Hans de Goede
2014-10-05 15:17                     ` [linux-sunxi] Re: [PATCH v3] dt-bindings: Add a clocks property to the simple-framebuffer bindin Chen-Yu Tsai
2014-10-05 15:17                       ` Re: [PATCH v3] dt-bindings: Add a clocks property to the simple-framebuffer binding Chen-Yu Tsai
2014-10-05 15:17                       ` [linux-sunxi] " Chen-Yu Tsai
2014-10-05 15:29                       ` [linux-sunxi] Re: [PATCH v3] dt-bindings: Add a clocks property to the simple-framebuffer bindin jonsmirl
2014-10-05 15:29                         ` Re: [PATCH v3] dt-bindings: Add a clocks property to the simple-framebuffer binding jonsmirl-Re5JQEeQqe8AvxtiuMwx3w
2014-10-05 15:29                         ` [linux-sunxi] " jonsmirl at gmail.com
2014-10-05 15:36                         ` [linux-sunxi] Re: [PATCH v3] dt-bindings: Add a clocks property to the simple-framebuffer bindin Chen-Yu Tsai
2014-10-05 15:36                           ` Re: [PATCH v3] dt-bindings: Add a clocks property to the simple-framebuffer binding Chen-Yu Tsai
2014-10-05 15:36                           ` [linux-sunxi] " Chen-Yu Tsai
2014-10-05 16:34                           ` [linux-sunxi] Re: [PATCH v3] dt-bindings: Add a clocks property to the simple-framebuffer bindin jonsmirl
2014-10-05 16:34                             ` Re: [PATCH v3] dt-bindings: Add a clocks property to the simple-framebuffer binding jonsmirl-Re5JQEeQqe8AvxtiuMwx3w
2014-10-05 16:34                             ` [linux-sunxi] " jonsmirl at gmail.com
2014-10-04  9:32       ` [linux-sunxi] Re: [PATCH v3] dt-bindings: Add a clocks property to the simple-framebuffer bindin Hans de Goede
2014-10-04  9:32         ` Re: [PATCH v3] dt-bindings: Add a clocks property to the simple-framebuffer binding Hans de Goede
2014-10-04  9:32         ` [linux-sunxi] " 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=20141004203837.4379.55504@quantum \
    --to=mturquette@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.