[PATCH]: lp and parport as modules

PARMELAN Edouard (parmee@postecss.ncrfran.france.ncr.com)
Mon, 02 Jun 97 11:12:00 PDT


Since kernel 2.1.33, parallel port support is handled by the
parport
driver. I use lp an parport as modules.

1. With a fresh POWER
ON boot, parport and lp found one device:
Parallel port sharing:
$Revision: 1.3.2.4 $
parport0 at 0x378 [SPP,PS2]
parport0: no IEEE-1284
device present.
lp0: using parport0 at 0x378, polling.

2. After an init
6, parport don't found any devives:
Parallel port sharing: $Revision:
1.3.2.4 $
lp: driver loaded but no devices found

and I got 2 Oops. The
first un chrdev_open().

With kernel 2.1.4x, I got only the first Oops
and a SOLID LOCK.

The fallowing patch unregister driver lp if parport
don't found any
device.

This patch may apply to 2.1.33 to 2.1.42 (or
above
?).
[--------------------------------------------------------------------]

--- linux-2.1.42/drivers/char/lp.c Sat May 31 07:04:36 1997
+++
linux/drivers/char/lp.c Sat May 31 10:06:19 1997
@@ -723,7 +723,8 @@

if (count)
return 0;

- printk(KERN_INFO "lp: driver loaded
but no devices found\n");
+ unregister_chrdev(LP_MAJOR,
"lp");
+ printk(KERN_INFO "lp: driver not loaded, no devices found\n");

return 1;

}
[--------------------------------------------------------------------]


TODO: Why Oops did solid lock ?
ANSWER: After show_regsiters(),
die_if_kernel() did
do { int i=2000000000; while (i) i--; } while (0);

do { int i=2000000000; while (i) i--; } while (0);
call with kernel
locked by do_page_fault().
With my 386DX33 it's about 1 hours 8 ;-(
For
mips it's while(1); All others arch don't have this pause.
Only i386 use
spin_lock_irq(&die_lock) in die_if_kernel().

This patch may apply to
2.1.42.
[-----------------------------------------------------------------
---]
--- linux-2.1/arch/i386/kernel/traps.c Wed May 14 23:37:18 1997
+++
linux/arch/i386/kernel/traps.c Sat May 31 13:14:23 1997
@@ -191,8 +191,6
@@
spin_lock_irq(&die_lock);
printk("%s: %04lx\n", str, err &
0xffff);
show_registers(regs);
-do { int i=2000000000; while (i) i--; }
while (0);
-do { int i=2000000000; while (i) i--; } while (0);

spin_unlock_irq(&die_lock);
do_exit(SIGSEGV);

}
[--------------------------------------------------------------------]


TODO: Why parport don't found any device the second time ?
ANSWER: In my
configuration, I check CONFIG_PNP_PARPORT_AUTOPROBE,
I just remove it and
parport found device again ;-)

Happy
Hacking,
Edouard.Parmelan@France.NCR.COM