All of lore.kernel.org
 help / color / mirror / Atom feed
From: Prarit Bhargava <prarit@sgi.com>
To: linux-ia64@vger.kernel.org
Subject: Re: [PATCH]: Prevent sn2 ptc code from executing on all ia64 subarches
Date: Fri, 09 Dec 2005 18:22:09 +0000	[thread overview]
Message-ID: <4399CB51.4090405@sgi.com> (raw)
In-Reply-To: <20051121180016.24224.2378.sendpatchset@prarit.boston.redhat.com>

Luck, Tony wrote:
>>I'm not thrilled about this approach.
>>
>>I'd *like* to be able to assume that "changes in arch/ia64/sn/* clearly
>>don't affect non-SN platforms".  But this style breaks that.  Every ia64
>>box calls all these SN init functions, and if somebody forgets the
>>ia64_platform_is("sn2") check, bad things will happen.
>>
>>I'd like it a whole lot better if all these initialization-type things
>>could be hidden inside sn_setup() or some other machine vector.

The issue is that the initcalls are not executed at the same point in the boot 
-- there are seven levels of these and each level needs to be honoured. 
Placing them inside sn_setup() or some other machine vector is not the right 
thing to do (IMO -- there might be away to code around the levels that I'm 
unaware of).

> 
> 
> Me too ... these ia64_platform_is("sn2") are getting sprinkled in
> more and more places.
> 

I've been thinking about this and am wondering if the following solution might 
be more acceptable?

I'm also concerned about plugging in many ia64_platform_is checks into the code 
-- as Tony and Bjorn point out it seems that this approach is fraught with 
peril.  I'm also concerned about the possiblity of executing non-SGI code on one 
of my systems.

What if we added wrappers to the existing initcall functions to accept another 
argument?

Instead of subsys_initcall(fn) we would do

subarch_subsys_initcall (fn, arch) and this wrapper would do a platform check of 
the machine vector info?

ie)

subarch_subsys_initcall (init_foo, sn2)?


This seems a lot cleaner and would clean up other modular code as well.

I haven't completed my investigation yet -- the first patch that I submitted was 
in response to (what appeared to be) a minor issue reported by a colleague at 
another vendor and as Robin points out, is clearly only the start of the fix.

P.


  parent reply	other threads:[~2005-12-09 18:22 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-21 18:00 [PATCH]: Prevent sn2 ptc code from executing on all ia64 subarches Prarit Bhargava
2005-12-09 17:11 ` Robin Holt
2005-12-09 17:46 ` Bjorn Helgaas
2005-12-09 17:54 ` Luck, Tony
2005-12-09 18:22 ` Prarit Bhargava [this message]
2005-12-09 18:31 ` Prarit Bhargava
2005-12-09 18:38 ` Luck, Tony
2005-12-09 19:41 ` Andreas Schwab
2005-12-13 14:06 ` Prarit Bhargava
2005-12-13 15:10 ` Andreas Schwab
2005-12-13 15:42 ` Prarit Bhargava
2005-12-13 15:43 ` Prarit Bhargava
2005-12-13 16:03 ` Prarit Bhargava
2005-12-13 17:02 ` Christoph Hellwig
2005-12-13 17:14 ` Bjorn Helgaas
2005-12-13 17:24 ` Luck, Tony
2005-12-13 17:47 ` Bjorn Helgaas
2005-12-13 17:57 ` Luck, Tony
2005-12-13 18:26 ` Prarit Bhargava
2005-12-13 20:27 ` Bjorn Helgaas
2005-12-14 13:17 ` Prarit Bhargava
2005-12-15 14:33 ` Prarit Bhargava
2005-12-15 15:51 ` Bjorn Helgaas
2005-12-15 20:56 ` Prarit Bhargava
2005-12-15 21:08 ` Luck, Tony

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=4399CB51.4090405@sgi.com \
    --to=prarit@sgi.com \
    --cc=linux-ia64@vger.kernel.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.