* The new PCI fixup code ate my IDE controller
@ 2004-09-22 17:49 Matthew Wilcox
2004-09-22 18:19 ` David Woodhouse
0 siblings, 1 reply; 4+ messages in thread
From: Matthew Wilcox @ 2004-09-22 17:49 UTC (permalink / raw)
To: linux-kernel
The new DECLARE_PCI_FIXUP_HEADER() now makes the order of fixups depend
on link order. This is a bad thing because it's now one more thing that
link order is used to determine. Eventually, we're going to have a knot
where you can't move link order to make everything work.
The specific problem here is that quirk_ide_bases() is called before
superio_fixup_pci(). This is only a problem on PA-RISC. I can see
a few solutions to this. First, we can move the whole suckyio driver
to arch/parisc, ensuring it gets linked before drivers/pci. Second,
just move the DECLARE_PCI_FIXUP_HEADER to arch/parisc. Third, link
drivers/parisc ahead of drivers/pci (what other fun ordering problems
might we have?) Fourth, move the IDE quirk from drivers/pci/quirks.c
to drivers/ide somewhere (which is linked after drivers/parisc so would
happen to fix our problem). Fifth, back out the quirk changes. Sixth,
change the pci fixup stuff to sort the quirks by vendor ID (PCI_ANY_ID
sorts after any other ID).
Suggestions?
--
"Next the statesmen will invent cheap lies, putting the blame upon
the nation that is attacked, and every man will be glad of those
conscience-soothing falsities, and will diligently study them, and refuse
to examine any refutations of them; and thus he will by and by convince
himself that the war is just, and will thank God for the better sleep
he enjoys after this process of grotesque self-deception." -- Mark Twain
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: The new PCI fixup code ate my IDE controller
2004-09-22 17:49 The new PCI fixup code ate my IDE controller Matthew Wilcox
@ 2004-09-22 18:19 ` David Woodhouse
2004-09-22 18:39 ` Matthew Wilcox
0 siblings, 1 reply; 4+ messages in thread
From: David Woodhouse @ 2004-09-22 18:19 UTC (permalink / raw)
To: Matthew Wilcox; +Cc: linux-kernel
On Wed, 2004-09-22 at 18:49 +0100, Matthew Wilcox wrote:
> The new DECLARE_PCI_FIXUP_HEADER() now makes the order of fixups depend
> on link order. This is a bad thing because it's now one more thing that
> link order is used to determine. Eventually, we're going to have a knot
> where you can't move link order to make everything work.
>
> The specific problem here is that quirk_ide_bases() is called before
> superio_fixup_pci(). This is only a problem on PA-RISC. I can see
> a few solutions to this. First, we can move the whole suckyio driver
> to arch/parisc, ensuring it gets linked before drivers/pci. Second,
> just move the DECLARE_PCI_FIXUP_HEADER to arch/parisc. Third, link
> drivers/parisc ahead of drivers/pci (what other fun ordering problems
> might we have?) Fourth, move the IDE quirk from drivers/pci/quirks.c
> to drivers/ide somewhere (which is linked after drivers/parisc so would
> happen to fix our problem). Fifth, back out the quirk changes. Sixth,
> change the pci fixup stuff to sort the quirks by vendor ID (PCI_ANY_ID
> sorts after any other ID).
>
> Suggestions?
Hmm. We already have two passes through the fixup stuff. Add a third?
But sorting PCI_ANY_ID to go last seems like a reasonable first stab at
an answer, if that's sufficient for your purposes.
--
dwmw2
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: The new PCI fixup code ate my IDE controller
2004-09-22 18:19 ` David Woodhouse
@ 2004-09-22 18:39 ` Matthew Wilcox
2004-09-22 19:28 ` David Woodhouse
0 siblings, 1 reply; 4+ messages in thread
From: Matthew Wilcox @ 2004-09-22 18:39 UTC (permalink / raw)
To: David Woodhouse; +Cc: Matthew Wilcox, linux-kernel
On Wed, Sep 22, 2004 at 07:19:37PM +0100, David Woodhouse wrote:
> Hmm. We already have two passes through the fixup stuff. Add a third?
> But sorting PCI_ANY_ID to go last seems like a reasonable first stab at
> an answer, if that's sufficient for your purposes.
I don't think we need to go that far. Something like the following
should work ... (untested, uncompiled, whitespace-damaged)
Index: drivers/pci/quirks.c
===================================================================
RCS file: /var/cvs/linux-2.6/drivers/pci/quirks.c,v
retrieving revision 1.16
diff -u -p -r1.16 quirks.c
--- drivers/pci/quirks.c 13 Sep 2004 15:23:21 -0000 1.16
+++ drivers/pci/quirks.c 22 Sep 2004 18:37:53 -0000
@@ -661,7 +661,7 @@ static void __devinit quirk_ide_bases(st
printk(KERN_INFO "PCI: Ignoring BAR%d-%d of IDE controller %s\n",
first_bar, last_bar, pci_name(dev));
}
-DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID, PCI_ANY_ID,
quirk_ide_bases );
+DECLARE_PCI_FIXUP_HEADER_ALL(quirk_ide_bases);
/*
* Ensure C0 rev restreaming is off. This is normally done by
Index: include/linux/pci.h
===================================================================
RCS file: /var/cvs/linux-2.6/include/linux/pci.h,v
retrieving revision 1.18
diff -u -p -r1.18 pci.h
--- include/linux/pci.h 13 Sep 2004 15:24:12 -0000 1.18
+++ include/linux/pci.h 22 Sep 2004 18:37:54 -0000
@@ -1016,6 +1016,11 @@ enum pci_fixup_pass {
__attribute__((__section__(".pci_fixup_header"))) = {
\
vendor, device, hook };
+#define DECLARE_PCI_FIXUP_HEADER_ALL(hook) \
+ static struct pci_fixup __pci_fixup_PCI_ANY_IDPCI_ANY_ID##hook __attribu
te_used__ \
+ __attribute__((__section__(".pci_fixup_header_all"))) = {
+ PCI_ANY_ID, PCI_ANY_ID, hook };
+
#define DECLARE_PCI_FIXUP_FINAL(vendor, device, hook)
\
static struct pci_fixup __pci_fixup_##vendor##device##hook __attribute_u
sed__ \
__attribute__((__section__(".pci_fixup_final"))) = {
\
Index: include/asm-generic/vmlinux.lds.h
===================================================================
RCS file: /var/cvs/linux-2.6/include/asm-generic/vmlinux.lds.h,v
retrieving revision 1.4
diff -u -p -r1.4 vmlinux.lds.h
--- include/asm-generic/vmlinux.lds.h 13 Sep 2004 15:24:02 -0000 1.4
+++ include/asm-generic/vmlinux.lds.h 22 Sep 2004 18:37:54 -0000
@@ -20,6 +20,7 @@
.pci_fixup : AT(ADDR(.pci_fixup) - LOAD_OFFSET) { \
VMLINUX_SYMBOL(__start_pci_fixups_header) = .; \
*(.pci_fixup_header) \
+ *(.pci_fixup_header_all) \
VMLINUX_SYMBOL(__end_pci_fixups_header) = .; \
VMLINUX_SYMBOL(__start_pci_fixups_final) = .; \
*(.pci_fixup_final) \
--
"Next the statesmen will invent cheap lies, putting the blame upon
the nation that is attacked, and every man will be glad of those
conscience-soothing falsities, and will diligently study them, and refuse
to examine any refutations of them; and thus he will by and by convince
himself that the war is just, and will thank God for the better sleep
he enjoys after this process of grotesque self-deception." -- Mark Twain
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: The new PCI fixup code ate my IDE controller
2004-09-22 18:39 ` Matthew Wilcox
@ 2004-09-22 19:28 ` David Woodhouse
0 siblings, 0 replies; 4+ messages in thread
From: David Woodhouse @ 2004-09-22 19:28 UTC (permalink / raw)
To: Matthew Wilcox; +Cc: linux-kernel
On Wed, 2004-09-22 at 19:39 +0100, Matthew Wilcox wrote:
> On Wed, Sep 22, 2004 at 07:19:37PM +0100, David Woodhouse wrote:
> > Hmm. We already have two passes through the fixup stuff. Add a third?
> > But sorting PCI_ANY_ID to go last seems like a reasonable first stab at
> > an answer, if that's sufficient for your purposes.
>
> I don't think we need to go that far. Something like the following
> should work ... (untested, uncompiled, whitespace-damaged)
Looks good to me.
--
dwmw2
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2004-09-22 19:28 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-22 17:49 The new PCI fixup code ate my IDE controller Matthew Wilcox
2004-09-22 18:19 ` David Woodhouse
2004-09-22 18:39 ` Matthew Wilcox
2004-09-22 19:28 ` David Woodhouse
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®