linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: benh@kernel.crashing.org (Benjamin Herrenschmidt)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC,PATCH 1/7] arm: add a common struct clk
Date: Sat, 09 Jan 2010 06:45:54 +1100	[thread overview]
Message-ID: <1262979954.585.52.camel@pasglop> (raw)
In-Reply-To: <20100108125934.GA27567@n2100.arm.linux.org.uk>


> Taking the two machine types that are most likely to want to use this:
> 
> On PXA, there are 67 struct clk's, each of which has a single pointer
> to an operations structure.  Each operations structure is three pointers
> and there are 11 such structures.  That's 67 * 4 + 11 * 12 = 400 bytes.
> PXA is simple enough that these operations structures can be swallowed
> up into this struct clk.  So, switching PXA to this will mean 67 * 32 =
> 2144 bytes.  That's an increase in overhead of 5x.

Right. Half a page, big deal :-) Now, again, we aren't necessarily
talking about converting existing / old platforms. I believe the main
target here is things like netbooks etc... and the whole new batch of
ARM stuff coming up which has at least half a GB of RAM if not more.

Also a lot of that overhead can be alleviated by using a pointer to an
"ops" structure which can be static in most case. Jeremy, that might be
a better approach if the memory footprint is such a concern.

But again, maybe the PXA platform will not want to use that stuff... it
doesn't -have- to.

Among other things, the idea of having this more flexible infrastructure
and the device-tree is also to allow multiple platforms to be more
easily built as a single kernel, which is something I believe
distributions want to do as much as possible for the incoming batch of
ARM based netbooks, tablets, etc... 

> On OMAP, there are 16 clkops structures of 16 bytes each, and each
> struct clk has a pointer to this structure.  Due to the way OMAP works,
> these can't be directly called from the proposed generic version
> because of the additional clock domain/power domain code, so we can
> discount these.
> 
> There are two function pointers in the struct clk which would be
> identical to the versions proposed in this generic struct clk.
> There's a total of 219 clk structures in OMAP3.  So, 219 * (4 + 8)
> = 2628.  Switching OMAP means 219 * (4 + 32) = 7884, which is an
> increase in overhead of 3x.
> 
> This is the problem - you can have "generic" versions of stuff provided
> you're willing to put up with the additional overhead that comes with
> it.

Right. On the other hand, as you mentioned earlier, the above more
"efficient" way of doing it is also mostly unable to deal with non-SoC
clocks. You cannot for example have a set of generic drivers for a bunch
of existing PLL chips etc...

It may not be a huge deal but I know from some discussions I had in the
past that there -is- interest in that.

So yes, you may use up a bit more memory (and again, I'm curious to see
how much really with an ops pointer) and or a bit more overhead going
through said function pointers, but there are significant benefits in
term of code re-usability between platforms, in some cases
simplification, etc... in addition to the device-tree stuff you may want
to use on top of that which brings its own benefits.

Cheers,
Ben.

  reply	other threads:[~2010-01-08 19:45 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-07 23:44 [RFC,PATCH 1/7] arm: add a common struct clk Jeremy Kerr
2010-01-07 23:44 ` [RFC,PATCH 4/7] arm/versatile: remove oscoff from clk_versatile Jeremy Kerr
2010-01-07 23:44 ` [RFC,PATCH 3/7] arm/versatile: use generic struct clk Jeremy Kerr
2010-01-07 23:44 ` [RFC, PATCH 6/7] arm/icst307: use common struct clk, unify realview and versatile clocks Jeremy Kerr
2010-01-08  1:11   ` H Hartley Sweeten
2010-01-08  1:35     ` Jeremy Kerr
2010-01-07 23:44 ` [RFC,PATCH 5/7] arm/realview: use generic struct clk Jeremy Kerr
2010-01-07 23:44 ` [RFC,PATCH 2/7] arm: generic support for fixed-rate clocks Jeremy Kerr
2010-01-07 23:44 ` [RFC,PATCH 7/7] arm/icst307: remove icst307_ps_to_vco Jeremy Kerr
2010-01-08  0:30 ` [RFC,PATCH 1/7] arm: add a common struct clk H Hartley Sweeten
2010-01-08  1:20   ` Jeremy Kerr
2010-01-08  3:26     ` Jeremy Kerr
2010-01-08  9:42       ` Russell King - ARM Linux
2010-01-08 10:01         ` Benjamin Herrenschmidt
2010-01-08 11:18           ` Russell King - ARM Linux
2010-01-08 11:45             ` Benjamin Herrenschmidt
2010-01-08 12:59               ` Russell King - ARM Linux
2010-01-08 19:45                 ` Benjamin Herrenschmidt [this message]
2010-01-11  3:37         ` Jeremy Kerr
2010-01-12  8:00           ` Francesco VIRLINZI
2010-01-12  8:50             ` Benjamin Herrenschmidt
2010-01-08 16:25       ` H Hartley Sweeten
2010-01-08 19:33         ` Benjamin Herrenschmidt
2010-01-08  1:17 ` Benjamin Herrenschmidt
2010-01-08  1:38   ` Jeremy Kerr
2010-01-11  5:38     ` Jeremy Kerr
2010-01-11 10:46       ` Mark Brown
2010-01-11 19:48         ` Benjamin Herrenschmidt

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=1262979954.585.52.camel@pasglop \
    --to=benh@kernel.crashing.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 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).