public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: David Woodhouse <dwmw2@infradead.org>
To: Keith Owens <kaos@ocs.com.au>
Cc: Antony Suter <antony@mira.net>,
	List Linux-Kernel <linux-kernel@vger.kernel.org>,
	Allen Unueco <allen@premierweb.com>
Subject: Re: Where did vm_operations_struct->unmap in 2.4.0 go?
Date: Thu, 11 Jan 2001 12:32:10 +0000	[thread overview]
Message-ID: <12129.979216330@redhat.com> (raw)
In-Reply-To: <16427.979215125@ocs3.ocs-net>
In-Reply-To: <16427.979215125@ocs3.ocs-net>


kaos@ocs.com.au said:
>  Q. With your suggested static method, what happens when Y initialises
>    before X, calls inter_module_get, retrieves X's static data and
>    starts to use it before X has initialised? 
> A. Oops!

No. You'd explicitly only use the static registration when object X doesn't 
_need_ initialisation, which is the case for my code.

As it is, I've had to add completely now init routines for 
modules which didn't have them before, and all those init routines do is 
inter_module_register() and pray that they're called in time.


kaos@ocs.com.au said:
>  The whole point of registration methods is that the owner of the data
> decides when they are ready to provide the service.  Ensuring that
> code is initialised in the correct order, with providers starting
> before consumers, is a fact of life.

I have decided when I'm ready to provide the service. At compile time. 
Ensuring that the code is initialised in the correct order is not a fact of 
life. It's an artifact of the limited functionality of the new setup.


kaos@ocs.com.au said:
> It would be much nicer to define ordering sets.  Code in driver foo
> needs the code in driver bar to initialise first.  cfi_probe cannot
> initialise until cfi_cmdset_0001 and cfi_cmdset_0002 have initialised.
> Declare it that way so it is clear what is going on and why, instead
> of being implied by the Makefile order via three layers of
> indirection.

For cases where the code really does need initialisation, that is true. It 
should be done properly rather than just implicitly ordered by the 
Makefile. But in this case, the command set drivers don't need 
initialisation. They just provide a function for use by the generic CFI 
init code. They don't _need_ to initialise themselves beforehand.

The dynamic registration has introduced this ordering dependency when 
previously there was none.


>  The problem is, Linus likes the current method. 

Then he either hasn't considered this particular case, or he's wrong. It 
happens. I'm not suggesting that we change it drastically, only that we add 
the option of static (compile-time) registration for those entries which 
require it. 

Actually, I'd rather do this with weak symbols. Something along the lines 
of...

 extern cfi_cmdset_fn_t cfi_cmdset_0001 __attribute__((weak));
 extern cfi_cmdset_fn_t cfi_cmdset_0002 __attribute__((weak));


 ...
	
 if (cfi_cmdset_0001 && chip_is_type_1())
	return cfi_cmdset_0001(args...);
 if (cfi_cmdset_0002 && chip_is_type_2())
	return cfi_cmdset_0002(args...);

 return cfi_cmdset_load_module(args...)

Unfortunately, I couldn't get it to work reliably on anything but x86. 




--
dwmw2


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

  reply	other threads:[~2001-01-11 12:32 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-01-10  3:27 Where did vm_operations_struct->unmap in 2.4.0 go? Allen Unueco
2001-01-10  3:50 ` Keith Owens
2001-01-11  5:38 ` Antony Suter
2001-01-11  6:05   ` Keith Owens
2001-01-11 11:42     ` David Woodhouse
2001-01-11 12:12       ` Keith Owens
2001-01-11 12:32         ` David Woodhouse [this message]
2001-01-11 12:46           ` Keith Owens
2001-01-11 13:09             ` Alan Cox
2001-01-11 13:14               ` Keith Owens
2001-01-12  2:12                 ` Ingo Oeser
2001-01-12  2:30                   ` Keith Owens
2001-01-12 10:27                     ` David Woodhouse
2001-01-12 11:55                       ` Keith Owens
2001-01-12 13:40                         ` David Woodhouse
2001-01-12 12:01                     ` Daniel Phillips
2001-01-12 12:18                       ` Keith Owens
2001-01-14 10:16                         ` Kai Henningsen
2001-01-11 13:25             ` David Woodhouse
     [not found] <3A5EFC56.F1A5BCE0@mira.net>
2001-01-12 19:11 ` Christian Zander
2001-01-13  1:11   ` Keith Owens
2001-01-13 10:46     ` David Woodhouse
2001-01-13 12:06       ` Keith Owens
2001-01-13 15:09         ` David Woodhouse
2001-01-13 19:03           ` Russell King
2001-01-14  0:21           ` Keith Owens
2001-01-14  9:43             ` David Woodhouse
2001-01-14 10:05               ` Keith Owens
2001-01-14 10:45                 ` David Woodhouse
2001-01-14  4:04           ` Linus Torvalds
2001-01-14 17:46             ` David Woodhouse
2001-01-14 19:12               ` Linus Torvalds
2001-01-14 20:02                 ` David Woodhouse
2001-01-14 20:15                   ` Linus Torvalds
2001-01-14 21:15                     ` David Woodhouse
2001-01-14 21:47                       ` Linus Torvalds
2001-01-14 21:57                         ` David Woodhouse
2001-01-14 23:00                         ` Keith Owens
2001-01-15  9:09                           ` David Woodhouse
2001-01-13 11:46     ` Christian Zander
2001-01-13 12:23       ` Keith Owens

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=12129.979216330@redhat.com \
    --to=dwmw2@infradead.org \
    --cc=allen@premierweb.com \
    --cc=antony@mira.net \
    --cc=kaos@ocs.com.au \
    --cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox