2005-09-16 00:20:30

by Ilia Mirkin

[permalink] [raw]
Subject: pci detection on alpha fails to assign irq to on-board usb device

This is on a Compaq Professional Workstation XP1000, which is a Tsunami
system, compiled with the DP264 system setting in the kernel:

ohci_hcd: 2004 Nov 08 USB 1.1 'Open' Host Controller (OHCI) Driver (PCI)
ohci_hcd 0000:00:07.3: Found HC with no IRQ. Check BIOS/PCI
0000:00:07.3 setup!
ohci_hcd 0000:00:07.3: init 0000:00:07.3 fail, -19

lspci -vvvx -s 00:07.3
0000:00:07.3 USB Controller: Contaq Microsystems 82c693 (prog-if 10
[OHCI])
Control: I/O+ Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop-
ParErr- Stepping- SERR- FastB2B-
Status: Cap- 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort-
<TAbort- <MAbort- >SERR- <PERR-
Interrupt: pin A routed to IRQ 0
Region 0: Memory at 0000000009018000 (32-bit, non-prefetchable)
00: 80 10 93 c6 03 00 80 02 00 10 03 0c 08 f8 80 00
10: 00 80 01 09 00 00 00 00 00 00 00 00 00 00 00 00
20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
30: 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00

There was a fix that went into the miata system type a while back:
http://www.uwsg.iu.edu/hypermail/linux/kernel/0110.3/0849.html

I am using kernel 2.6.12.5, though the same problem occured with
2.6.11.8.

Unfortunately I do not know enough about these systems to attempt to
copy such a fix into the dp264 system type -- I made an attempt, but it
had no effect.

If you send me a patch to try out, I can do so as the system is not
being used for anything serious at the moment. If you need more info
about the system, just ask.

Thanks,

Ilia


2005-09-16 02:54:49

by Greg KH

[permalink] [raw]
Subject: Re: pci detection on alpha fails to assign irq to on-board usb device

On Thu, Sep 15, 2005 at 08:20:06PM -0400, Ilia Mirkin wrote:
> This is on a Compaq Professional Workstation XP1000, which is a Tsunami
> system, compiled with the DP264 system setting in the kernel:
>
> ohci_hcd: 2004 Nov 08 USB 1.1 'Open' Host Controller (OHCI) Driver (PCI)
> ohci_hcd 0000:00:07.3: Found HC with no IRQ. Check BIOS/PCI
> 0000:00:07.3 setup!
> ohci_hcd 0000:00:07.3: init 0000:00:07.3 fail, -19
>
> lspci -vvvx -s 00:07.3
> 0000:00:07.3 USB Controller: Contaq Microsystems 82c693 (prog-if 10
> [OHCI])
> Control: I/O+ Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop-
> ParErr- Stepping- SERR- FastB2B-
> Status: Cap- 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort-
> <TAbort- <MAbort- >SERR- <PERR-
> Interrupt: pin A routed to IRQ 0
> Region 0: Memory at 0000000009018000 (32-bit, non-prefetchable)
> 00: 80 10 93 c6 03 00 80 02 00 10 03 0c 08 f8 80 00
> 10: 00 80 01 09 00 00 00 00 00 00 00 00 00 00 00 00
> 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00
>
> There was a fix that went into the miata system type a while back:
> http://www.uwsg.iu.edu/hypermail/linux/kernel/0110.3/0849.html
>
> I am using kernel 2.6.12.5, though the same problem occured with
> 2.6.11.8.

Can you try 2.6.13.1 or 2.6.14-rc1?

thanks,

greg k-h

2005-09-16 04:13:36

by Ilia Mirkin

[permalink] [raw]
Subject: Re: pci detection on alpha fails to assign irq to on-board usb device

On Thu, 2005-09-15 at 19:54 -0700, Greg KH wrote:
> On Thu, Sep 15, 2005 at 08:20:06PM -0400, Ilia Mirkin wrote:
> > This is on a Compaq Professional Workstation XP1000, which is a Tsunami
> > system, compiled with the DP264 system setting in the kernel:
> >
> > ohci_hcd: 2004 Nov 08 USB 1.1 'Open' Host Controller (OHCI) Driver (PCI)
> > ohci_hcd 0000:00:07.3: Found HC with no IRQ. Check BIOS/PCI
> > 0000:00:07.3 setup!
> > ohci_hcd 0000:00:07.3: init 0000:00:07.3 fail, -19
> >
> > lspci -vvvx -s 00:07.3
> > 0000:00:07.3 USB Controller: Contaq Microsystems 82c693 (prog-if 10
> > [OHCI])
> > Control: I/O+ Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop-
> > ParErr- Stepping- SERR- FastB2B-
> > Status: Cap- 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort-
> > <TAbort- <MAbort- >SERR- <PERR-
> > Interrupt: pin A routed to IRQ 0
> > Region 0: Memory at 0000000009018000 (32-bit, non-prefetchable)
> > 00: 80 10 93 c6 03 00 80 02 00 10 03 0c 08 f8 80 00
> > 10: 00 80 01 09 00 00 00 00 00 00 00 00 00 00 00 00
> > 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> > 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00
> >
> > There was a fix that went into the miata system type a while back:
> > http://www.uwsg.iu.edu/hypermail/linux/kernel/0110.3/0849.html
> >
> > I am using kernel 2.6.12.5, though the same problem occured with
> > 2.6.11.8.
>
> Can you try 2.6.13.1 or 2.6.14-rc1?

Tried with 2.6.13.1 -- same thing. If you think that there are relevant
patches that went into -rc1 that are not in .1, I could try that out
too. A cursory look does not suggest any though.

I'll add that this Contaq chip is weird...

0000:00:07.0 ISA bridge: Contaq Microsystems 82c693
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
ParErr- Stepping- SERR- FastB2B-
Status: Cap- 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort-
<TAbort- <MAbort- >SERR- <PERR-
Latency: 0

0000:00:07.1 IDE interface: Contaq Microsystems 82c693 (prog-if 80
[Master])
Control: I/O+ Mem- BusMaster+ SpecCycle- MemWINV- VGASnoop-
ParErr- Stepping- SERR- FastB2B-
Status: Cap- 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort-
<TAbort- <MAbort- >SERR- <PERR-
Latency: 0
Interrupt: pin A routed to IRQ 0
Region 0: I/O ports at 01f0
Region 1: I/O ports at 03f4 [size=4]
Region 4: I/O ports at 8000 [size=16]

0000:00:07.2 IDE interface: Contaq Microsystems 82c693 (prog-if 00 [])
Control: I/O+ Mem- BusMaster+ SpecCycle- MemWINV- VGASnoop-
ParErr- Stepping- SERR- FastB2B-
Status: Cap- 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort-
<TAbort- <MAbort- >SERR- <PERR-
Latency: 0
Interrupt: pin B routed to IRQ 0
Region 0: I/O ports at 0170
Region 1: I/O ports at 0374 [size=4]
Region 4: Memory at 0000000009000000 (32-bit, non-prefetchable)
[disabled] [size=64K]

0000:00:07.3 USB Controller: Contaq Microsystems 82c693 (prog-if 10
[OHCI])
Control: I/O+ Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop-
ParErr- Stepping- SERR- FastB2B-
Status: Cap- 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort-
<TAbort- <MAbort- >SERR- <PERR-
Interrupt: pin A routed to IRQ 0
Region 0: Memory at 0000000009018000 (32-bit, non-prefetchable)

So this whole chip is being routed to IRQ 0, but the IDE stuff works
(admittedly only the first one has anything plugged in, so for all I
know the second one might not.)

Also, in enabling the IDE controller:
PCI: Enabling device: (0000:00:07.2), cmd 7

ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
(so it gets some other irq! amazing. shows how much i know about irq
routing)

I don't see any reference to 07.3 being enabled (maybe it doesn't print
anything if it fails to 'enable'?)

cat /proc/interrupts
1: 10 XT-PIC i8042
2: 0 XT-PIC cascade
8: 670785 RTC +timer
14: 13 XT-PIC +ide0
28: 1 DP264 +bttv0
45: 2040 DP264 eth0
47: 18994 DP264 qla1280
ERR: 0

-Ilia

2005-09-16 05:11:18

by Ilia Mirkin

[permalink] [raw]
Subject: Re: pci detection on alpha fails to assign irq to on-board usb device

On Thu, 2005-09-15 at 19:54 -0700, Greg KH wrote:
> On Thu, Sep 15, 2005 at 08:20:06PM -0400, Ilia Mirkin wrote:
> > This is on a Compaq Professional Workstation XP1000, which is a Tsunami
> > system, compiled with the DP264 system setting in the kernel:
> >
> > ohci_hcd: 2004 Nov 08 USB 1.1 'Open' Host Controller (OHCI) Driver (PCI)
> > ohci_hcd 0000:00:07.3: Found HC with no IRQ. Check BIOS/PCI
> > 0000:00:07.3 setup!
> > ohci_hcd 0000:00:07.3: init 0000:00:07.3 fail, -19
> >
> > lspci -vvvx -s 00:07.3
> > 0000:00:07.3 USB Controller: Contaq Microsystems 82c693 (prog-if 10
> > [OHCI])
> > Control: I/O+ Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop-
> > ParErr- Stepping- SERR- FastB2B-
> > Status: Cap- 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort-
> > <TAbort- <MAbort- >SERR- <PERR-
> > Interrupt: pin A routed to IRQ 0
> > Region 0: Memory at 0000000009018000 (32-bit, non-prefetchable)
> > 00: 80 10 93 c6 03 00 80 02 00 10 03 0c 08 f8 80 00
> > 10: 00 80 01 09 00 00 00 00 00 00 00 00 00 00 00 00
> > 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> > 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00
> >
> > There was a fix that went into the miata system type a while back:
> > http://www.uwsg.iu.edu/hypermail/linux/kernel/0110.3/0849.html
> >
> > I am using kernel 2.6.12.5, though the same problem occured with
> > 2.6.11.8.
>
> Can you try 2.6.13.1 or 2.6.14-rc1?

To add a little more to my last e-mail, here is kernel output with pci
debug enabled:

