linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thierry Reding <thierry.reding@gmail.com>
To: linux-arm-kernel@lists.infradead.org
Subject: Re: [linux-sunxi] Re: [PATCH 4/4] simplefb: add clock handling code
Date: Wed, 27 Aug 2014 06:54:41 +0000	[thread overview]
Message-ID: <20140827065440.GG15640@ulmo> (raw)
In-Reply-To: <20140826210248.GO15297@lukather>

[-- Attachment #1: Type: text/plain, Size: 6360 bytes --]

On Tue, Aug 26, 2014 at 11:02:48PM +0200, Maxime Ripard wrote:
> On Tue, Aug 26, 2014 at 04:35:51PM +0200, Thierry Reding wrote:
> > > > > Any decent enough SoC, with a decent support in the kernel will have
> > > > > clocks for this, and I really wonder how simplefb will behave once its
> > > > > clocks will be turned off...
> > > > 
> > > > There are other devices besides ARM SoCs that may want to use this
> > > > driver and that don't have clock support.
> > > 
> > > And in this case, with this patch, simplefb will not claim any clock,
> > > nor will fail probing.
> > > 
> > > > But you're missing my point. What I'm saying is that the simplefb driver
> > > > is meant to serve as a way to take over whatever framebuffer a firmware
> > > > set up. Therefore I think it makes the most sense to assume that nothing
> > > > needs to be controlled in any way since already been set up by firmware.
> > > > Eventually there should be a driver that takes over from simplefb that
> > > > knows how to properly handle the device's specifics, but that's not
> > > > simplefb.
> > > 
> > > I guess such a hand over if it were to happen in the kernel would
> > > involve the second driver claiming the resources before the first one
> > > release them. How is that different in this case?
> > 
> > It's different in that that driver will be hardware specific and know
> > exactly what clock and other resources are required. It will have a
> > device-specific binding.
> 
> Except that you made simplefb a generic driver. So we have two choices
> here: either we don't anything but the trivial case, and no one with a
> rather more advanced hardware will be able to use it, or we try to
> grab any resource that might be of use, which means clocks,
> regulators, reserved memory region, or whatever, so that we pretty
> much cover all cases. It really is as simple as that.

No, it should be even simpler. simplefb shouldn't have to know any of
this. It's just taking what firmware has set up and uses that. It's a
stop-gap solution to provide information on the display until a real
driver can be loaded and initializes the display hardware properly.

> > > > The goal of this patch series is to keep clocks from being turned off.
> > > > But that's not what it does. What it does is turn clocks on to prevent
> > > > them from being turned off. In my opinion that's a workaround for a
> > > > deficiency in the kernel (and the firmware/kernel interface) and I think
> > > > it should be fixed at the root. So a much better solution would be to
> > > > establish a way for firmware to communicate to the kernel that a given
> > > > resource has been enabled by firmware and shouldn't be disabled. Such a
> > > > solution can be implement for all types of resources and can be reused
> > > > by all drivers since they don't have to worry about these details.
> > > 
> > > Mike Turquette repeatedly said that he was against such a DT property:
> > > https://lkml.org/lkml/2014/5/12/693
> > 
> > Mike says in that email that he's opposing the addition of a property
> > for clocks that is the equivalent of regulator-always-on. That's not
> > what this is about. If at all it'd be a property to mark a clock that
> > should not be disabled by default because it's essential.
> 
> It's just semantic. How is "a clock that should not be disabled by
> default because it's essential" not a clock that stays always on?

Because a clock that should not be disabled by default can be turned off
when appropriate. A clock that is always on can't be turned off.

> Plus, you should read the mail further. It's clearly said that
> consumer drivers should call clk_prepare_enable themselves, and that
> the only exception to that is the case where we don't have such a
> driver (and only valid as a temporary exception, which I guess you'll
> soon turn into temporary-until-a-drm-kms-driver-is-merged).

Exactly. simplefb is only a temporary measure. It's not meant to be used
as a full-blown framebuffer driver. There are two use-cases where it is
an appropriate solution:

  1) As a stop-gap solution for when the platform doesn't support a full
     display driver yet. In that case you will want simplefb to stay
     around forever.

  2) To get early boot output before a full display driver can be loaded
     in which case simplefb should go away after the display driver has
     taken over.

In case of 2) the most straightforward solution is to not disable any
clocks until all drivers have had a chance to claim them. When the full
driver has been probed it should have claimed the clocks so they would
no longer get disabled.

For 1) I think it's fair to say that it's only a temporary solution to
get something on the screen. There won't be any kind of acceleration at
all, no power saving. Nothing but a dumb framebuffer. In that case it
should be a simple matter of keeping a select number of clocks always on
in the clock driver until support is more complete and it can be
properly handled. It's not like it's going to make a difference anyway
since simplefb won't ever disable them either.

> > Adding Mike on this subthread too.
> > 
> > Either way, Mark already suggested a different alternative in another
> > subthread, namely to add a new kind of checkpoint at which subsystems
> > can call a "disable unused" function that's called later than a late
> > initcall. This is not going to fix things for you immediately because
> > the clocks will still be switched off (only later) if you don't have
> > a real driver that's claiming the clocks.
> 
> Great, I'm glad we found a solution for a completely unrelated issue.

It's not at all unrelated. See above.

> > But you can work around that for now by making the relevant clocks
> > always on and remove that workaround once a real driver is loaded
> > that knows how to handle them properly.
> 
> So, let me get this straight. The clock provider driver should behave
> as a clock consumer because it knows that in some cases, it might not
> have any willingful enough consumer? Doesn't that even ring your
> this-is-a-clear-abstraction-violation-bell just a tiny bit?

No. The clock driver should simply not allow the clocks to be disabled
if it isn't safe to do so.

Thierry

[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]

  reply	other threads:[~2014-08-27  6:54 UTC|newest]

Thread overview: 269+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-13  7:17 simplefb: add clock handling Luc Verhaegen
2014-08-13  7:17 ` [PATCH 1/4] simplefb: formalize pseudo palette handling Luc Verhaegen
2014-08-13  7:25   ` David Herrmann
2014-08-13  8:46     ` Geert Uytterhoeven
2014-08-13  8:50       ` David Herrmann
2014-08-13 16:45   ` Stephen Warren
2014-08-13  7:17 ` [PATCH 2/4] simplefb: add goto error path to probe Luc Verhaegen
2014-08-13  7:27   ` David Herrmann
2014-08-14 10:29     ` Luc Verhaegen
2014-08-14 10:33       ` David Herrmann
2014-08-14 10:42         ` Luc Verhaegen
2014-08-13  7:17 ` [PATCH 3/4] simplefb: disable dt node upon remove Luc Verhaegen
2014-08-13  8:40   ` Grant Likely
2014-08-13  8:49     ` David Herrmann
2014-08-13  9:23       ` Grant Likely
2014-08-13  9:32         ` David Herrmann
2014-08-13  9:45         ` Luc Verhaegen
2014-08-13 10:19           ` [linux-sunxi] " Luc Verhaegen
2014-08-13 12:54             ` jonsmirl
2014-08-13 19:14               ` Grant Likely
2014-08-13 19:25                 ` Luc Verhaegen
2014-08-13 19:58                   ` Stephen Warren
2014-08-13 20:01                     ` Luc Verhaegen
2014-08-13 20:00                   ` Grant Likely
2014-08-13 20:19                     ` Luc Verhaegen
2014-08-13 20:41                 ` [linux-sunxi] " jonsmirl
2014-08-14 10:15                   ` Grant Likely
2014-08-14 12:07                     ` jonsmirl
2014-08-15  0:45                       ` Henrik Nordström
2014-08-15  1:27                         ` jonsmirl
2014-08-15  6:43                           ` Maxime Ripard
2014-08-15 12:34                             ` jonsmirl
2014-08-13 16:44       ` Stephen Warren
2014-08-13 17:26         ` [linux-sunxi] " jonsmirl
2014-08-13 17:34           ` Stephen Warren
2014-08-13 17:44             ` jonsmirl
2014-08-13  7:17 ` [PATCH 4/4] simplefb: add clock handling code Luc Verhaegen
2014-08-13 16:38   ` Stephen Warren
2014-08-13 16:47     ` Luc Verhaegen
2014-08-13 17:01     ` Maxime Ripard
2014-08-14  9:37       ` [linux-sunxi] " Hans de Goede
2014-08-14 10:31         ` [linux-sunxi] " Koen Kooi
2014-08-14 10:57           ` Luc Verhaegen
2014-08-14 11:18             ` Hans de Goede
2014-08-14 11:18           ` Hans de Goede
2014-08-25 12:12       ` Thierry Reding
2014-08-25 12:44         ` Maxime Ripard
2014-08-25 13:39           ` Thierry Reding
2014-08-25 13:47             ` [linux-sunxi] " Hans de Goede
2014-08-25 14:16               ` Thierry Reding
2014-08-25 14:23                 ` jonsmirl
2014-08-25 14:27                   ` Hans de Goede
2014-08-25 15:12                     ` Thierry Reding
2014-08-25 15:18                       ` Luc Verhaegen
2014-08-26  8:40                         ` Thierry Reding
2014-08-26 13:22                           ` Maxime Ripard
2014-08-26 13:43                             ` Thierry Reding
2014-08-25 15:49                       ` jonsmirl
2014-08-26  9:02                         ` Hans de Goede
2014-08-25 15:01                   ` Thierry Reding
2014-08-25 14:23                 ` Hans de Goede
2014-08-25 14:53                   ` Thierry Reding
2014-08-25 15:07                     ` Maxime Ripard
2014-08-26  8:26                       ` Thierry Reding
2014-08-26  9:00                         ` Mark Brown
2014-08-26  9:18                           ` Thierry Reding
2014-08-26 10:06                             ` Mark Brown
2014-08-26 10:55                               ` Thierry Reding
2014-08-26 11:33                                 ` Mark Brown
2014-08-26 18:40                                 ` Henrik Nordström
2014-08-27  7:40                                   ` Mark Brown
2014-08-27  8:22                                     ` Maxime Ripard
2014-08-27  8:37                                       ` Geert Uytterhoeven
2014-08-27  8:55                                         ` Maxime Ripard
2014-08-27  9:05                                           ` Geert Uytterhoeven
2014-08-27 10:32                                             ` Maxime Ripard
2014-08-27 10:07                                           ` Thierry Reding
2014-08-27 10:26                                           ` Henrik Nordström
2014-08-27 12:45                                         ` Julian Calaby
2014-08-27 13:24                                           ` Maxime Ripard
2014-08-25 15:08                     ` jonsmirl
2014-08-25 14:58                 ` Maxime Ripard
2014-08-25 15:05                   ` Thierry Reding
2014-08-25 15:09                     ` Luc Verhaegen
2014-08-26  7:52                       ` Thierry Reding
2014-08-26 12:02                         ` Luc Verhaegen
2014-08-26 12:21                           ` Thierry Reding
2014-08-26 12:33                             ` Luc Verhaegen
2014-08-26 14:41                               ` Thierry Reding
2014-08-25 15:22                     ` Maxime Ripard
2014-08-26  8:04                       ` Thierry Reding
2014-08-26  8:45                         ` Michal Suchanek
2014-08-26 13:53                         ` Maxime Ripard
2014-08-26 14:35                           ` Thierry Reding
2014-08-26 19:59                             ` Hans de Goede
2014-08-27  9:31                               ` Thierry Reding
2014-08-27 10:35                                 ` Hans de Goede
2014-08-27 12:44                                   ` jonsmirl
2014-08-27 12:50                                     ` Hans de Goede
2014-08-27 12:56                                       ` jonsmirl
2014-08-27 13:05                                       ` Thierry Reding
2014-08-27 12:56                                   ` Thierry Reding
2014-08-27 13:44                                     ` Hans de Goede
2014-08-27 14:16                                       ` Thierry Reding
2014-08-28 12:15                                         ` Hans de Goede
2014-08-28 13:22                                           ` jonsmirl
2014-08-28 14:20                                             ` Geert Uytterhoeven
2014-08-28 14:33                                               ` jonsmirl
2014-08-28 14:37                                                 ` Geert Uytterhoeven
2014-08-28 15:11                                                   ` jonsmirl
2014-08-28 16:25                                                 ` Michal Suchanek
2014-08-28 16:34                                                   ` jonsmirl
2014-08-28 16:50                                                     ` Luc Verhaegen
2014-08-28 20:31                                                     ` Michal Suchanek
2014-08-29  7:16                                                     ` Thierry Reding
2014-08-29  7:01                                           ` Thierry Reding
2014-08-29  7:23                                             ` Hans de Goede
2014-08-29  8:12                                               ` Thierry Reding
2014-08-29 14:12                                             ` Maxime Ripard
2014-08-29 14:38                                               ` Thierry Reding
2014-08-29 15:25                                                 ` Michal Suchanek
2014-09-02  9:25                                                 ` Maxime Ripard
2014-09-27 23:56                                                   ` Mike Turquette
2014-09-29  8:06                                                     ` Thierry Reding
2014-09-29  8:27                                                       ` Geert Uytterhoeven
2014-09-29  8:54                                                         ` Thierry Reding
2014-09-29  9:10                                                           ` Geert Uytterhoeven
2014-09-29  9:29                                                             ` Thierry Reding
2014-09-29  9:44                                                           ` Michal Suchanek
2014-09-29 10:40                                                             ` Thierry Reding
2014-09-29  9:23                                                       ` Maxime Ripard
2014-09-29 10:18                                                         ` Thierry Reding
2014-09-29 10:35                                                           ` Geert Uytterhoeven
2014-09-29 10:44                                                             ` Thierry Reding
2014-09-29 11:32                                                               ` Geert Uytterhoeven
2014-09-29 14:00                                                                 ` Thierry Reding
2014-09-29 11:34                                                               ` Maxime Ripard
2014-09-29 13:54                                                                 ` Thierry Reding
2014-09-29 15:57                                                                   ` Maxime Ripard
2014-09-30  4:59                                                                     ` Thierry Reding
2014-09-30  7:46                                                                       ` Maxime Ripard
2014-09-30 11:43                                                                       ` Hans de Goede
2014-09-30 11:46                                                                         ` Thierry Reding
2014-09-30 21:37                                                                   ` Mike Turquette
2014-10-01  7:30                                                                     ` Thierry Reding
2014-10-01 18:17                                                                       ` Mike Turquette
2014-10-02  8:12                                                                         ` Thierry Reding
2014-09-29 11:00                                                           ` Julian Calaby
2014-09-29 13:21                                                             ` Thierry Reding
2014-09-29 14:46                                                               ` Julian Calaby
2014-09-29 15:19                                                                 ` Thierry Reding
2014-09-29 15:42                                                                   ` Michal Suchanek
2014-09-30  0:10                                                                   ` Julian Calaby
2014-09-29 11:46                                                           ` Maxime Ripard
2014-09-29 13:47                                                             ` Thierry Reding
2014-09-29 15:04                                                               ` Michal Suchanek
2014-09-29 15:49                                                                 ` Thierry Reding
2014-09-29 16:39                                                                   ` Michal Suchanek
2014-09-29 15:55                                                               ` Mark Brown
2014-09-30  5:09                                                                 ` Thierry Reding
2014-09-30 17:39                                                                   ` Mark Brown
2014-10-01  7:41                                                                     ` Thierry Reding
2014-10-01 11:10                                                                       ` Javier Martinez Canillas
2014-10-01 12:32                                                                         ` Mark Brown
2014-10-01 12:48                                                                           ` Thierry Reding
2014-10-01 17:05                                                                             ` Mark Brown
2014-10-01 17:26                                                                               ` Hans de Goede
2014-10-01 17:54                                                                                 ` jonsmirl
2014-10-01 18:12                                                                                   ` Stephen Warren
2014-10-01 18:16                                                                                     ` Luc Verhaegen
2014-10-02  6:42                                                                                     ` Hans de Goede
2014-10-02 12:22                                                                                       ` jonsmirl
2014-10-02 12:39                                                                                         ` Hans de Goede
2014-10-02 12:56                                                                                           ` jonsmirl
2014-10-02 13:14                                                                                             ` Hans de Goede
2014-10-02 13:27                                                                                               ` jonsmirl
2014-10-02 13:33                                                                                                 ` Hans de Goede
2014-10-02 13:40                                                                                                   ` jonsmirl
2014-10-02 14:08                                                                                                     ` Hans de Goede
2014-10-02 14:16                                                                                                       ` jonsmirl
2014-10-02 14:21                                                                                                         ` Hans de Goede
2014-10-02 14:41                                                                                                           ` jonsmirl
2014-10-02 14:50                                                                                                             ` Hans de Goede
2014-10-02 15:14                                                                                                               ` jonsmirl
2014-10-02 15:30                                                                                                                 ` jonsmirl
2014-10-02 15:38                                                                                                                   ` Hans de Goede
2014-10-02 15:36                                                                                                                 ` Michal Suchanek
2014-10-02 23:31                                                                                                                 ` Julian Calaby
2014-10-03  7:56                                                                                                                   ` Hans de Goede
2014-11-11 16:15                                                                                                                     ` Grant Likely
2014-10-02 14:18                                                                                                       ` Maxime Ripard
2014-10-02 14:23                                                                                                         ` Hans de Goede
2014-10-02 14:17                                                                                                     ` Michal Suchanek
2014-10-02 13:59                                                                                                 ` Michal Suchanek
2014-10-02 13:23                                                                                             ` Michal Suchanek
2014-10-02 13:34                                                                                               ` jonsmirl
2014-10-02 13:40                                                                                                 ` Hans de Goede
2014-10-02 13:44                                                                                                   ` jonsmirl
2014-10-02 13:46                                                                                                 ` Geert Uytterhoeven
2014-10-02 13:49                                                                                                   ` jonsmirl
2014-10-02 19:15                                                                                         ` Geert Uytterhoeven
2014-10-02 15:49                                                                                       ` Stephen Warren
2014-10-03 11:16                                                                                         ` Hans de Goede
2014-10-03 11:45                                                                                           ` Tomi Valkeinen
2014-10-03 11:53                                                                                             ` Hans de Goede
2014-10-01 11:31                                                                       ` Mark Brown
2014-09-29 16:28                                                               ` Maxime Ripard
2014-09-29 16:58                                                                 ` Luc Verhaegen
2014-09-29 22:02                                                                   ` Luc Verhaegen
2014-09-30  5:39                                                                     ` Thierry Reding
2014-09-30  8:03                                                                       ` Maxime Ripard
2014-09-30 11:02                                                                         ` Thierry Reding
2014-09-30 12:41                                                                     ` Mark Brown
2014-09-30 12:50                                                                       ` jonsmirl
2014-09-30  5:21                                                                 ` Thierry Reding
2014-09-30  7:52                                                                   ` Maxime Ripard
2014-09-30  8:54                                                                     ` Thierry Reding
2014-09-30  9:38                                                                       ` Michal Suchanek
2014-09-30 11:31                                                                         ` Thierry Reding
2014-09-30 14:12                                                                           ` Michal Suchanek
2014-09-30 12:29                                                                       ` Maxime Ripard
2014-09-29 16:11                                                       ` Mark Brown
2014-09-30  6:03                                                         ` Thierry Reding
2014-09-30 18:00                                                           ` Mark Brown
2014-10-01  8:14                                                             ` Thierry Reding
2014-10-01 12:20                                                               ` Mark Brown
2014-10-01 12:48                                                                 ` Thierry Reding
2014-10-01 13:01                                                                   ` jonsmirl
2014-10-01 13:17                                                                     ` Michal Suchanek
2014-10-01 13:40                                                                       ` jonsmirl
2014-10-01 17:17                                                                   ` Mark Brown
2014-10-01 18:43                                                                     ` Geert Uytterhoeven
2014-10-02  8:30                                                                       ` Thierry Reding
2014-10-02  8:27                                                                     ` Thierry Reding
2014-10-01  8:17                                                             ` Thierry Reding
2014-09-29 17:51                                                       ` jonsmirl
2014-09-29 18:06                                                         ` Michal Suchanek
2014-08-27 13:56                                     ` Maxime Ripard
2014-08-27 14:30                                       ` Thierry Reding
2014-08-27 13:43                                 ` Maxime Ripard
2014-08-26 21:02                             ` Maxime Ripard
2014-08-27  6:54                               ` Thierry Reding [this message]
2014-08-27  8:00                                 ` Hans de Goede
2014-08-27  9:37                                   ` Thierry Reding
2014-08-27  8:45                                 ` Maxime Ripard
2014-08-27  9:52                                   ` Thierry Reding
2014-08-27 15:42                                     ` Maxime Ripard
2014-08-27 20:57                                       ` Michal Suchanek
2014-08-28 10:08                                         ` Thierry Reding
2014-08-29  5:13                                           ` Michal Suchanek
2014-08-29  6:19                                             ` Thierry Reding
2014-08-29  6:48                                               ` Michal Suchanek
2014-08-29  7:08                                                 ` Thierry Reding
2014-08-28 10:11                                       ` Thierry Reding
2014-08-28 10:32                                         ` Michal Suchanek
2014-08-28 20:46                                         ` Maxime Ripard
2014-08-29  6:29                                           ` Thierry Reding
2014-08-29 13:57                                             ` Maxime Ripard
2014-08-29 14:31                                               ` Thierry Reding
2014-08-27  8:17                           ` Henrik Nordström
2014-08-25 15:25               ` Andreas Färber
2014-08-26 13:19                 ` Maxime Ripard
2014-08-13  7:54 ` simplefb: add clock handling David Herrmann
2014-08-13  8:11   ` Luc Verhaegen
2014-08-13  8:21   ` [linux-sunxi] " Koen Kooi
2014-08-13  8:36     ` Hans de Goede
2014-08-13 10:16       ` Koen Kooi
2014-08-13 10:24         ` David Herrmann
2014-08-13 11:36         ` 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=20140827065440.GG15640@ulmo \
    --to=thierry.reding@gmail.com \
    --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 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).