trouble with parport 980101

Trevor Johnson (trevor@jpj.net)
Thu, 1 Jan 1998 23:57:37 -0500 (EST)


I applied the parport-980101 patch and configured my 2.1.76 kernel with
CONFIG_PARPORT=m, CONFIG_PARPORT_PC=m, and CONFIG_PRINTER=m but
compilation stopped with:

gcc -D__KERNEL__ -I/usr/src/linux/include -Wall -Wstrict-prototypes -O2
-fomit-frame-pointer -pipe -fno-strength-reduce -m486 -malign-loops=2
-malign-jumps=2 -malign-functions=2 -DCPU=586 -DMODULE -c -o
parport_share.o parport_share.c
parport_share.c: In function `parport_claim':
parport_share.c:268: warning: passing arg 1 of `set_bit' makes integer
from pointer without a cast
parport_share.c:268: warning: passing arg 2 of `set_bit' makes pointer
from integer without a cast
parport_share.c:268: void value not ignored as it ought to be

I made this change, with which the parport code compiled cleanly:

/drivers/misc/parport_share.c-980101 linux/drivers/misc/parport_share.c
--- linux/drivers/misc/parport_share.c-980101 Thu Jan 1 18:30:20 1998
+++ linux/drivers/misc/parport_share.c Thu Jan 1 18:49:49 1998
@@ -265,7 +265,7 @@
return 0;
}

- if (set_bit(&dev->waiting, 1) == 0) {
+ if (test_and_set_bit((int)&dev->waiting, (int *)1) == 0) {
atomic_inc(&dev->port->waiters);
dev->time = jiffies;
}

I booted the new kernel, used modprobe to load parport.o then
parport_pc.o, then lp.o, then ran lpd. These messages were logged:

parport0: PC-style at 0x378 [SPP,PS2]
parport1: PC-style at 0x278 [SPP]

When I submitted a job to lpr, I got this oops:

Using `System-2.1.76.map' to map addresses to symbols.

Unable to handle kernel paging request at virtual address f8292325
current->tss.cr3 = 012e6000, %cr3 = 012e6000
*pde = 00000000
Oops: 0000
CPU: 0
EIP: 0010:[<c284e457>]
EFLAGS: 00010207
eax: c1491934 ebx: c1af8a00 ecx: bffff684 edx: c1af8a00
esi: 00000000 edi: c1491900 ebp: 00000000 esp: c1125f30
ds: 0018 es: 0018 ss: 0018
Process lpd (pid: 164, process nr: 38, stackpage=c1125000)
Stack: c1491900 00000000 ffffffea c284e584 c1491900 00000000 c285428a
c1491900
c1227ea0 c1668044 ffffffea c1668000 fffffff2 00000000 00000000
00000004
00000000 00012000 00000000 00000001 00000001 00000000 000002ba
000002ba
Call Trace: [<c284e584>] [<c285428a>] [<c01238ee>] [<c01239f0>]
[<c0109956>]
Code: 0f ab 05 01 00 00 00 19 c0 85 c0 75 11 8b 47 04 8d 50 2c ff
>>EIP: c284e457 cannot be resolved
Trace: c284e584
Trace: c285428a
Trace: c01238ee <sys_read+ba/104>
Trace: c01239f0 <sys_write+b8/108>
Trace: c0109956 <system_call+3a/40>
Code:
Code: 0f ab 05 01 00 btsl %eax,0x1
Code: 19 c0 sbbl %eax,%eax
Code: 85 c0 testl %eax,%eax
Code: 75 11 jne 1e <_EIP+1e>
Code: 8b 47 04 movl 0x4(%edi),%eax
Code: 8d 50 2c leal 0x2c(%eax),%edx
Code: ff 00 incl (%eax)
Code: 90 nop
Code: 90 nop
Code: 90 nop

Using the parport code that shipped with the 2.1.72 kernel, built into the
kernel rather than as a module, I have no problems.

A copy of any reply would be welcome, since I'm not on the parport list.
___
Trevor Johnson