PCI: Scanning bus 0000:00
PCI: Found 0000:00:07.0 [1080/c693] 000601 00
PCI: Calling quirk fffffc00006e0840 for 0000:00:07.0
PCI: Calling quirk fffffc00004cf3b0 for 0000:00:07.0
PCI: Calling quirk fffffc00004cfa80 for 0000:00:07.0
PCI: Found 0000:00:07.1 [1080/c693] 000101 00
PCI: Calling quirk fffffc00006e0840 for 0000:00:07.1
PCI: Calling quirk fffffc00004cf3b0 for 0000:00:07.1
PCI: Calling quirk fffffc00004cfa80 for 0000:00:07.1
PCI: Found 0000:00:07.2 [1080/c693] 000101 00
PCI: Calling quirk fffffc00006e0840 for 0000:00:07.2
PCI: Calling quirk fffffc00004cf3b0 for 0000:00:07.2
PCI: Calling quirk fffffc00004cfa80 for 0000:00:07.2
PCI: Found 0000:00:07.3 [1080/c693] 000c03 00
PCI: Calling quirk fffffc00006e0840 for 0000:00:07.3
PCI: Calling quirk fffffc00004cf3b0 for 0000:00:07.3
PCI: Calling quirk fffffc00004cfa80 for 0000:00:07.3
PCI: Found 0000:00:0c.0 [1011/000d] 000300 00
PCI: Calling quirk fffffc00004cf3b0 for 0000:00:0c.0
PCI: Calling quirk fffffc00004cfa80 for 0000:00:0c.0
PCI: Fixups for bus 0000:00
PCI: Bus scan for 0000:00 returning with max=00
PCI: Scanning bus 0001:01
PCI: Found 0001:01:03.0 [1011/0019] 000200 00
PCI: Calling quirk fffffc00004cf3b0 for 0001:01:03.0
PCI: Calling quirk fffffc00004cfa80 for 0001:01:03.0
PCI: Found 0001:01:06.0 [1077/1020] 000100 00
PCI: Calling quirk fffffc00004cf3b0 for 0001:01:06.0
PCI: Calling quirk fffffc00004cfa80 for 0001:01:06.0
PCI: Found 0001:01:08.0 [1011/0024] 000604 01
PCI: Calling quirk fffffc00004cf3b0 for 0001:01:08.0
PCI: Calling quirk fffffc00004cfa80 for 0001:01:08.0
PCI: Fixups for bus 0001:01
PCI: Scanning behind PCI bridge 0001:01:08.0, config 020200, pass 0
PCI: Scanning behind PCI bridge 0001:01:08.0, config 020200, pass 1
PCI: Scanning bus 0001:02
PCI: Found 0001:02:09.0 [109e/036e] 000400 00
PCI: Calling quirk fffffc00004cf3b0 for 0001:02:09.0
PCI: Calling quirk fffffc00004cfa80 for 0001:02:09.0
PCI: Found 0001:02:09.1 [109e/0878] 000480 00
PCI: Calling quirk fffffc00004cf3b0 for 0001:02:09.1
PCI: Calling quirk fffffc00004cfa80 for 0001:02:09.1
PCI: Fixups for bus 0001:02
PCI: Bus scan for 0001:02 returning with max=02
PCI: Bus scan for 0001:01 returning with max=02
got res [a000000:bffffff] bus [a000000:bffffff] flags 1208 for BAR 0
of 0000:00:0c.0
PCI: moved device 0000:00:0c.0 resource 0 (1208) to a000000
got res [9000000:900ffff] bus [9000000:900ffff] flags 200 for BAR 4 of
0000:00:07.2
PCI: moved device 0000:00:07.2 resource 4 (200) to 9000000
got res [9010000:9017fff] bus [9010000:9017fff] flags 7200 for BAR 6
of 0000:00:0c.0
got res [9018000:9018fff] bus [9018000:9018fff] flags 200 for BAR 0 of
0000:00:07.3
PCI: moved device 0000:00:07.3 resource 0 (200) to 9018000
got res [8000:800f] bus [8000:800f] flags 101 for BAR 4 of
0000:00:07.1
PCI: moved device 0000:00:07.1 resource 4 (101) to 8000
got res [209100000:20913ffff] bus [9100000:913ffff] flags 7200 for BAR
6 of 0001:01:03.0
got res [209140000:20914ffff] bus [9140000:914ffff] flags 7200 for BAR
6 of 0001:01:06.0
got res [209150000:209150fff] bus [9150000:9150fff] flags 200 for BAR
1 of 0001:01:06.0
PCI: moved device 0001:01:06.0 resource 1 (200) to 9150000
got res [209151000:2091513ff] bus [9151000:91513ff] flags 200 for BAR
1 of 0001:01:03.0
PCI: moved device 0001:01:03.0 resource 1 (200) to 9151000
got res [200008000:2000080ff] bus [8000:80ff] flags 101 for BAR 0 of
0001:01:06.0
PCI: moved device 0001:01:06.0 resource 0 (101) to 8000
got res [200008400:20000847f] bus [8400:847f] flags 101 for BAR 0 of
0001:01:03.0
PCI: moved device 0001:01:03.0 resource 0 (101) to 8400
got res [209000000:209000fff] bus [9000000:9000fff] flags 1208 for BAR
0 of 0001:02:09.0
PCI: moved device 0001:02:09.0 resource 0 (1208) to 9000000
got res [209001000:209001fff] bus [9001000:9001fff] flags 1208 for BAR
0 of 0001:02:09.1
PCI: moved device 0001:02:09.1 resource 0 (1208) to 9001000
PCI: Bridge: 0001:01:08.0
IO window: disabled.
MEM window: disabled.
PREFETCH window: 09000000-090fffff
PCI: fixup irq: (0000:00:07.0) got 0
PCI: fixup irq: (0000:00:07.1) got 0
PCI: fixup irq: (0000:00:07.2) got 0
PCI: fixup irq: (0000:00:07.3) got 0
PCI: fixup irq: (0000:00:0c.0) got 36
PCI: fixup irq: (0001:01:03.0) got 45
PCI: fixup irq: (0001:01:06.0) got 47
PCI: fixup irq: (0001:01:08.0) got 0
PCI: fixup irq: (0001:02:09.0) got 28
PCI: fixup irq: (0001:02:09.1) got 28
SMC37c669 Super I/O Controller found @ 0x3f0
Linux Plug and Play Support v0.97 (c) Adam Belay
SCSI subsystem initialized
srm_env: version 0.0.5 loaded successfully
NTFS driver 2.1.23 [Flags: R/W].
Initializing Cryptographic API
PCI: Calling quirk fffffc00006e0900 for 0000:00:07.0
PCI: Calling quirk fffffc00004cf230 for 0000:00:07.0
PCI: Calling quirk fffffc00006e0900 for 0000:00:07.1
PCI: Calling quirk fffffc00004cf230 for 0000:00:07.1
PCI: Calling quirk fffffc00006e0900 for 0000:00:07.2
PCI: Calling quirk fffffc00004cf230 for 0000:00:07.2
PCI: Calling quirk fffffc00006e0900 for 0000:00:07.3
PCI: Calling quirk fffffc00004cf230 for 0000:00:07.3
PCI: Calling quirk fffffc00006e0900 for 0000:00:0c.0
PCI: Calling quirk fffffc00004cf230 for 0000:00:0c.0
PCI: Calling quirk fffffc00006e0900 for 0001:01:03.0
PCI: Calling quirk fffffc00004cf230 for 0001:01:03.0
PCI: Calling quirk fffffc00006e0900 for 0001:01:06.0
PCI: Calling quirk fffffc00004cf230 for 0001:01:06.0
PCI: Calling quirk fffffc00006e0900 for 0001:01:08.0
PCI: Calling quirk fffffc00004cf230 for 0001:01:08.0
PCI: Calling quirk fffffc00006e0900 for 0001:02:09.0
PCI: Calling quirk fffffc00004cf230 for 0001:02:09.0
PCI: Calling quirk fffffc00006e0900 for 0001:02:09.1
PCI: Calling quirk fffffc00004cf230 for 0001:02:09.1

-Ilia


2005-09-16 11:09:27

by Ivan Kokshaysky

[permalink] [raw]
Subject: Re: pci detection on alpha fails to assign irq to on-board usb device

On Fri, Sep 16, 2005 at 12:13:25AM -0400, Ilia Mirkin wrote:
> Tried with 2.6.13.1 -- same thing. If you think that there are relevant
> patches that went into -rc1 that are not in .1, I could try that out
> too. A cursory look does not suggest any though.

USB has never worked on these machines with stock kernels.
Please try appended patch (also make sure that "usb_enable" is "on"
in SRM.

Ivan.

--- linux/arch/alpha/kernel/sys_dp264.c.orig Fri Sep 16 14:41:22 2005
+++ linux/arch/alpha/kernel/sys_dp264.c Fri Sep 16 14:48:13 2005
@@ -395,6 +395,22 @@ clipper_init_irq(void)
*/

static int __init
+isa_irq_fixup(struct pci_dev *dev, int irq)
+{
+ u8 irq8;
+
+ if (irq > 0)
+ return irq;
+
+ /* This interrupt is routed via ISA bridge, so we'll
+ just have to trust whatever value the console might
+ have assigned. */
+ pci_read_config_byte(dev, PCI_INTERRUPT_LINE, &irq8);
+
+ return irq8 & 0xf;
+}
+
+static int __init
dp264_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
{
static char irq_tab[6][5] __initdata = {
@@ -407,25 +423,13 @@ dp264_map_irq(struct pci_dev *dev, u8 sl
{ 16+ 3, 16+ 3, 16+ 2, 16+ 1, 16+ 0} /* IdSel 10 slot 3 */
};
const long min_idsel = 5, max_idsel = 10, irqs_per_slot = 5;
-
struct pci_controller *hose = dev->sysdata;
int irq = COMMON_TABLE_LOOKUP;

- if (irq > 0) {
+ if (irq > 0)
irq += 16 * hose->index;
- } else {
- /* ??? The Contaq IDE controller on the ISA bridge uses
- "legacy" interrupts 14 and 15. I don't know if anything
- can wind up at the same slot+pin on hose1, so we'll
- just have to trust whatever value the console might
- have assigned. */
-
- u8 irq8;
- pci_read_config_byte(dev, PCI_INTERRUPT_LINE, &irq8);
- irq = irq8;
- }

- return irq;
+ return isa_irq_fixup(dev, irq);
}

static int __init
@@ -453,7 +457,8 @@ monet_map_irq(struct pci_dev *dev, u8 sl
{ 24, 24, 25, 26, 27} /* IdSel 15 slot 5 PCI2*/
};
const long min_idsel = 3, max_idsel = 15, irqs_per_slot = 5;
- return COMMON_TABLE_LOOKUP;
+
+ return isa_irq_fixup(dev, COMMON_TABLE_LOOKUP);
}

static u8 __init
@@ -507,7 +512,8 @@ webbrick_map_irq(struct pci_dev *dev, u8
{ 47, 47, 46, 45, 44}, /* IdSel 17 slot 3 */
};
const long min_idsel = 7, max_idsel = 17, irqs_per_slot = 5;
- return COMMON_TABLE_LOOKUP;
+
+ return isa_irq_fixup(dev, COMMON_TABLE_LOOKUP);
}

static int __init
@@ -524,14 +530,13 @@ clipper_map_irq(struct pci_dev *dev, u8
{ -1, -1, -1, -1, -1} /* IdSel 7 ISA Bridge */
};
const long min_idsel = 1, max_idsel = 7, irqs_per_slot = 5;
-
struct pci_controller *hose = dev->sysdata;
int irq = COMMON_TABLE_LOOKUP;

if (irq > 0)
irq += 16 * hose->index;

- return irq;
+ return isa_irq_fixup(dev, irq);
}

static void __init

2005-09-16 15:46:14

by Ilia Mirkin

[permalink] [raw]
Subject: Re: pci detection on alpha fails to assign irq to on-board usb device

On Fri, 2005-09-16 at 15:09 +0400, Ivan Kokshaysky wrote:
> On Fri, Sep 16, 2005 at 12:13:25AM -0400, Ilia Mirkin wrote:
> > Tried with 2.6.13.1 -- same thing. If you think that there are relevant
> > patches that went into -rc1 that are not in .1, I could try that out
> > too. A cursory look does not suggest any though.
>
> USB has never worked on these machines with stock kernels.
> Please try appended patch (also make sure that "usb_enable" is "on"
> in SRM.
>
> Ivan.
>

Much better.

ohci_hcd: 2005 April 22 USB 1.1 'Open' Host Controller (OHCI) Driver
(PCI)
ohci_hcd 0000:00:07.3: Contaq Microsystems 82c693 (#4)
ohci_hcd 0000:00:07.3: new USB bus registered, assigned bus number 1
ohci_hcd 0000:00:07.3: irq 10, io mem 0x09018000
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 2 ports detected

Thanks a lot -- this should get included in mainstream, at least for the
Monet variation (that's what this machine is).

-Ilia

> --- linux/arch/alpha/kernel/sys_dp264.c.orig Fri Sep 16 14:41:22 2005
> +++ linux/arch/alpha/kernel/sys_dp264.c Fri Sep 16 14:48:13 2005
> @@ -395,6 +395,22 @@ clipper_init_irq(void)
> */
>
> static int __init
> +isa_irq_fixup(struct pci_dev *dev, int irq)
> +{
> + u8 irq8;
> +
> + if (irq > 0)
> + return irq;
> +
> + /* This interrupt is routed via ISA bridge, so we'll
> + just have to trust whatever value the console might
> + have assigned. */
> + pci_read_config_byte(dev, PCI_INTERRUPT_LINE, &irq8);
> +
> + return irq8 & 0xf;
> +}
> +
> +static int __init
> dp264_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
> {
> static char irq_tab[6][5] __initdata = {
> @@ -407,25 +423,13 @@ dp264_map_irq(struct pci_dev *dev, u8 sl
> { 16+ 3, 16+ 3, 16+ 2, 16+ 1, 16+ 0} /* IdSel 10 slot 3 */
> };
> const long min_idsel = 5, max_idsel = 10, irqs_per_slot = 5;
> -
> struct pci_controller *hose = dev->sysdata;
> int irq = COMMON_TABLE_LOOKUP;
>
> - if (irq > 0) {
> + if (irq > 0)
> irq += 16 * hose->index;
> - } else {
> - /* ??? The Contaq IDE controller on the ISA bridge uses
> - "legacy" interrupts 14 and 15. I don't know if anything
> - can wind up at the same slot+pin on hose1, so we'll
> - just have to trust whatever value the console might
> - have assigned. */
> -
> - u8 irq8;
> - pci_read_config_byte(dev, PCI_INTERRUPT_LINE, &irq8);
> - irq = irq8;
> - }
>
> - return irq;
> + return isa_irq_fixup(dev, irq);
> }
>
> static int __init
> @@ -453,7 +457,8 @@ monet_map_irq(struct pci_dev *dev, u8 sl
> { 24, 24, 25, 26, 27} /* IdSel 15 slot 5 PCI2*/
> };
> const long min_idsel = 3, max_idsel = 15, irqs_per_slot = 5;
> - return COMMON_TABLE_LOOKUP;
> +
> + return isa_irq_fixup(dev, COMMON_TABLE_LOOKUP);
> }
>
> static u8 __init
> @@ -507,7 +512,8 @@ webbrick_map_irq(struct pci_dev *dev, u8
> { 47, 47, 46, 45, 44}, /* IdSel 17 slot 3 */
> };
> const long min_idsel = 7, max_idsel = 17, irqs_per_slot = 5;
> - return COMMON_TABLE_LOOKUP;
> +
> + return isa_irq_fixup(dev, COMMON_TABLE_LOOKUP);
> }
>
> static int __init
> @@ -524,14 +530,13 @@ clipper_map_irq(struct pci_dev *dev, u8
> { -1, -1, -1, -1, -1} /* IdSel 7 ISA Bridge */
> };
> const long min_idsel = 1, max_idsel = 7, irqs_per_slot = 5;
> -
> struct pci_controller *hose = dev->sysdata;
> int irq = COMMON_TABLE_LOOKUP;
>
> if (irq > 0)
> irq += 16 * hose->index;
>
> - return irq;
> + return isa_irq_fixup(dev, irq);
> }
>
> static void __init