From owner-freebsd-current@FreeBSD.ORG Sat Sep 6 12:41:12 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8A35B16A4BF for ; Sat, 6 Sep 2003 12:41:12 -0700 (PDT) Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id 23C8943F3F for ; Sat, 6 Sep 2003 12:41:11 -0700 (PDT) (envelope-from bde@zeta.org.au) Received: from katana.zip.com.au (katana.zip.com.au [61.8.7.246]) by mailman.zeta.org.au (8.9.3p2/8.8.7) with ESMTP id FAA01801; Sun, 7 Sep 2003 05:41:01 +1000 Date: Sun, 7 Sep 2003 05:41:00 +1000 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Pav Lucistnik In-Reply-To: <1062856314.734.8.camel@hood.oook.cz> Message-ID: <20030907052713.E11673@delplex.bde.org> References: <1062856314.734.8.camel@hood.oook.cz> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-current@freebsd.org Subject: Re: ATAng regression: cdcontrol close not working X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Sep 2003 19:41:12 -0000 On Sat, 6 Sep 2003, Pav Lucistnik wrote: > after recent ATAng changes, cdcontrol close stopped working > with my CD-ROM drive. It used to close the tray. It works with -f > /dev/cd0 but not with /dev/acd0. cdcontrol eject still works fine. I use the following fix: %%% Index: atapi-cd.c =================================================================== RCS file: /home/ncvs/src/sys/dev/ata/atapi-cd.c,v retrieving revision 1.142 diff -u -2 -r1.142 atapi-cd.c --- atapi-cd.c 5 Sep 2003 10:40:16 -0000 1.142 +++ atapi-cd.c 6 Sep 2003 17:16:16 -0000 @@ -1870,7 +1913,7 @@ int error; - if ((error = acd_start_stop(cdp, 0)) == EBUSY) { + if ((error = acd_start_stop(cdp, 0)) == EBUSY || close) { if (!close) - return 0; + return EBUSY; if ((error = acd_start_stop(cdp, 3))) return error; @@ -1882,6 +1925,4 @@ if (error) return error; - if (close) - return 0; acd_prevent_allow(cdp, 0); cdp->flags &= ~F_LOCKED; %%% acd_eject() doesn't seem to have been changed by ATAng, so I don't see how close it could have ever worked, but I seem to remember it working. > Relevant dmesg parts: > ... > cd0 at ata1 bus 0 target 0 lun 0 > cd0: Removable CD-ROM SCSI-0 device > cd0: 16.000MB/s transfers > cd0: cd present [357072 x 2048 byte records] > > I do have atapicam in my kernel. Close works on cd0 and cd1 for me without the above patch. The code for eject and close in scsi_cd.c is easier to understand. Bruce