All of lore.kernel.org
 help / color / mirror / Atom feed
From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 02/17] ARM: at91: use machine specific hook for late init
Date: Mon, 30 Apr 2012 08:46:40 +0000	[thread overview]
Message-ID: <201204300846.41118.arnd@arndb.de> (raw)
In-Reply-To: <20120428065348.GC9924@S2101-09.ap.freescale.net>

On Saturday 28 April 2012, Shawn Guo wrote:
> On Sat, Apr 28, 2012 at 07:30:01AM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> > On 10:30 Sat 28 Apr     , Shawn Guo wrote:
> > > On Fri, Apr 27, 2012 at 04:26:01PM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> > > > we discuss with Arnd we came back with 2 ideas one is to use a machine
> > > > specific initcall or compatible specifc initcall
> > > 
> > > Do you mean an initcall with machine/compatible detection inside?  The
> > > whole point of the hooks in struct machine_desc  is to save the
> > > machine/compatible detection.  You already use .init_machine as
> > > an arch_initcall time hook, and what .init_late provides you is just
> > > a late_initcall time hook.  If you want to detect machine/compatible
> > > in your late_initcall rather than using this hook, you should not
> > > use .init_machine for the same reason.
> > on DT we just do this
> > 
> I'm talking about non-DT case.  Sadly, there are still so many non-DT
> board files in arch/arm/mach-at91.

It depends on whether we want to allow non-DT board files for multiplatform
kernels. We clearly can allow them, but I think we can spare some trouble
and also make the configuration simpler if we just disallow it, and
make only those platforms that are converted to both allow multiplat
and DT boot as sub-options under the top-level multiplatform kernel
option. If we do that, we can keep a lot of initcalls in the platform
code and just add an "if (!of_have_populated_dt())" in them or a check
for the respective device.

> > so the hook start to make not too much sense
> > at machine level
> > 
> > as this is for nearly all of them purely soc
> > 
> This reminds me an argument against soc_desc stuff.  With DT adopted,
> the struct machine_desc (hooks inside it) becomes purely soc specific,
> so why do we need soc_desc then?

Ah, good point. I was wondering what happened to that discussion.

On a related note, I have looked up what kinds of initcalls are in
the platform code:

$ git grep -h ^[a-z_]*_initcall arch/arm/ | cut -f 1 -d \( | sort | uniq -c | sort -n      1 subsys_initcall_sync
      2 postcore_initcall_sync
      5 console_initcall
      7 fs_initcall
      9 early_initcall
     14 __initcall
     34 device_initcall
     35 postcore_initcall
     43 core_initcall
     49 late_initcall
     87 subsys_initcall
    128 arch_initcall

I think that if we do the late_initcall mechanism that you proposed,
we will probaly need the same for subsyste_initcall, and although
we already have mach_desc->init_machine() at the arch_initcall
level, it seems that there are a lot of other users that don't
use it (for good or for not so good reasons, I have not checked)
and that would definitely benefit from the method that Jean-Christophe
posted. I think we will end up wanting both in any case.

	Arnd

  reply	other threads:[~2012-04-30  8:46 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-26 15:38 [PATCH 00/17] arch/arm/mach-* late_initcall cleanup Shawn Guo
2012-04-26 15:38 ` [PATCH 01/17] ARM: provide a late_initcall hook for platform initialization Shawn Guo
2012-05-02  2:16   ` Rob Lee
2012-04-26 15:38 ` [PATCH 02/17] ARM: at91: use machine specific hook for late init Shawn Guo
2012-04-26 15:29   ` Jean-Christophe PLAGNIOL-VILLARD
2012-04-27 14:07     ` Shawn Guo
2012-04-27 14:26       ` Jean-Christophe PLAGNIOL-VILLARD
2012-04-28  2:30         ` Shawn Guo
2012-04-28  5:30           ` Jean-Christophe PLAGNIOL-VILLARD
2012-04-28  6:53             ` Shawn Guo
2012-04-30  8:46               ` Arnd Bergmann [this message]
2012-05-02  2:51                 ` Jean-Christophe PLAGNIOL-VILLARD
2012-05-02  7:22                   ` Shawn Guo
2012-04-26 15:38 ` [PATCH 03/17] ARM: davinci: " Shawn Guo
2012-04-26 15:38 ` [PATCH 04/17] ARM: ep93xx: " Shawn Guo
2012-04-26 21:11   ` Ryan Mallon
2012-04-26 21:49     ` H Hartley Sweeten
2012-04-26 22:12       ` Russell King - ARM Linux
2012-04-26 22:27         ` H Hartley Sweeten
2012-04-26 22:41       ` Ryan Mallon
2012-04-27  8:41         ` Arnd Bergmann
2012-04-27 13:23         ` Shawn Guo
2012-04-26 22:42   ` H Hartley Sweeten
2012-04-27 13:08     ` Shawn Guo
2012-04-26 15:38 ` [PATCH 05/17] ARM: exynos: " Shawn Guo
2012-04-26 15:38 ` [PATCH 06/17] ARM: imx: " Shawn Guo
2012-04-27  9:05   ` Sascha Hauer
2012-04-27 13:05     ` Shawn Guo
2012-04-26 15:38 ` [PATCH 07/17] ARM: kirkwood: " Shawn Guo
2012-04-26 15:38 ` [PATCH 08/17] ARM: msm: " Shawn Guo
2012-04-26 17:41   ` David Brown
2012-04-27 12:36     ` Shawn Guo
2012-04-26 15:38 ` [PATCH 09/17] ARM: omap1: " Shawn Guo
2012-04-26 15:38 ` [PATCH 10/17] ARM: omap2: " Shawn Guo
2012-04-26 15:38 ` [PATCH 11/17] ARM: pnx4008: " Shawn Guo
2012-04-26 15:38 ` [PATCH 12/17] ARM: prima2: " Shawn Guo
2012-04-29 14:06   ` Barry Song
2012-04-26 15:38 ` [PATCH 13/17] ARM: s3c64xx: " Shawn Guo
2012-04-26 15:38 ` [PATCH 14/17] ARM: sa1100: " Shawn Guo
2012-04-26 15:38 ` [PATCH 15/17] ARM: shmobile: " Shawn Guo
2012-04-27  9:15   ` Magnus Damm
2012-04-29 21:35     ` Rafael J. Wysocki
2012-04-30  0:54       ` Shawn Guo
2012-04-30 21:58         ` Rafael J. Wysocki
2012-05-01  1:56           ` Shawn Guo
2012-05-01 13:35             ` Rafael J. Wysocki
2012-05-01 13:35               ` Shawn Guo
2012-04-26 15:38 ` [PATCH 16/17] ARM: tegra: " Shawn Guo
2012-04-26 15:51   ` Stephen Warren
2012-04-27 12:54     ` Shawn Guo
2012-04-26 15:38 ` [PATCH 17/17] ARM: ux500: " Shawn Guo
2012-04-27  7:08   ` Srinidhi Kasagar
2012-04-27 12:38     ` Shawn Guo

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=201204300846.41118.arnd@arndb.de \
    --to=arnd@arndb.de \
    --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.