[PATCH] PCI early fixup missing bits
From: Maciej W. Rozycki
Date: Wed Dec 15 2004 - 20:58:19 EST
Hello,
A few bits seem to be missing for PCI early fixup to work -- the
pci_fixup_device() helper ignores fixups of the pci_fixup_early type.
Also the local class variable needs to be refreshed after performing the
fixups for they can change dev->class.
The patch should be obvious. Checked against 2.6.10-rc3-bk9. Please
apply.
Maciej
Signed-off-by: Maciej W. Rozycki <macro@xxxxxxxx>
patch-mips-2.6.10-rc2-20041124-pci_fixup_early-1
diff -up --recursive --new-file linux-mips-2.6.10-rc2-20041124.macro/drivers/pci/probe.c linux-mips-2.6.10-rc2-20041124/drivers/pci/probe.c
--- linux-mips-2.6.10-rc2-20041124.macro/drivers/pci/probe.c 2004-11-22 14:27:03.000000000 +0000
+++ linux-mips-2.6.10-rc2-20041124/drivers/pci/probe.c 2004-12-15 18:45:32.000000000 +0000
@@ -490,6 +490,7 @@ static int pci_setup_device(struct pci_d
/* Early fixups, before probing the BARs */
pci_fixup_device(pci_fixup_early, dev);
+ class = dev->class >> 8;
switch (dev->hdr_type) { /* header type */
case PCI_HEADER_TYPE_NORMAL: /* standard header */
diff -up --recursive --new-file linux-mips-2.6.10-rc2-20041124.macro/drivers/pci/quirks.c linux-mips-2.6.10-rc2-20041124/drivers/pci/quirks.c
--- linux-mips-2.6.10-rc2-20041124.macro/drivers/pci/quirks.c 2004-11-22 14:27:04.000000000 +0000
+++ linux-mips-2.6.10-rc2-20041124/drivers/pci/quirks.c 2004-12-15 18:36:15.000000000 +0000
@@ -1232,6 +1232,8 @@ static void pci_do_fixups(struct pci_dev
}
}
+extern struct pci_fixup __start_pci_fixups_early[];
+extern struct pci_fixup __end_pci_fixups_early[];
extern struct pci_fixup __start_pci_fixups_header[];
extern struct pci_fixup __end_pci_fixups_header[];
extern struct pci_fixup __start_pci_fixups_final[];
@@ -1245,6 +1247,11 @@ void pci_fixup_device(enum pci_fixup_pas
struct pci_fixup *start, *end;
switch(pass) {
+ case pci_fixup_early:
+ start = __start_pci_fixups_early;
+ end = __end_pci_fixups_early;
+ break;
+
case pci_fixup_header:
start = __start_pci_fixups_header;
end = __end_pci_fixups_header;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/