From owner-FreeBSD-users-jp@jp.freebsd.org  Fri Feb 14 21:11:27 1997
Received: by jaz.jp.freebsd.org (8.8.5+2.7Wbeta5/8.7.3) id VAA13673
	Fri, 14 Feb 1997 21:11:27 +0900 (JST)
Received: by jaz.jp.freebsd.org (8.8.5+2.7Wbeta5/8.7.3) with SMTP id VAA13665
	for <FreeBSD-users-jp@jp.freebsd.org>; Fri, 14 Feb 1997 21:11:24 +0900 (JST)
Received: from ccs02.sfc.keio.ac.jp by mail0 (5.67+1.6W/2.7W)
	id AA29366; Fri, 14 Feb 97 17:48:59 +0900
Received: by ccs02.sfc.keio.ac.jp (5.67+1.6W/6.4J.6-sfc0)
	id AA20595; Fri, 14 Feb 97 17:48:58 +0900
Message-Id: <9702140848.AA20595@ccs02.sfc.keio.ac.jp>
From: Takaaki Nomura (=?ISO-2022-JP?B?GyRCTG5CPDliTEAbKEI=?= ) <tnomura@sfc.keio.ac.jp>
To: FreeBSD-users-jp@jp.freebsd.org
In-Reply-To: Your message of "Fri, 14 Feb 1997 17:03:51 JST"
References: <199702140803.RAA14727@mx1.osk.threewebnet.or.jp> 
Mime-Version: 1.0
Content-Type: text/plain;charset="ISO-2022-JP"
Date: Fri, 14 Feb 1997 17:48:57 +0900
Reply-To: FreeBSD-users-jp@jp.freebsd.org
Precedence: bulk
X-Distribute: distribute [version 2.1 (Alpha) patchlevel=19]
X-Sequence: FreeBSD-users-jp 9806
Subject: [FreeBSD-users-jp 9806] Re: [Q}HITACHI VS TOSHIBA (about E-IDE CD-ROM) 
Errors-To: owner-FreeBSD-users-jp@jp.freebsd.org
Sender: owner-FreeBSD-users-jp@jp.freebsd.org

$BLnB<!w7DBg$G$9!#(B

><$BG'<1$7$J$$(BCD-ROM>
>wdc0 at 0x1f0-0x1f7 irq 14 on isa
>wdc0: unit 0 (wd0): <QUANTUM FIREBALL1280A>
>wd0: 1222MB(2503872 sectors), 2484cyls, 16 heads, 63 S/T, 512 B/S
>wdc0: unit1(atapi) <HITACHI CDR-7730/0008c>, removable, iordy
>wcd0: 689Kb/sec, 128Kb cache, audio play, 128 volume levels, ejectable tray
>wcd0: medium type unknown, unlocked
>wdc1 not found at 0x170
>
> "medium type unknown"$B$H$$$&$3$H$O$d$O$j$3$N(BCD-ROM$B$OBP1~$7$F$$$J$$$H$$$&(B
>$B$3$H$J$N$G$7$g$&$+!)(B
> $B$J$K$+$4B8CN$NJ}!">pJs$r$*4j$$$$$?$7$^$9(B m(..)m

  http://www.freebsd.org/search.html $B$G8!:w$7$F$_$?$H$3$m!"0J2<$N>pJs$,(B
$B$"$j$^$7$?!#$*Lr$KN)$D$+$OJ,$+$j$^$;$s$,!#(B

-------------------------------------------------------------------------
Date:      Sun, 6 Oct 1996 00:17:10 -0300 (EST)
From:      dcs@gns.com.br
To:        FreeBSD-gnats-submit@freebsd.org
Sender:    owner-bugs@freebsd.org
Subject:   i386/1730: ATAPI driver does not work with HITACHI CDR-7730

>Number:         1730
>Category:       i386
>Synopsis:       SFF8020 violation and silly bug in atapi.c hinder it's working with HITACHI CDR-7730
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Oct  5 20:20:02 PDT 1996
>Last-Modified:
>Originator:     Daniel C. Sobral
>Organization:
>Release:        FreeBSD 2.2-961004-SNAP i386
>Environment:


960801-SNAPSHOT with current (961004) kernel and HITACHI CDR-7730
CD-ROM drive (slave in secondary IDE).

>Description:


The drive gets recognized but wcd_describe is rarely called, and
even when that happens you can't mount the drive.

This happens because a DELAY is missing in one loop, and ARS_BSY
flag is being ignored in another (atapi_request_immediate and
atapi_wait_cmd functions).

>How-To-Repeat:


Install an HITACHI CDR-7730 CD-ROM drive as slave in the secondary IDE
(well, I haven't tried other setups... :), configure ATAPI options in the
kernel, reboot.

dmesg | grep wcd0                       #Shows nothing most of the time
mount -t cd9660 -r /dev/wcd0c /mnt      #Won't work

>Fix:


Apply this patch (unified diff):

--- atapi.c     1996/10/05 21:06:44     1.1
+++ atapi.c     1996/10/06 02:25:16     1.1.1.2
@@ -585,7 +585,7 @@
                ireason = inb (ata->port + AR_IREASON);
                ac->result.status = inb (ata->port + AR_STATUS);
                phase = (ireason & (ARI_CMD | ARI_IN)) |
-                       (ac->result.status & ARS_DRQ);
+                       (ac->result.status & (ARS_DRQ|ARS_BSY));
                if (phase == PHASE_CMDOUT)
                        break;
                DELAY (10);
@@ -898,8 +898,11 @@
                while (atapi_io (ata, ac))
                        /* Wait for DRQ deassert. */
                        for (cnt=2000; cnt>0; --cnt)
+                               {
                                if (! (inb (ata->port + AR_STATUS) & ARS_DRQ))
                                        break;
+                               DELAY(10);
+                               }
        }
        return (ac->result);
 }
>Audit-Trail:
>Unformatted:

----------------------------------------------------------------------------
----------------------------------------------------------------------------
www@freebsd.org                                          [FreeBSD Home Page]
