Date: Sun, 6 Oct 1996 00:17:10 -0300 (EST) From: dcs@gns.com.br To: FreeBSD-gnats-submit@freebsd.org Subject: i386/1730: ATAPI driver does not work with HITACHI CDR-7730 Message-ID: <199610060317.AAA00626@daniel.sobral> Resent-Message-ID: <199610060320.UAA03424@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>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:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199610060317.AAA00626>
