Subject: pkg/36029: dvd+rw-booktype from dvd+rw-tools causes Pioneer DVR-107D to lock up
To: None <pkg-manager@netbsd.org, gnats-admin@netbsd.org,>
From: None <svs+pr@grep.ru>
List: pkgsrc-bugs
Date: 03/18/2007 13:55:00
>Number:         36029
>Category:       pkg
>Synopsis:       dvd+rw-booktype from dvd+rw-tools causes Pioneer DVR-107D to lock up
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Mar 18 13:55:00 +0000 2007
>Originator:     svs+pr@grep.ru
>Release:        NetBSD 4.0_BETA2
>Organization:
>Environment:
	
	
piixide0 at pci0 dev 31 function 1
piixide0: Intel 82801EB IDE Controller (ICH5) (rev. 0x02)
piixide0: bus-master DMA support present
piixide0: primary channel configured to compatibility mode
piixide0: primary channel interrupting at ioapic0 pin 14 (irq 14)
atabus2 at piixide0 channel 0
atapibus0 at atabus2: 2 targets
cd1 at atapibus0 drive 1: <PIONEER DVD-RW  DVR-107D, DCDL321903WL, 1.16> cdrom removable
cd1: 32-bit data port
cd1: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 2 (Ultra/33)
cd1(piixide0:0:1): using PIO mode 4, Ultra-DMA mode 2 (Ultra/33) (using DMA)

>Description:
Pioneer drives do not support bitsetting (which dvd+rw-booktype is all
about), but at least one of them locks up itself (and takes thes bus
with it) when dvd+rw-booktype sends it a Benq-specific command.  Machine
is nearly unusable for minutes after this -- kernel tries to reset ATAPI
bus and times out every time.

>How-To-Repeat:
	
>Fix:
	
--- dvd+rw-booktype.cpp.orig	2006-06-24 09:21:48.000000000 +0000
+++ dvd+rw-booktype.cpp
@@ -669,7 +669,7 @@ int main(int argc,char *argv[])
   unsigned char buf[128];
   int book=0,action=0;
   int plusgeneration=0,dashcapable=0,ramcapable=0;
-  int i,err,hp=0,plx=0;
+  int i,err,hp=0,plx=0,pioneer=0;
 
     for(dev=NULL,i=1;i<argc;i++)
     {	if	(!strncmp (argv[i],"-dvd-rom",7))   book=0x01;
@@ -719,6 +719,7 @@ int main(int argc,char *argv[])
     hp =       !memcmp (buf+8,"HP      ",8);
     hp = hp || !memcmp (buf+8,"_NEC    ",8);
     plx =      !memcmp (buf+8,"PLEXTOR ",8);
+    pioneer =  !memcmp (buf+8,"PIONEER ",8);
 
     cmd[0]=0x46;	// GET CONFIGURATION
     cmd[1]=2;
@@ -811,6 +812,8 @@ int main(int argc,char *argv[])
 
     benq:
 	// See if it's BENQ design...
+	// Pioneer DVR-107D locks up itself and ATAPI bus too
+	if (!pioneer) {
 	cmd[0]=0xFD;
 	cmd[1]=0xF1;
 	cmd[2]='B';
@@ -820,6 +823,7 @@ int main(int argc,char *argv[])
 	cmd[11]=0;
 	if (!(err=cmd.transport()))
 	    return benq (cmd,action,book,plusgeneration);
+	}
     }
 
     fprintf (stderr,"This program targets units of "

>Unformatted: