[PATCH] pcnet32 irq bug

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The pcnet32 driver checks that the irq it is given in the
probe routine is valid by checking if the value is >= 2 but 0
and 1 are perfectly valid irq values. Even on intel, though they
are always allocated to the timer and keyboard. It does not
seem to me that here is an appropriate place to check such
platform specific information.

The platform I support has two PCI pcnet32 chips allocated
irq's 0 and 1 so I would very much like you to consider the following
patch to save me maintaining a join of my local source every time
we upgrade the kernel.

Also in the interest of correctness.

The value 255 is allocated by the PCI standard to indicate the irq
is invalid or uninitialized.

diff -u -r1.42 pcnet32.c
--- drivers/net/pcnet32.c 2 Nov 2002 20:02:00 -0000 1.42
+++ drivers/net/pcnet32.c 20 Feb 2003 19:58:07 -0000
@@ -753,12 +753,14 @@

a->write_csr (ioaddr, 1, (lp->dma_addr + offsetof(struct pcnet32_private, init_block)) & 0xffff);
a->write_csr (ioaddr, 2, (lp->dma_addr + offsetof(struct pcnet32_private, init_block)) >> 16);
- - if (irq_line) {
+ + dev->irq = 255;
+
+ if (irq_line < 255) {
dev->irq = irq_line;
}
- if (dev->irq >= 2)
+ if (dev->irq < 255)
printk(" assigned IRQ %d.\n", dev->irq);
else {
unsigned long irq_mask = probe_irq_on();


-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux