[PATCH] parport_pc fix for 2.3.21

Mikael Pettersson (mikpe@csd.uu.se)
Tue, 12 Oct 1999 18:46:21 +0200 (MET DST)


parport_pc.c in all recent 2.3.x kernels has two minor buglets:
1. CONFIGA(pb) not FIFO(pb) should be used to read config register A
after placing the port in config mode.
2. The code which checks the interrupt type incorrectly reads bit 7
in config register B. That info is in config register A.

Fix follows below.

/Mikael

--- linux-2.3.21/drivers/parport/parport_pc.c.~1~ Sun Oct 10 12:40:41 1999
+++ linux-2.3.21/drivers/parport/parport_pc.c Tue Oct 12 13:10:24 1999
@@ -1207,7 +1207,7 @@

outb (ECR_SPP << 5, ECONTROL (pb)); /* Reset FIFO */
outb (0xf4, ECONTROL (pb)); /* Configuration mode */
- config = inb (FIFO (pb));
+ config = inb (CONFIGA (pb));
pword = (config >> 4) & 0x7;
switch (pword) {
case 0:
@@ -1230,10 +1230,10 @@
priv->pword = pword;
printk (KERN_DEBUG "0x%lx: PWord is %d bits\n", pb->base, 8 * pword);

- config = inb (CONFIGB (pb));
printk (KERN_DEBUG "0x%lx: Interrupts are ISA-%s\n", pb->base,
config & 0x80 ? "Level" : "Pulses");

+ config = inb (CONFIGB (pb));
if (!(config & 0x40)) {
printk (KERN_WARNING "0x%lx: IRQ conflict!\n", pb->base);
pb->irq = PARPORT_IRQ_NONE;

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/