From owner-freebsd-bugs Sat Oct 5 20:20:05 1996 Return-Path: owner-bugs Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id UAA03441 for bugs-outgoing; Sat, 5 Oct 1996 20:20:05 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id UAA03424; Sat, 5 Oct 1996 20:20:03 -0700 (PDT) Resent-Date: Sat, 5 Oct 1996 20:20:03 -0700 (PDT) Resent-Message-Id: <199610060320.UAA03424@freefall.freebsd.org> Resent-From: gnats (GNATS Management) Resent-To: freebsd-bugs Resent-Reply-To: FreeBSD-gnats@freefall.FreeBSD.org, dcs@gns.com.br Received: from daniel.sobral (dl0123-bsb.GNS.com.br [200.239.56.123]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id UAA02694 for ; Sat, 5 Oct 1996 20:15:33 -0700 (PDT) Received: (from root@localhost) by daniel.sobral (8.7.5/8.7.3) id AAA00626; Sun, 6 Oct 1996 00:17:10 -0300 (EST) Message-Id: <199610060317.AAA00626@daniel.sobral> Date: Sun, 6 Oct 1996 00:17:10 -0300 (EST) From: dcs@gns.com.br Reply-To: dcs@gns.com.br To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: i386/1730: ATAPI driver does not work with HITACHI CDR-7730 Sender: owner-bugs@freebsd.org X-Loop: FreeBSD.org Precedence: bulk >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: