lkml.org 
[lkml]   [2003]   [Jul]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectVIA PCI IRQ router bug fix
Date
From
Hi.

I found & fixed a problem with #PIRQD line setup for VIA PCI IRQ
router. Kernel was not able to receive any interrupts from network card,
which PCI slot IRQ pin A was routed to PIRQ line D of VIA PCI IRQ
router. According to VIA specs, PIRQ D routing is out of standard
'nibble' scheme.
I tested patch with 2.4.20 kernel, it can be applied to 2.4.22-pre2 as
well.
Thanks to my employer (Phoenix Technologies) who kindly allowed me to
make this patch public.

Aleks.

--- linux-2.4.20/arch/i386/kernel/pci-irq_old.c 2002-11-28 15:53:09.000000000 -0800
+++ linux-2.4.20/arch/i386/kernel/pci-irq.c 2003-05-21 17:27:40.000000000 -0700
@@ -198,12 +198,27 @@
*/
static int pirq_via_get(struct pci_dev *router, struct pci_dev *dev, int pirq)
{
- return read_config_nybble(router, 0x55, pirq);
+ u8 x;
+
+ if ( pirq == 4 ) {
+ pci_read_config_byte(router, 0x57, &x);
+ return (x >> 4);
+ } else {
+ return read_config_nybble(router, 0x55, pirq);
+ }
}

static int pirq_via_set(struct pci_dev *router, struct pci_dev *dev, int pirq, int irq)
{
- write_config_nybble(router, 0x55, pirq, irq);
+ u8 x;
+
+ if ( pirq == 4 ) {
+ pci_read_config_byte(router, 0x57, &x);
+ x = (x & 0x0f) | (irq << 4);
+ pci_write_config_byte(router, 0x57, x);
+ } else {
+ write_config_nybble(router, 0x55, pirq, irq);
+ }
return 1;
}
\
 
 \ /
  Last update: 2005-03-22 13:46    [W:0.045 / U:2.112 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site