Bug 16153

Summary: no more parallel port zip drive
Product: Base System Reporter: Fritz Heinrichmeyer <jfh>
Component: kernAssignee: Nick Hibma <n_hibma>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.0-CURRENT   
Hardware: Any   
OS: Any   

Description Fritz Heinrichmeyer 2000-01-17 09:00:01 UTC
no contact to zip drive any more 
dmesg says:

ppc0: <Parallel port> at port 0x378-0x37f irq 7 on isa0
ppc0: Generic chipset (NIBBLE-only) in COMPATIBLE mode
pps0: <Pulse per second Timing Interface> on ppbus0
lpt0: <Printer> on ppbus0
lpt0: Interrupt-driven port
ppi0: <Parallel I/O> on ppbus0
vpo0: <Iomega VPI0 Parallel to SCSI interface> on ppbus0
vpo0: EPP 1.9 mode
vpo0: VP0 error/timeout (5)
vpo0: VP0 error/timeout (2)
vpo0: VP0 error/timeout (5)
vpo0: VP0 error/timeout (2)
vpo0: VP0 error/timeout (5)

Fix: 

no fix
How-To-Repeat: 	reboot
Comment 1 Jeroen Ruigrok van der Werven freebsd_committer freebsd_triage 2000-02-01 15:45:01 UTC
Responsible Changed
From-To: gnats-admin->freebsd-bugs
Comment 2 n_hibma 2000-04-04 23:21:20 UTC
I've spent some time trying to track this down, but failed
unfortunately.

As far as I can see the problem is somewhere in the inner
core of the
ppbus. The drive responds fairly normally and returns the 36
bytes CAM
requested (INQUIRY command). But then ppbus/vpo bails out
with a 
DATA_OVERFLOW error '...error/timeout (5)'.

Nick
Comment 3 n_hibma 2000-04-04 23:46:50 UTC
FYI, a piece of log file to show that the bug must be lower
down and most probably is not the drives fault:

vpo0: XPT_SCSI_IO (0x12) request
count = 0, r = 0xa8
count = 1, r = 0xa8
count = 2, r = 0xa8
....
count = 35, r = 0xa8
count = 36, r = 0xa8
vpo_do_scsi = 0, status = 0x0, count = 36, vpo_error = 5
12 0 0 0 24 0
vpo0: VP0 error/timeout (5)
vpo0: XPT_SCSI_IO (0x12) request
vpo_do_scsi = 0, status = 0x0, count = 36, vpo_error = 2
12 0 0 0 24 0
vpo0: VP0 error/timeout (2)
vpo0: XPT_SCSI_IO (0x12) request
vpo_do_scsi = 0, status = 0x0, count = 36, vpo_error = 2
12 0 0 0 24 0
count = 36, r = 0xa8
vpo_do_scsi = 0, status = 0x0, count = 36, vpo_error = 5
12 0 0 0 24 0
vpo0: VP0 error/timeout (5)
vpo0: XPT_SCSI_IO (0x12) request
vpo_do_scsi = 0, status = 0x0, count = 36, vpo_error = 2
12 0 0 0 24 0
vpo0: VP0 error/timeout (2)

The last error is most probably caused by the fact that the
drive is confused.

When count = 36, r should have been 0xb8.

Nick
Comment 4 n_hibma 2000-04-05 11:35:23 UTC
I've seen reports of this problem happening with EPP
and "PS/2" mode on the parallel port (I have no idea
what "PS/2" mode on a parallel port would be though).
Comment 5 Nicolas Souchu freebsd_committer freebsd_triage 2000-04-20 22:31:54 UTC
The error is due to the mode of the parallel port.

ppc driver detects NIBBLE (also called compatible) but the ZIP driver
thinks the parallel port is in EPP mode. The ZIP protocol is
completly different from one to another.

So I guess that NIBBLE is right and EPP false.

The problem comes certainly from one of the functions in the ppbus
framework that returns the available modes of the parallel port to
the zip driver.

Either the ppc didn't initialize the info. correctly or the ppbus
functions interpret it incorrectly.

Nicholas

nsouch@freebsd.org
Comment 6 Nick Hibma freebsd_committer freebsd_triage 2000-08-06 22:46:10 UTC
State Changed
From-To: open->feedback

Feedback requested (in previous submission to PR)
Comment 7 n_hibma 2000-08-06 22:46:14 UTC
A patch has been committed to CURRENT (rev. 1.10 of
dev/ppbus/ppb_base.c) and STABLE (rev. 1.10.2.1 of same file). Diff
attached below.

Let me know if that fixed the problem for you.

Nick

===================================================================
RCS file: /home/ncvs/src/sys/dev/ppbus/ppb_base.c,v
retrieving revision 1.10.2.1
retrieving revision 1.10
diff -wu -r1.10.2.1 -r1.10
--- src/sys/dev/ppbus/ppb_base.c        2000/08/01 23:26:26     1.10.2.1
+++ /home/ncvs/src/sys/dev/ppbus/ppb_base.c     2000/01/14 00:17:54    
1.10
@@ -131,11 +131,10 @@
        struct ppb_data *ppb = DEVTOSOFTC(bus);
        int old_mode = ppb_get_mode(bus);
 
-       if (PPBUS_SETMODE(device_get_parent(bus), mode))
-               return -1;
-
+       if (!PPBUS_SETMODE(device_get_parent(bus), mode)) {
                /* XXX yet device mode = ppbus mode = chipset mode */
                ppb->mode = (mode & PPB_MASK);
+       }
 
        return (old_mode);
 }
-- 
Work: n_hibma@qubesoft.com             Personal: n_hibma@webweaving.org
Comment 8 Nick Hibma freebsd_committer freebsd_triage 2000-08-06 22:56:13 UTC
Responsible Changed
From-To: freebsd-bugs->n_hibma

Remind me to close this PR.
Comment 9 Nick Hibma freebsd_committer freebsd_triage 2000-08-13 13:24:53 UTC
State Changed
From-To: feedback->closed

The stated fix has been MFC-ed into 4.1STABLE