Subject: kern/22771: eject(1) fails with ATAPI CD-ROM devices
To: None <gnats-bugs@gnats.netbsd.org>
From: Matthias Scheler <tron@colwyn.zhadum.de>
List: netbsd-bugs
Date: 09/13/2003 09:51:50
>Number:         22771
>Category:       kern
>Synopsis:       eject(1) fails with ATAPI CD-ROM devices
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Sep 13 07:52:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     
>Release:        NetBSD 1.6Z (2003-09-12 sources)
>Organization:
Matthias Scheler                                  http://scheler.de/~matthias/
>Environment:
System: NetBSD lyssa.zhadum.de 1.6Z NetBSD 1.6Z (LYSSA) #0: Fri Sep 12 13:12:52 CEST 2003 tron@lyssa.zhadum.de:/src/sys/compile/LYSSA i386
Architecture: i386
Machine: i386
>Description:
I got an ATAPI CD-ROM and an ATAPI CD-Writer in my NetBSD-current system:

cd0 at atapibus0 drive 0: <Pioneer DVD-ROM ATAPIModel DVD-120S, , 1.01> cdrom removable
cd0: 32-bit data port
cd0: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 4 (Ultra/66)
cd1 at atapibus0 drive 1: <PLEXTOR CD-R   PX-W2410A, 379089, 1.04> cdrom removable
cd1: 32-bit data port
cd1: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 2 (Ultra/33)
cd0(pciide0:1:0): using PIO mode 4, Ultra-DMA mode 2 (Ultra/33) (using DMA data transfers)
cd1(pciide0:1:1): using PIO mode 4, Ultra-DMA mode 2 (Ultra/33) (using DMA data transfers)

It was always possible to open and close the drives with the "eject" command.
With a kernel built from yesterday's sources this doesn't work anymore:

tron@lyssa:~>eject cd0   
eject: open: /dev/rcd0d: Operation not supported by device
tron@lyssa:~>eject -l cd0
eject: open: /dev/rcd0d: Operation not supported by device
tron@lyssa:~>eject cd1    
eject: open: /dev/rcd1d: Operation not supported by device
tron@lyssa:~>eject -l cd1
eject: open: /dev/rcd1d: Operation not supported by device

Here is "ktruss" output:

  1202 eject    open("/dev/rcd1d", 0, 0xbfbff5a0)  Err#19 ENODEV
  1202 eject    write(0x2, 0xbfbfeb70, 0x7)        = 7
       "eject: "
  1202 eject    write(0x2, 0xbfbfeba0, 0x10)       = 16
       "open: /dev/rcd1d"
  1202 eject    write(0x2, 0xbfbfeb60, 0x2)        = 2
       ": "
  1202 eject    issetugid                          = 0
  1202 eject    issetugid                          = 0
  1202 eject    open("/usr/share/nls/nls.alias", 0, 0x1b6) = 3
  1202 eject    __fstat13(0x3, 0xbfbfea5c)         = 0
  1202 eject    break(0x804f000)                   = 0
  1202 eject    read(0x3, 0x804d000, 0x2000)       = 1520
       "# $NetBSD: nls.alias,v 1.3 2003/04/14 05:21:51 salo Exp $\n#\n# This "
  1202 eject    read(0x3, 0x804d000, 0x2000)       = 0
  1202 eject    close(0x3)                         = 0
  1202 eject    open("/usr/share/nls/C/libc.cat", 0, 0xbfbfeb6c) = 3
  1202 eject    __fstat13(0x3, 0xbfbfeb5c)         = 0
  1202 eject    mmap(0, 0x103b, 0x1, 0x1, 0x3, 0, 0, 0) = 1209102336
  1202 eject    close(0x3)                         = 0
  1202 eject    munmap(0x48117000, 0x103b)         = 0
  1202 eject    write(0x2, 0xbfbfeb60, 0x22)       = 34
       "Operation not supported by device\n"

>How-To-Repeat:
eject cd0
eject -l cd0

>Fix:
None provided.

>Release-Note:
>Audit-Trail:
>Unformatted: