2002-10-27 00:51:51

by Peter Denison

[permalink] [raw]
Subject: [PATCH] ide.c initialisation order

Summary: Move ide_init_default_hwifs to ide_init() from ide_init_data()

On non-PCI boxes, in ide_init_data called from very early ide_setup, the
ide_init_default_hwifs() function calls -> ide_register_hw ->
ide_probe_module -> ide_probe_init -> etc. well before loads of other
important things like command-line processing were done. Move it to
ide_init().

(I guess nobody is testing 2.5.xx IDE on non-PCI hardware!)

Whether this call should be there at all is a matter for debate. The whole
of IDE startup is an unholy mess, not least in the plethora of "init",
"register" and "probe" named functions, which are not consistent. However,
now is not the time to tackle that!

Applies: 2.5.44 (and probably others!)

--- drivers/ide/ide.c.old 2002-10-19 12:43:39.000000000 +0100
+++ drivers/ide/ide.c 2002-10-19 23:30:43.000000000 +0100
@@ -345,9 +347,6 @@
for (index = 0; index < MAX_HWIFS; ++index)
init_hwif_data(index);

- /* Add default hw interfaces */
- ide_init_default_hwifs();
-
idebus_parameter = 0;
system_bus_speed = 0;
}
@@ -3444,6 +3443,9 @@

init_ide_data();

+ /* Add default hw interfaces */
+ ide_init_default_hwifs();
+
initializing = 1;
ide_init_builtin_drivers();
initializing = 0;

--
Peter Denison <peterd at marshadder dot uklinux dot net>
Please use the address above only for personal mail, not copied to any lists
that are gatewayed to news or web pages unless the addresses are removed.