Jeff Garzik wrote:
>
> In 2.3.99-pre9-pre1, there are many changes to the struct pci_device_id
> PCI probe tables. Unfortunately these changes were made rather blindly
> and some are not correct. (If these are Rui's changes, I fear I did not
> speak up soon enough, causing these errors)
>
> __devinitdata should NOT be used unless you are certain the driver is a
> hotplug driver. Otherwise __initdata should be used. Similar rules for
> __init and __devinit.
>
> The patch in 2.3.99-pre9-pre1 blindly moves everything to __devinitdata,
> which causes memory wastage in non-hotplug kernels (ie. the majority of
> the kernels out there).
>
> Each driver author should carefully consider their __initdata markers
> versus their __devinitdata markers, and doing a global conversion like
> that in patch-2.3.99-pre9-pre1 is bound to "undo" carefully thought-out
> changes by driver authors and maintainers.
>
Attached is a patch against pre9-1 that solves the mess I made.
Please check that I got it right this time and that the text in
Documentation/pci.txt is correct.
Rui Sousa
diff -ur linux-2.3.new/Documentation/pci.txt linux-2.3/Documentation/pci.txt
--- linux-2.3.new/Documentation/pci.txt Sat May 13 14:42:20 2000
+++ linux-2.3/Documentation/pci.txt Sat May 13 14:41:32 2000
@@ -96,6 +96,9 @@
The ID table array should be marked __devinitdata.
The probe() and remove() functions (and all initialization
functions called only from these) should be marked __devinit/exit.
+ If you are sure the driver is not a hotplug driver then use only
+ __init/exit __initdata/exitdata.
+
2. How to find PCI devices manually (the old style)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff -ur linux-2.3.new/arch/i386/kernel/acpi.c linux-2.3/arch/i386/kernel/acpi.c
--- linux-2.3.new/arch/i386/kernel/acpi.c Sat May 13 14:42:20 2000
+++ linux-2.3/arch/i386/kernel/acpi.c Sat May 13 14:27:16 2000
@@ -824,7 +824,7 @@
{acpi_init_via},
};
-const static struct pci_device_id acpi_pci_tbl[] __devinitdata =
+const static struct pci_device_id acpi_pci_tbl[] __initdata =
{
{0x8086, 0x7113, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_INTEL_PIIX4},
{0x1106, 0x3040, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_VIA_586},
diff -ur linux-2.3.new/drivers/char/epca.c linux-2.3/drivers/char/epca.c
--- linux-2.3.new/drivers/char/epca.c Sat May 13 14:42:22 2000
+++ linux-2.3/drivers/char/epca.c Sat May 13 14:28:13 2000
@@ -4075,7 +4075,7 @@
}
-static struct pci_device_id epca_pci_tbl[] __devinitdata = {
+static struct pci_device_id epca_pci_tbl[] __initdata = {
{ PCI_VENDOR_DIGI, PCI_DEVICE_XR, PCI_ANY_ID, PCI_ANY_ID, 0, 0, brd_xr },
{ PCI_VENDOR_DIGI, PCI_DEVICE_XEM, PCI_ANY_ID, PCI_ANY_ID, 0, 0, brd_xem },
{ PCI_VENDOR_DIGI, PCI_DEVICE_CX, PCI_ANY_ID, PCI_ANY_ID, 0, 0, brd_cx },
diff -ur linux-2.3.new/drivers/net/sis900.c linux-2.3/drivers/net/sis900.c
--- linux-2.3.new/drivers/net/sis900.c Sat May 13 14:42:22 2000
+++ linux-2.3/drivers/net/sis900.c Sat May 13 14:30:26 2000
@@ -75,7 +75,7 @@
"SiS 900 PCI Fast Ethernet",
"SiS 7016 PCI Fast Ethernet"
};
-static struct pci_device_id sis900_pci_tbl [] __devinitdata = {
+static struct pci_device_id sis900_pci_tbl [] __initdata = {
{PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_900,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, SIS_900},
{PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_7016,
diff -ur linux-2.3.new/drivers/sound/i810_audio.c linux-2.3/drivers/sound/i810_audio.c
--- linux-2.3.new/drivers/sound/i810_audio.c Sat May 13 14:42:22 2000
+++ linux-2.3/drivers/sound/i810_audio.c Sat May 13 14:31:54 2000
@@ -189,7 +189,7 @@
"Intel 440MX"
};
-static struct pci_device_id i810_pci_tbl [] __devinitdata = {
+static struct pci_device_id i810_pci_tbl [] __initdata = {
{PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, ICH82801AA},
{PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82901,
diff -ur linux-2.3.new/drivers/sound/trident.c linux-2.3/drivers/sound/trident.c
--- linux-2.3.new/drivers/sound/trident.c Sat May 13 14:42:22 2000
+++ linux-2.3/drivers/sound/trident.c Sat May 13 14:34:20 2000
@@ -147,7 +147,7 @@
"ALi Audio Accelerator"
};
-static struct pci_device_id trident_pci_tbl [] __devinitdata = {
+static struct pci_device_id trident_pci_tbl [] __initdata = {
{PCI_VENDOR_ID_TRIDENT, PCI_DEVICE_ID_TRIDENT_4DWAVE_DX,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, TRIDENT_4D_DX},
{PCI_VENDOR_ID_TRIDENT, PCI_DEVICE_ID_TRIDENT_4DWAVE_NX,
diff -ur linux-2.3.new/drivers/sound/via82cxxx_audio.c linux-2.3/drivers/sound/via82cxxx_audio.c
--- linux-2.3.new/drivers/sound/via82cxxx_audio.c Sat May 13 14:42:22 2000
+++ linux-2.3/drivers/sound/via82cxxx_audio.c Sat May 13 14:32:25 2000
@@ -303,7 +303,7 @@
*/
-static struct pci_device_id via_pci_tbl[] __devinitdata = {
+static struct pci_device_id via_pci_tbl[] __initdata = {
{ PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686_5, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
{ 0, }
};
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/
This archive was generated by hypermail 2b29 : Mon May 15 2000 - 21:00:23 EST