public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb•de>
To: linuxppc-dev@ozlabs•org
Cc: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom•com>, olof@lixom•net
Subject: Re: [PATCH v2 2/2] [POWERPC] Use new machine_xxx_initcall hooks in platform code
Date: Tue, 4 Dec 2007 20:35:59 +0100	[thread overview]
Message-ID: <200712042036.00785.arnd@arndb.de> (raw)
In-Reply-To: <fa686aa40712040621r3103bae9hd900c23d48273360@mail.gmail.com>

On Tuesday 04 December 2007, Grant Likely wrote:
> On 12/4/07, Grant Likely <grant.likely@secretlab•ca> wrote:
> > On 12/4/07, Geert Uytterhoeven <Geert.Uytterhoeven@sonycom•com> wrote:
> > > You seem to have missed the PS3 *_initcall()s.
> > > Probably because they test for firmware_has_feature(FW_FEATURE_PS3_LV1) instead
> > > of machine_is(ps3).
> >
> > That's exactly why; I didn't know if 'machine_is(ps3)' was a suitable
> > substitute so I left it alone.
> 
> On that topic; I left some pseries and iseries stuff alone also for
> the same reason.

Yes, and in many cases it's the right answer to base a decision on a specific
feature rather than a platform name, for two reasons:

1. If another platform gets added that uses the same firmware feature, it
will automatically do the right thing.

2. The call to firmware_has_feature() turns into a compile-time check in
many cases, so if the kernel does not contain support for any firmware
with the given feature, all the code referenced it can get optimized
away by the compiler.

If we have many cases where an initcall is done based on a specific fw-feature
or cpu-feature, we might want to add a similar initcall mechanism for those
along the lines of machine_xxx_initcall, but of course we should be sure
not to overengineer things here.

	Arnd <><

  reply	other threads:[~2007-12-04 19:36 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-02  6:10 [PATCH v2 1/2] [POWERPC] Add machine initcall macros Grant Likely
2007-12-02  6:10 ` [PATCH v2 2/2] [POWERPC] Use new machine_xxx_initcall hooks in platform code Grant Likely
2007-12-02  6:17   ` Grant Likely
2007-12-02 19:15   ` Olof Johansson
2007-12-04 12:23   ` Geert Uytterhoeven
2007-12-04 13:36     ` Grant Likely
2007-12-04 13:43       ` Geert Uytterhoeven
2007-12-04 20:59         ` Geoff Levand
2007-12-04 14:21       ` Grant Likely
2007-12-04 19:35         ` Arnd Bergmann [this message]
2007-12-04 20:31           ` Benjamin Herrenschmidt
2007-12-04 21:52             ` Arnd Bergmann
2007-12-04 22:05             ` 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=200712042036.00785.arnd@arndb.de \
    --to=arnd@arndb$(echo .)de \
    --cc=Geert.Uytterhoeven@sonycom$(echo .)com \
    --cc=linuxppc-dev@ozlabs$(echo .)org \
    --cc=olof@lixom$(echo .)net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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