Subject: port-i386/1200: bug in mcd driver
To: None <gnats-admin@sun-lamp.pc.cs.cmu.edu>
From: None <onno@simplex.nl>
List: netbsd-bugs
Date: 07/09/1995 04:35:04
>Number: 1200
>Category: port-i386
>Synopsis: Mitsimu FX001D times out reading large files
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: gnats-admin (GNATS administrator)
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sun Jul 9 04:35:02 1995
>Originator: & van der Linden
>Organization:
>Release: July 8 1995
>Environment:
System: NetBSD sheep 1.0A NetBSD 1.0A (SHEEP) #1: Sat Jul 8 20:57:42 MET DST 1995 root@sheep:/usr/src/sys/arch/i386/compile/SHEEP i386
>Description:
With a Mitsumu FX001D CD-ROM the mcd driver reports a timeout and
"timeout + giving up" while reading large (> 1 Mb) files from the CD.
>How-To-Repeat:
1. Get the CD that comes with the UNIX System Administration Handbook
(Nemeth et al., 2nd ed. Prentice Hall)
2. mount -r -t cd9660 /dev/mcd0a /cdrom
3. cat /cdrom/news/nn.tar > /dev/null or
cat /cdrom/sysadm/amd.tar > /dev/null
>Fix:
Use the double speed read opcode with the FX001D for read commands,
just like the FreeBSD-current driver does at the moment.
*** /usr/src/sys/dev/isa/mcdreg.h.orig Tue Mar 28 23:43:48 1995
--- /usr/src/sys/dev/isa/mcdreg.h Tue Jul 4 20:46:21 1995
***************
*** 130,134 ****
#define MCD_CMDSETVOLUME 0xae /* sets mcd_volume */
#define MCD_CMDREAD1 0xb0 /* read n sectors */
! #define MCD_CMDREAD2 0xc0 /* read from-to */
#define MCD_CMDGETDRIVEMODE 0xc2 /* get drive mode */
#define MCD_CMDREAD3 0xc3 /* ? */
--- 130,135 ----
#define MCD_CMDSETVOLUME 0xae /* sets mcd_volume */
#define MCD_CMDREAD1 0xb0 /* read n sectors */
! #define MCD_CMDREADSINGLESPEED 0xc0 /* read from-to single speed */
! #define MCD_CMDREADDOUBLESPEED 0xc1 /* read from-to double speed */
#define MCD_CMDGETDRIVEMODE 0xc2 /* get drive mode */
#define MCD_CMDREAD3 0xc3 /* ? */
*** /usr/src/sys/dev/isa/mcd.c.orig Mon Jun 26 15:47:30 1995
--- /usr/src/sys/dev/isa/mcd.c Tue Jul 4 20:51:35 1995
***************
*** 115,118 ****
--- 115,119 ----
char *type;
+ u_char readcmd;
int flags;
#define MCDF_LOCKED 0x01
***************
*** 744,747 ****
--- 745,749 ----
* Note: Which models support interrupts? >=LU005S?
*/
+ sc->readcmd = MCD_CMDREADSINGLESPEED;
switch (mbx.res.data.continfo.code) {
case 'M':
***************
*** 758,761 ****
--- 760,764 ----
case 'D':
sc->type = "FX001D";
+ sc->readcmd = MCD_CMDREADDOUBLESPEED;
break;
default:
***************
*** 1036,1040 ****
/* Send the read command. */
! outb(iobase + MCD_COMMAND, MCD_CMDREAD2);
outb(iobase + MCD_COMMAND, msf[0]);
outb(iobase + MCD_COMMAND, msf[1]);
--- 1039,1043 ----
/* Send the read command. */
! outb(iobase + MCD_COMMAND, sc->readcmd);
outb(iobase + MCD_COMMAND, msf[0]);
outb(iobase + MCD_COMMAND, msf[1]);
***************
*** 1509,1513 ****
return error;
! mbx.cmd.opcode = MCD_CMDREAD2;
mbx.cmd.length = sizeof(mbx.cmd.data.play);
mbx.cmd.data.play.start_msf[0] = sc->toc[a].toc.absolute_pos[0];
--- 1512,1516 ----
return error;
! mbx.cmd.opcode = MCD_CMDREADSINGLESPEED;
mbx.cmd.length = sizeof(mbx.cmd.data.play);
mbx.cmd.data.play.start_msf[0] = sc->toc[a].toc.absolute_pos[0];
***************
*** 1543,1547 ****
return error;
! mbx.cmd.opcode = MCD_CMDREAD2;
mbx.cmd.length = sizeof(mbx.cmd.data.play);
mbx.cmd.data.play.start_msf[0] = bin2bcd(p->start_m);
--- 1546,1550 ----
return error;
! mbx.cmd.opcode = MCD_CMDREADSINGLESPEED;
mbx.cmd.length = sizeof(mbx.cmd.data.play);
mbx.cmd.data.play.start_msf[0] = bin2bcd(p->start_m);
***************
*** 1575,1579 ****
return error;
! mbx.cmd.opcode = MCD_CMDREAD2;
mbx.cmd.length = sizeof(mbx.cmd.data.play);
hsg2msf(p->blk, mbx.cmd.data.play.start_msf);
--- 1578,1582 ----
return error;
! mbx.cmd.opcode = MCD_CMDREADSINGLESPEED;
mbx.cmd.length = sizeof(mbx.cmd.data.play);
hsg2msf(p->blk, mbx.cmd.data.play.start_msf);
>Audit-Trail:
>Unformatted: