public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: Sharing header files -- arch/arm/mach-generic  ?
Date: Mon, 23 Apr 2012 20:52:14 +0100	[thread overview]
Message-ID: <20120423195214.GA24277@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <20120423194042.GA5734@elf.ucw.cz>

On Mon, Apr 23, 2012 at 09:40:42PM +0200, Pavel Machek wrote:
> I have new architecture I'd like to merge into the mainline. It has
> some code very similar to existing plaforms (for example
> real differences to mach-realview/platsmp.c are two lines.)

I suspect there's more differences than just that, because 17 lines
in that file are very specific to realview.  I doubt that you even
need a scu_base_addr() function as you probably know where the SCU
is located.

So, I bet the reason your example is just two lines different from
mach-realview/platsmp.c is because someone copied and modified the
file rather than thinking about what's really required.

> Should mach-generic/platsmp.c be created, so code can be better
> shared? Or are the code pieces small enough that this duplication can
> be ignored?

It should be ignored.

> headsmp.S is another candidate for sharing. AFAICT we have 4 times
> identical code in the tree already:
> 
> ./mach-exynos/headsmp.S:   ldmia	r4, {r5, r6}
> ./plat-versatile/headsmp.S:		ldmia	 r4, {r5, r6}
> ./mach-ux500/headsmp.S:			ldmia	 r4, {r5, r6}
> ./mach-msm/headsmp.S:			ldmia	 r4, {r5, r6}

Again, because of standard 'lets copy and modify' behaviour.  I'd
really like to drop the holding pen from versatile stuff - it's not
really required, as we can wake each CPU individually.  The only
reason it hasn't happened is because the holding pen stuff is also
used for holding CPUs in the unplugged state, as realview and versatile
express have no way to power manage or reset individual CPUs.

Most normal platforms (iow, those fabricated on real SoCs rather than
test-chips) have ways to power off the unplugged CPU, and don't need
this holding pen.  Or they only have one additional CPU, and so don't
even need any holding pen.

Unfortunately, I don't have the time to hit people over the head to
get them to fix their implementations here, so lots of copy-n-modify
for the SMP bringup from Realview has happened over the years.  It's
little surprise though that OMAP (where I've been quite involved with)
does not suffer from this...

Basically, everything except plat-versatile probably shouldn't be using
this holding pen stuff.

  reply	other threads:[~2012-04-23 19:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-23 19:40 Sharing header files -- arch/arm/mach-generic ? Pavel Machek
2012-04-23 19:52 ` Russell King - ARM Linux [this message]
2012-04-23 20:15 ` Arnd Bergmann

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=20120423195214.GA24277@n2100.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --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