alpha build fixes
Subsystems (4)
PATCH 1/1 alpha build fixes
Needed this to build Fedora rawhide kernel (2.6.12-rc1 + some patches) on alpha. This is the upstream portion of the build fixes.
drivers/char/agp/generic.c renamed from kernel-2.6.11.orig/linux-2.6.11/drivers/char/agp/generic.c +1 -0
@@ -35,6 +35,7 @@#include <linux/pm.h> #include <linux/agp_backend.h> #include <linux/vmalloc.h> +#include <linux/dma-mapping.h> #include <linux/mm.h> #include <asm/io.h> #include <asm/cacheflush.h>
include/asm-alpha/pci.h renamed from kernel-2.6.11.orig/linux-2.6.11/include/asm-alpha/pci.h +6 -0
@@ -223,6 +223,12 @@/* Nothing to do. */ } +/* TODO: integrate with include/asm-generic/pci.h ? */ +static inline int pci_get_legacy_ide_irq (struct pci_dev *dev,int channel) +{ +return channel ?15 :14 ; +} +extern void pcibios_resource_to_bus (struct pci_dev *,struct pci_bus_region *,struct resource *);
include/linux/debugfs.h renamed from kernel-2.6.11.orig/linux-2.6.11/include/linux/debugfs.h +2 -0
@@ -15,6 +15,8 @@#ifndef _DEBUGFS_H_#define _DEBUGFS_H_ +#include <linux/fs.h> +#if defined(CONFIG_DEBUG_FS ) struct dentry *debugfs_create_file(const char *name, mode_t mode, struct dentry *parent, void *data,
drivers/atm/lanai.c renamed from kernel-2.6.11.orig/linux-2.6.11/drivers/atm/lanai.c +1 -0
@@ -61,6 +61,7 @@#include <asm/byteorder.h> #include <linux/spinlock.h> #include <linux/pci.h> +#include <linux/dma-mapping.h> #include <linux/init.h> #include <linux/delay.h> #include <linux/interrupt.h>
drivers/char/tpm/tpm.h renamed from kernel-2.6.11.orig/linux-2.6.11/drivers/char/tpm/tpm.h +1 -0
@@ -22,6 +22,7 @@#include <linux/version.h> #include <linux/pci.h> #include <linux/delay.h> +#include <linux/fs.h> #include <linux/miscdevice.h> #define TPM_TIMEOUT msecs_to_jiffies(5)
include/asm-alpha/pci.h line 230
Quoted 5 lines · Jeff Garzik
include/asm-alpha/pci.h renamed from kernel-2.6.11.orig/linux-2.6.11/include/asm-alpha/pci.h +5
-0+/* TODO: integrate with include/asm-generic/pci.h ? */ +static inline int pci_get_legacy_ide_irq (struct pci_dev *dev,int channel) +{ +return channel ?15 :14 ; +}
Am I missing something, or is this *only* used by drivers/ide/pci/amd74xx.c? Why in the world would we have this much infrastructure for one driver? And why not just not compile that one for Alpha, since it'll never be used.
r~
Quoted 10 lines · Richard Henderson
include/asm-alpha/pci.h line 230
Quoted 5 lines · Jeff Garzik
include/asm-alpha/pci.h renamed from kernel-2.6.11.orig/linux-2.6.11/include/asm-alpha/pci.h +5
-0+/* TODO: integrate with include/asm-generic/pci.h ? */ +static inline int pci_get_legacy_ide_irq (struct pci_dev *dev,int channel) +{ +return channel ?15 :14 ; +}Am I missing something, or is this *only* used by
drivers/ide/pci/amd74xx.c? Why in the world would we have this much infrastructure for one driver? And why not just not compile that one for Alpha, since it'll never be used.
My presumption is that it will be used in other IDE drivers in the future. Bart?
If it will only be used in that one driver, then I agree.
Jeff
Quoted 12 lines · Jeff Garzik
Quoted 10 lines · Richard Henderson
include/asm-alpha/pci.h line 230
Quoted 5 lines · Jeff Garzik
include/asm-alpha/pci.h renamed from kernel-2.6.11.orig/linux-2.6.11/include/asm-alpha/pci.h +5
-0+/* TODO: integrate with include/asm-generic/pci.h ? */ +static inline int pci_get_legacy_ide_irq (struct pci_dev *dev,int channel) +{ +return channel ?15 :14 ; +}Am I missing something, or is this *only* used by
drivers/ide/pci/amd74xx.c? Why in the world would we have this much infrastructure for one driver? And why not just not compile that one for Alpha, since it'll never be used.
Quoted 2 lines
My presumption is that it will be used in other IDE drivers in the future. Bart?
This code is meant to be used by other IDE/libata drivers.
[ Original thread can be found in linux-ide ML archive. ]
Quoted 13 lines · Bartlomiej Zolnierkiewicz
Quoted 12 lines · Jeff Garzik
Quoted 10 lines · Richard Henderson
include/asm-alpha/pci.h line 230
Quoted 5 lines · Jeff Garzik
include/asm-alpha/pci.h renamed from kernel-2.6.11.orig/linux-2.6.11/include/asm-alpha/pci.h +5
-0+/* TODO: integrate with include/asm-generic/pci.h ? */ +static inline int pci_get_legacy_ide_irq (struct pci_dev *dev,int channel) +{ +return channel ?15 :14 ; +}Am I missing something, or is this *only* used by
drivers/ide/pci/amd74xx.c? Why in the world would we have this much infrastructure for one driver? And why not just not compile that one for Alpha, since it'll never be used.
Quoted 4 lines
Quoted 2 lines
My presumption is that it will be used in other IDE drivers in the future. Bart?
This code is meant to be used by other IDE/libata drivers.
Then isn't linux/ide.h the proper place for default pci_get_legacy_ide_irq() implementation instead of asm-generic/pci.h? The latter is only used by 7 out of 23 architectures, so not only alpha gets broken.
Ivan.
Quoted 14 lines · Ivan Kokshaysky
Quoted 13 lines · Bartlomiej Zolnierkiewicz
Quoted 12 lines · Jeff Garzik
Quoted 10 lines · Richard Henderson
include/asm-alpha/pci.h line 230
Quoted 5 lines · Jeff Garzik
include/asm-alpha/pci.h renamed from kernel-2.6.11.orig/linux-2.6.11/include/asm-alpha/pci.h +5
-0+/* TODO: integrate with include/asm-generic/pci.h ? */ +static inline int pci_get_legacy_ide_irq (struct pci_dev *dev,int channel) +{ +return channel ?15 :14 ; +}Am I missing something, or is this *only* used by
drivers/ide/pci/amd74xx.c? Why in the world would we have this much infrastructure for one driver? And why not just not compile that one for Alpha, since it'll never be used.
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
My presumption is that it will be used in other IDE drivers in the future. Bart?
This code is meant to be used by other IDE/libata drivers.
Then isn't
linux/ide.hthe proper place for defaultpci_get_legacy_ide_irq()
ide.h is not shared between IDE and libata drivers (but ata.h is)
Quoted 2 lines
implementation instead of
asm-generic/pci.h? The latter is only used by 7 out of 23 architectures, so not only alpha gets broken.
I'm cc:ing Ben as it was his idea
Quoted 7 lines
Quoted 2 lines
Then isn't
linux/ide.hthe proper place for defaultpci_get_legacy_ide_irq()
ide.his not shared between IDE and libata drivers (butata.his)Quoted 2 lines
implementation instead of
asm-generic/pci.h? The latter is only used by 7 out of 23 architectures, so not only alpha gets broken.
I'm not sure what the original problem is with alpha, but I added this call to remove the hard coding of irq numbers in various drivers that "find" the chip in legacy mode. Instead, I give the arch the opportunity to provide the actual irq numbers in that case.
IRQs on IDE in legacy mode is sort of an out-of-spec piece of junk that was invented to make PCI based peecees "look like" good old rotten hardware, unfortunately, some modern and non-x86 HW vendors still don't haev a clue and configure (wire in some case) their on board IDE in legacy mode, but with IRQs that, on those archs, aren't 14 and 15. That hook fixes the problem on some ppc64 machines but should be extended to cover various other cases where similar shit happens.
It's in PCI because I figured it was as bad there than anywhere else. In this case, it's the IDE layer asking the PCI layer "hey, that guy doesn't respect the normal PCI IRQ mapping, can you tell me how it's routed ?" :) Back then, I didn't know of a header shared between ide and libata so I put it there.
Ben.
Quoted 7 lines · Benjamin Herrenschmidt
IRQs on IDE in legacy mode is sort of an out-of-spec piece of junk that was invented to make PCI based peecees "look like" good old rotten hardware, unfortunately, some modern and non-x86 HW vendors still don't haev a clue and configure (wire in some case) their on board IDE in legacy mode, but with IRQs that, on those archs, aren't 14 and 15. That hook fixes the problem on some ppc64 machines but should be extended to cover various other cases where similar shit happens.
Indeed, such setup is quite typical for southbridge chips with integrated IDE controller - they still simulate sort of ISA IRQ routing...
Quoted 5 lines
It's in PCI because I figured it was as bad there than anywhere else. In this case, it's the IDE layer asking the PCI layer "hey, that guy doesn't respect the normal PCI IRQ mapping, can you tell me how it's routed ?" :) Back then, I didn't know of a header shared between ide and libata so I put it there.
Ok, but asm-generic/pci.h is not a good place for default IRQ 14/15 case - this header cannot be included on non-x86 without additional #ifdef's. Perhaps we can move it to linux/pci.h or linux/ata.h (as Bart noted)?
Ivan.
Quoted 10 lines · Richard Henderson
include/asm-alpha/pci.h line 230
Quoted 5 lines · Jeff Garzik
include/asm-alpha/pci.h renamed from kernel-2.6.11.orig/linux-2.6.11/include/asm-alpha/pci.h +5
-0+/* TODO: integrate with include/asm-generic/pci.h ? */ +static inline int pci_get_legacy_ide_irq (struct pci_dev *dev,int channel) +{ +return channel ?15 :14 ; +}Am I missing something, or is this *only* used by
drivers/ide/pci/amd74xx.c? Why in the world would we have this much infrastructure for one driver? And why not just not compile that one for Alpha, since it'll never be used.
The issue is bigger - it's needed for the CMD controllers on PA-RISC for example it appears - and anything else where IDE legacy IRQ is wired oddly.
Quoted 3 lines · Alan Cox
The issue is bigger - it's needed for the CMD controllers on PA-RISC for example it appears - and anything else where IDE legacy IRQ is wired oddly.
Sure, but who queries this information? That's my question.
r~
Quoted 6 lines · Richard Henderson
Quoted 3 lines · Alan Cox
The issue is bigger - it's needed for the CMD controllers on PA-RISC for example it appears - and anything else where IDE legacy IRQ is wired oddly.
Sure, but who queries this information? That's my question.
IDE drivers.
Since its a detail that varies widely depending on platform, the arch should either provide it or at least have a way to override it.
linux/pci.h would be fine place for the "generic version arch overrides with HAVE_ARCH_PCI_IDE_IRQ", or we could fix the asm-generic header to not need #ifdefs in -your- source just to be usable.
Jeff
Quoted 5 lines
Ok, but
asm-generic/pci.his not a good place for default IRQ 14/15 case - this header cannot be included on non-x86 without additional #ifdef's. Perhaps we can move it tolinux/pci.horlinux/ata.h(as Bart noted)?
Well, I would have expected other archs to just make their own, but I have no special preference here ... linux/pci.h is as good as anything.
Ben.