From hohmuth@olymp.sax.de  Tue Nov 24 19:39:57 1998
Received: from sax.sax.de (sax.sax.de [193.175.26.33])
          by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id TAA17569
          for <FreeBSD-gnats-submit@freebsd.org>; Tue, 24 Nov 1998 19:39:55 -0800 (PST)
          (envelope-from hohmuth@olymp.sax.de)
Received: (from uucp@localhost)
	by sax.sax.de (8.8.8/8.8.8) with UUCP id EAA04650
	for FreeBSD-gnats-submit@freebsd.org; Wed, 25 Nov 1998 04:39:50 +0100 (CET)
	(envelope-from hohmuth@olymp.sax.de)
Received: (from hohmuth@localhost)
	by olymp.sax.de (8.8.8/8.8.8) id EAA00689;
	Wed, 25 Nov 1998 04:33:25 +0100 (CET)
	(envelope-from hohmuth)
Message-Id: <199811250333.EAA00689@olymp.sax.de>
Date: Wed, 25 Nov 1998 04:33:25 +0100 (CET)
From: hohmuth@inf.tu-dresden.de
Reply-To: hohmuth@inf.tu-dresden.de
To: FreeBSD-gnats-submit@freebsd.org
Subject: can't mount CD in ATAPI drive after eject/reload
X-Send-Pr-Version: 3.2

>Number:         8855
>Category:       i386
>Synopsis:       can't mount CD in ATAPI drive after eject/reload
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    sos
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Nov 24 19:50:01 PST 1998
>Closed-Date:    Mon Feb 28 11:28:01 PST 2000
>Last-Modified:  Mon Feb 28 11:28:27 PST 2000
>Originator:     Michael Hohmuth
>Release:        FreeBSD 2.2.7-STABLE i386
>Organization:
none
>Environment:
	
"uname -a" says:

    FreeBSD olymp.sax.de 2.2.7-STABLE FreeBSD 2.2.7-STABLE #1: 
    Wed Nov 25 03:45:12 CET 1998     
    root@olymp.sax.de:/usr/src/sys/compile/OLYMPISDN  i386

I've updated the atapi.c driver with some changes from
FreeBSD-current.  This doesn't change the behaviour, though.

/var/log/dmesg.today contains:

    wdc0 at 0x1f0-0x1f7 irq 14 on isa
    wdc0: unit 0 (atapi): <IDE-1 REV.1.05  9-20-94/DOLPHIN>, removable
    atapi0.0: unknown phase

/etc/fstab contains:
    /dev/wcd0c              /cdrom          cd9660  ro,noauto       0       0


>Description:
	
I can't mount a CD-ROM inserted after the system has been booted:

    # mount /cdrom
    cd9660: /dev/cdrom: Input/output error

A CD-ROM which has been loaded before booting FreeBSD can be mounted
just fine.

Below I include some kernel output which shows a first "mount /cdrom"
which succeeds, an "umount", an eject/reload, and another "mount /cdrom"
which fails with an I/O error.  

The "error=20" messages at the end of the output or the "atapi0.0:
unknown phase" message which appears at boot time maybe are connected
to the problem in some way?


# cdcontrol -f /dev/cdrom debug on

atapi0.0: req w 1e-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0 len=0
atapi0.0: start
atapi0.0: send cmd PREVENT_ALLOW 1e-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0
atapi0.0: intr ireason=0x3, len=0, status=50<ready,opdone>, error=0

# mount /cdrom

atapi0.0: req w 0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0 len=0
atapi0.0: start
atapi0.0: send cmd TEST_UNIT_READY 0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0
atapi0.0: intr ireason=0x3, len=0, status=50<ready,opdone>, error=0
atapi0.0: req w 43-0-0-0-0-0-0-0-c-0-0-0-0-0-0-0 len=12
atapi0.0: start
atapi0.0: send cmd READ_TOC 43-0-0-0-0-0-0-0-c-0-0-0-0-0-0-0
atapi0.0: intr ireason=0x2, len=12, status=58<ready,opdone,drq>, error=0
atapi0.0: intr ireason=0x3, len=0, status=50<ready,opdone>, error=0
atapi0.0: req w 43-0-0-0-0-0-0-0-c-0-0-0-0-0-0-0 len=12
atapi0.0: start
atapi0.0: send cmd READ_TOC 43-0-0-0-0-0-0-0-c-0-0-0-0-0-0-0
atapi0.0: intr ireason=0x2, len=12, status=58<ready,opdone,drq>, error=0
atapi0.0: intr ireason=0x3, len=0, status=50<ready,opdone>, error=0
atapi0.0: req w 25-0-0-0-0-0-0-0-8-0-0-0-0-0-0-0 len=8
atapi0.0: start
atapi0.0: send cmd READ_CAPACITY 25-0-0-0-0-0-0-0-8-0-0-0-0-0-0-0
atapi0.0: intr ireason=0x2, len=8, status=58<ready,opdone,drq>, error=0
atapi0.0: intr ireason=0x3, len=0, status=50<ready,opdone>, error=0
atapi0.0: req w 1e-0-0-0-1-0-0-0-0-0-0-0-0-0-0-0 len=0
atapi0.0: start
atapi0.0: send cmd PREVENT_ALLOW 1e-0-0-0-1-0-0-0-0-0-0-0-0-0-0-0
atapi0.0: intr ireason=0x3, len=0, status=50<ready,opdone>, error=0
atapi0.0: req w 1e-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0 len=0
atapi0.0: start
atapi0.0: send cmd PREVENT_ALLOW 1e-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0
atapi0.0: intr ireason=0x3, len=0, status=50<ready,opdone>, error=0
atapi0.0: req w 0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0 len=0
atapi0.0: start
atapi0.0: send cmd TEST_UNIT_READY 0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0
atapi0.0: intr ireason=0x3, len=0, status=50<ready,opdone>, error=0
atapi0.0: req w 43-0-0-0-0-0-0-0-c-0-0-0-0-0-0-0 len=12
atapi0.0: start
atapi0.0: send cmd READ_TOC 43-0-0-0-0-0-0-0-c-0-0-0-0-0-0-0
atapi0.0: intr ireason=0x2, len=12, status=58<ready,opdone,drq>, error=0
atapi0.0: intr ireason=0x3, len=0, status=50<ready,opdone>, error=0
atapi0.0: req w 43-0-0-0-0-0-0-0-c-0-0-0-0-0-0-0 len=12
atapi0.0: start
atapi0.0: send cmd READ_TOC 43-0-0-0-0-0-0-0-c-0-0-0-0-0-0-0
atapi0.0: intr ireason=0x2, len=12, status=58<ready,opdone,drq>, error=0
atapi0.0: intr ireason=0x3, len=0, status=50<ready,opdone>, error=0
atapi0.0: req w 25-0-0-0-0-0-0-0-8-0-0-0-0-0-0-0 len=8
atapi0.0: start
atapi0.0: send cmd READ_CAPACITY 25-0-0-0-0-0-0-0-8-0-0-0-0-0-0-0
atapi0.0: intr ireason=0x2, len=8, status=58<ready,opdone,drq>, error=0
atapi0.0: intr ireason=0x3, len=0, status=50<ready,opdone>, error=0
atapi0.0: req w 1e-0-0-0-1-0-0-0-0-0-0-0-0-0-0-0 len=0
atapi0.0: start
atapi0.0: send cmd PREVENT_ALLOW 1e-0-0-0-1-0-0-0-0-0-0-0-0-0-0-0
atapi0.0: intr ireason=0x3, len=0, status=50<ready,opdone>, error=0
atapi0.0: req cb 28-0-0-0-0-10-0-0-1-0-0-0-0-0-0-0 len=2048
atapi0.0: start
atapi0.0: send cmd READ_BIG 28-0-0-0-0-10-0-0-1-0-0-0-0-0-0-0
atapi0.0: intr ireason=0x2, len=2048, status=58<ready,opdone,drq>, error=0
atapi0.0: intr ireason=0x3, len=0, status=50<ready,opdone>, error=0
atapi0.0: req cb 28-0-0-0-0-26-0-0-1-0-0-0-0-0-0-0 len=2048
atapi0.0: start
atapi0.0: send cmd READ_BIG 28-0-0-0-0-26-0-0-1-0-0-0-0-0-0-0
atapi0.0: intr ireason=0x2, len=2048, status=58<ready,opdone,drq>, error=0
atapi0.0: intr ireason=0x3, len=0, status=50<ready,opdone>, error=0

# umount /cdrom

atapi0.0: req cb 28-0-0-0-0-26-0-0-1-0-0-0-0-0-0-0 len=2048
atapi0.0: start
atapi0.0: send cmd READ_BIG 28-0-0-0-0-26-0-0-1-0-0-0-0-0-0-0
atapi0.0: intr ireason=0x2, len=2048, status=58<ready,opdone,drq>, error=0
atapi0.0: intr ireason=0x3, len=0, status=50<ready,opdone>, error=0
atapi0.0: req w 1e-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0 len=0
atapi0.0: start
atapi0.0: send cmd PREVENT_ALLOW 1e-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0
atapi0.0: intr ireason=0x3, len=0, status=50<ready,opdone>, error=0

# cdcontrol -f /dev/cdrom eject

atapi0.0: intr ireason=0x3, len=0, status=50<ready,opdone>, error=0
atapi0.0: req w 1e-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0 len=0
atapi0.0: start
atapi0.0: send cmd PREVENT_ALLOW 1e-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0
atapi0.0: intr ireason=0x3, len=0, status=50<ready,opdone>, error=0
atapi0.0: req w 0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0 len=0
atapi0.0: start
atapi0.0: send cmd TEST_UNIT_READY 0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0
atapi0.0: intr ireason=0x3, len=0, status=50<ready,opdone>, error=0
atapi0.0: req w 43-0-0-0-0-0-0-0-c-0-0-0-0-0-0-0 len=12
atapi0.0: start
atapi0.0: send cmd READ_TOC 43-0-0-0-0-0-0-0-c-0-0-0-0-0-0-0
atapi0.0: intr ireason=0x2, len=12, status=58<ready,opdone,drq>, error=0
atapi0.0: intr ireason=0x3, len=0, status=50<ready,opdone>, error=0
atapi0.0: req w 43-0-0-0-0-0-0-0-c-0-0-0-0-0-0-0 len=12
atapi0.0: start
atapi0.0: send cmd READ_TOC 43-0-0-0-0-0-0-0-c-0-0-0-0-0-0-0
atapi0.0: intr ireason=0x2, len=12, status=58<ready,opdone,drq>, error=0
atapi0.0: intr ireason=0x3, len=0, status=50<ready,opdone>, error=0
atapi0.0: req w 25-0-0-0-0-0-0-0-8-0-0-0-0-0-0-0 len=8
atapi0.0: start
atapi0.0: send cmd READ_CAPACITY 25-0-0-0-0-0-0-0-8-0-0-0-0-0-0-0
atapi0.0: intr ireason=0x2, len=8, status=58<ready,opdone,drq>, error=0
atapi0.0: intr ireason=0x3, len=0, status=50<ready,opdone>, error=0
atapi0.0: req w 1e-0-0-0-1-0-0-0-0-0-0-0-0-0-0-0 len=0
atapi0.0: start
atapi0.0: send cmd PREVENT_ALLOW 1e-0-0-0-1-0-0-0-0-0-0-0-0-0-0-0
atapi0.0: intr ireason=0x3, len=0, status=50<ready,opdone>, error=0
atapi0.0: req w 1e-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0 len=0
atapi0.0: start
atapi0.0: send cmd PREVENT_ALLOW 1e-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0
atapi0.0: intr ireason=0x3, len=0, status=50<ready,opdone>, error=0
atapi0.0: req w 1b-1-0-0-0-0-0-0-0-0-0-0-0-0-0-0 len=0
atapi0.0: start
atapi0.0: send cmd START_STOP 1b-1-0-0-0-0-0-0-0-0-0-0-0-0-0-0
atapi0.0: intr ireason=0x3, len=0, status=50<ready,opdone>, error=0
atapi0.0: req w 1e-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0 len=0
atapi0.0: start
atapi0.0: send cmd PREVENT_ALLOW 1e-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0
atapi0.0: intr ireason=0x3, len=0, status=50<ready,opdone>, error=0
atapi0.0: req w 1b-0-0-0-2-0-0-0-0-0-0-0-0-0-0-0 len=0
atapi0.0: start
atapi0.0: send cmd START_STOP 1b-0-0-0-2-0-0-0-0-0-0-0-0-0-0-0

# cdcontrol -f /dev/cdrom close

atapi0.0: intr ireason=0x3, len=0, status=50<ready,opdone>, error=0
atapi0.0: req w 1e-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0 len=0
atapi0.0: start
atapi0.0: send cmd PREVENT_ALLOW 1e-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0
atapi0.0: intr ireason=0x3, len=0, status=50<ready,opdone>, error=0
atapi0.0: req w 0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0 len=0
atapi0.0: start
atapi0.0: send cmd TEST_UNIT_READY 0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0
atapi0.0: intr ireason=0x3, len=0, status=51<ready,opdone,check>, error=20
atapi0.0: req w 1e-0-0-0-1-0-0-0-0-0-0-0-0-0-0-0 len=0
atapi0.0: start
atapi0.0: send cmd PREVENT_ALLOW 1e-0-0-0-1-0-0-0-0-0-0-0-0-0-0-0
atapi0.0: intr ireason=0x3, len=0, status=51<ready,opdone,check>, error=20
atapi0.0: req w 0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0 len=0
atapi0.0: start
atapi0.0: send cmd TEST_UNIT_READY 0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0
atapi0.0: intr ireason=0x3, len=0, status=51<ready,opdone,check>, error=20
atapi0.0: req w 1e-0-0-0-1-0-0-0-0-0-0-0-0-0-0-0 len=0
atapi0.0: start
atapi0.0: send cmd PREVENT_ALLOW 1e-0-0-0-1-0-0-0-0-0-0-0-0-0-0-0
atapi0.0: intr ireason=0x3, len=0, status=51<ready,opdone,check>, error=20
atapi0.0: req w 1e-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0 len=0
atapi0.0: start
atapi0.0: send cmd PREVENT_ALLOW 1e-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0
atapi0.0: intr ireason=0x3, len=0, status=51<ready,opdone,check>, error=20
atapi0.0: req w 0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0 len=0
atapi0.0: start
atapi0.0: send cmd TEST_UNIT_READY 0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0
atapi0.0: intr ireason=0x3, len=0, status=51<ready,opdone,check>, error=20
atapi0.0: req w 1e-0-0-0-1-0-0-0-0-0-0-0-0-0-0-0 len=0
atapi0.0: start
atapi0.0: send cmd PREVENT_ALLOW 1e-0-0-0-1-0-0-0-0-0-0-0-0-0-0-0
atapi0.0: intr ireason=0x3, len=0, status=51<ready,opdone,check>, error=20
atapi0.0: req w 1b-1-0-0-0-0-0-0-0-0-0-0-0-0-0-0 len=0
atapi0.0: start
atapi0.0: send cmd START_STOP 1b-1-0-0-0-0-0-0-0-0-0-0-0-0-0-0

# mount /cdrom
cd9660: /dev/cdrom: Input/output error

atapi0.0: req w 0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0 len=0
atapi0.0: start
atapi0.0: send cmd TEST_UNIT_READY 0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0
atapi0.0: intr ireason=0x3, len=0, status=51<ready,opdone,check>, error=20
atapi0.0: req w 1e-0-0-0-1-0-0-0-0-0-0-0-0-0-0-0 len=0
atapi0.0: start
atapi0.0: send cmd PREVENT_ALLOW 1e-0-0-0-1-0-0-0-0-0-0-0-0-0-0-0
atapi0.0: intr ireason=0x3, len=0, status=51<ready,opdone,check>, error=20
atapi0.0: req w 0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0 len=0
atapi0.0: start
atapi0.0: send cmd TEST_UNIT_READY 0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0
atapi0.0: intr ireason=0x3, len=0, status=51<ready,opdone,check>, error=20
atapi0.0: req w 1e-0-0-0-1-0-0-0-0-0-0-0-0-0-0-0 len=0
atapi0.0: start
atapi0.0: send cmd PREVENT_ALLOW 1e-0-0-0-1-0-0-0-0-0-0-0-0-0-0-0
atapi0.0: intr ireason=0x3, len=0, status=51<ready,opdone,check>, error=20
atapi0.0: req w 1e-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0 len=0
atapi0.0: start
atapi0.0: send cmd PREVENT_ALLOW 1e-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0
atapi0.0: intr ireason=0x3, len=0, status=51<ready,opdone,check>, error=20
atapi0.0: req w 0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0 len=0
atapi0.0: start
atapi0.0: send cmd TEST_UNIT_READY 0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0
atapi0.0: intr ireason=0x3, len=0, status=51<ready,opdone,check>, error=20
atapi0.0: req w 1e-0-0-0-1-0-0-0-0-0-0-0-0-0-0-0 len=0
atapi0.0: start
atapi0.0: send cmd PREVENT_ALLOW 1e-0-0-0-1-0-0-0-0-0-0-0-0-0-0-0
atapi0.0: intr ireason=0x3, len=0, status=51<ready,opdone,check>, error=20
atapi0.0: req w 1e-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0 len=0
atapi0.0: start
atapi0.0: send cmd PREVENT_ALLOW 1e-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0
atapi0.0: intr ireason=0x3, len=0, status=51<ready,opdone,check>, error=20


>How-To-Repeat:
	
The "mount" commands shown below assume that /etc/fstab contains
something like: 

    /dev/wcd0c              /cdrom          cd9660  ro,noauto       0       0

# cdcontrol -f /dev/cdrom debug on
# mount /cdrom
# umount /cdrom
# cdcontrol -f /dev/cdrom eject
# cdcontrol -f /dev/cdrom close
# mount /cdrom
cd9660: /dev/cdrom: Input/output error

>Fix:
	
Fix not known

Workaround:  Reboot every time you want to mount a new CD-ROM :-(
>Release-Note:
>Audit-Trail:

From: Sren Schmidt <sos@freebsd.dk>
To: hohmuth@inf.tu-dresden.de
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: i386/8855: can't mount CD in ATAPI drive after eject/reload
Date: Wed, 25 Nov 1998 08:53:53 +0100 (CET)

 It seems hohmuth@inf.tu-dresden.de wrote:
 
 Try this patch see if it helps:
 
 Index: atapi.c
 ===================================================================
 RCS file: /home/ncvs/src/sys/i386/isa/atapi.c,v
 retrieving revision 1.27
 diff -u -r1.27 atapi.c
 --- atapi.c     1998/09/24 10:41:13     1.27
 +++ atapi.c     1998/11/25 07:53:12
 @@ -664,8 +664,8 @@
   */
  int atapi_wait_cmd (struct atapi *ata, struct atapicmd *ac)
  {
 -       /* Wait for DRQ from 50 usec to 3 msec for slow devices */
 -       int cnt = ata->intrcmd ? 10000 : ata->slow ? 3000 : 50;
 +       /* Wait for DRQ from 100 usec to 3 msec for slow devices */
 +       int cnt = ata->intrcmd ? 10000 : ata->slow ? 3000 : 100;
         int ireason = 0, phase = 0;
  
         /* Wait for command phase. */
 
 > 
 > >Number:         8855
 > >Category:       i386
 > >Synopsis:       can't mount CD in ATAPI drive after eject/reload
 > >Confidential:   no
 > >Severity:       serious
 > >Priority:       medium
 > >Responsible:    freebsd-bugs
 > >State:          open
 > >Quarter:
 > >Keywords:
 > >Date-Required:
 > >Class:          sw-bug
 > >Submitter-Id:   current-users
 > >Arrival-Date:   Tue Nov 24 19:50:01 PST 1998
 > >Last-Modified:
 > >Originator:     Michael Hohmuth
 > >Organization:
 > none
 > >Release:        FreeBSD 2.2.7-STABLE i386
 > >Environment:
 > 	
 > "uname -a" says:
 > 
 >     FreeBSD olymp.sax.de 2.2.7-STABLE FreeBSD 2.2.7-STABLE #1: 
 >     Wed Nov 25 03:45:12 CET 1998     
 >     root@olymp.sax.de:/usr/src/sys/compile/OLYMPISDN  i386
 > 
 > I've updated the atapi.c driver with some changes from
 > FreeBSD-current.  This doesn't change the behaviour, though.
 > 
 > /var/log/dmesg.today contains:
 > 
 >     wdc0 at 0x1f0-0x1f7 irq 14 on isa
 >     wdc0: unit 0 (atapi): <IDE-1 REV.1.05  9-20-94/DOLPHIN>, removable
 >     atapi0.0: unknown phase
 > 
 > /etc/fstab contains:
 >     /dev/wcd0c              /cdrom          cd9660  ro,noauto       0       0
 > 
 > 
 > >Description:
 > 	
 > I can't mount a CD-ROM inserted after the system has been booted:
 > 
 >     # mount /cdrom
 >     cd9660: /dev/cdrom: Input/output error
 > 
 > A CD-ROM which has been loaded before booting FreeBSD can be mounted
 > just fine.
 > 
 > Below I include some kernel output which shows a first "mount /cdrom"
 > which succeeds, an "umount", an eject/reload, and another "mount /cdrom"
 > which fails with an I/O error.  
 > 
 > The "error=20" messages at the end of the output or the "atapi0.0:
 > unknown phase" message which appears at boot time maybe are connected
 > to the problem in some way?
 > 
 > 
 > # cdcontrol -f /dev/cdrom debug on
 > 
 > atapi0.0: req w 1e-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0 len=0
 > atapi0.0: start
 > atapi0.0: send cmd PREVENT_ALLOW 1e-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0
 > atapi0.0: intr ireason=0x3, len=0, status=50<ready,opdone>, error=0
 > 
 > # mount /cdrom
 > 
 > atapi0.0: req w 0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0 len=0
 > atapi0.0: start
 > atapi0.0: send cmd TEST_UNIT_READY 0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0
 > atapi0.0: intr ireason=0x3, len=0, status=50<ready,opdone>, error=0
 > atapi0.0: req w 43-0-0-0-0-0-0-0-c-0-0-0-0-0-0-0 len=12
 > atapi0.0: start
 > atapi0.0: send cmd READ_TOC 43-0-0-0-0-0-0-0-c-0-0-0-0-0-0-0
 > atapi0.0: intr ireason=0x2, len=12, status=58<ready,opdone,drq>, error=0
 > atapi0.0: intr ireason=0x3, len=0, status=50<ready,opdone>, error=0
 > atapi0.0: req w 43-0-0-0-0-0-0-0-c-0-0-0-0-0-0-0 len=12
 > atapi0.0: start
 > atapi0.0: send cmd READ_TOC 43-0-0-0-0-0-0-0-c-0-0-0-0-0-0-0
 > atapi0.0: intr ireason=0x2, len=12, status=58<ready,opdone,drq>, error=0
 > atapi0.0: intr ireason=0x3, len=0, status=50<ready,opdone>, error=0
 > atapi0.0: req w 25-0-0-0-0-0-0-0-8-0-0-0-0-0-0-0 len=8
 > atapi0.0: start
 > atapi0.0: send cmd READ_CAPACITY 25-0-0-0-0-0-0-0-8-0-0-0-0-0-0-0
 > atapi0.0: intr ireason=0x2, len=8, status=58<ready,opdone,drq>, error=0
 > atapi0.0: intr ireason=0x3, len=0, status=50<ready,opdone>, error=0
 > atapi0.0: req w 1e-0-0-0-1-0-0-0-0-0-0-0-0-0-0-0 len=0
 > atapi0.0: start
 > atapi0.0: send cmd PREVENT_ALLOW 1e-0-0-0-1-0-0-0-0-0-0-0-0-0-0-0
 > atapi0.0: intr ireason=0x3, len=0, status=50<ready,opdone>, error=0
 > atapi0.0: req w 1e-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0 len=0
 > atapi0.0: start
 > atapi0.0: send cmd PREVENT_ALLOW 1e-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0
 > atapi0.0: intr ireason=0x3, len=0, status=50<ready,opdone>, error=0
 > atapi0.0: req w 0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0 len=0
 > atapi0.0: start
 > atapi0.0: send cmd TEST_UNIT_READY 0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0
 > atapi0.0: intr ireason=0x3, len=0, status=50<ready,opdone>, error=0
 > atapi0.0: req w 43-0-0-0-0-0-0-0-c-0-0-0-0-0-0-0 len=12
 > atapi0.0: start
 > atapi0.0: send cmd READ_TOC 43-0-0-0-0-0-0-0-c-0-0-0-0-0-0-0
 > atapi0.0: intr ireason=0x2, len=12, status=58<ready,opdone,drq>, error=0
 > atapi0.0: intr ireason=0x3, len=0, status=50<ready,opdone>, error=0
 > atapi0.0: req w 43-0-0-0-0-0-0-0-c-0-0-0-0-0-0-0 len=12
 > atapi0.0: start
 > atapi0.0: send cmd READ_TOC 43-0-0-0-0-0-0-0-c-0-0-0-0-0-0-0
 > atapi0.0: intr ireason=0x2, len=12, status=58<ready,opdone,drq>, error=0
 > atapi0.0: intr ireason=0x3, len=0, status=50<ready,opdone>, error=0
 > atapi0.0: req w 25-0-0-0-0-0-0-0-8-0-0-0-0-0-0-0 len=8
 > atapi0.0: start
 > atapi0.0: send cmd READ_CAPACITY 25-0-0-0-0-0-0-0-8-0-0-0-0-0-0-0
 > atapi0.0: intr ireason=0x2, len=8, status=58<ready,opdone,drq>, error=0
 > atapi0.0: intr ireason=0x3, len=0, status=50<ready,opdone>, error=0
 > atapi0.0: req w 1e-0-0-0-1-0-0-0-0-0-0-0-0-0-0-0 len=0
 > atapi0.0: start
 > atapi0.0: send cmd PREVENT_ALLOW 1e-0-0-0-1-0-0-0-0-0-0-0-0-0-0-0
 > atapi0.0: intr ireason=0x3, len=0, status=50<ready,opdone>, error=0
 > atapi0.0: req cb 28-0-0-0-0-10-0-0-1-0-0-0-0-0-0-0 len=2048
 > atapi0.0: start
 > atapi0.0: send cmd READ_BIG 28-0-0-0-0-10-0-0-1-0-0-0-0-0-0-0
 > atapi0.0: intr ireason=0x2, len=2048, status=58<ready,opdone,drq>, error=0
 > atapi0.0: intr ireason=0x3, len=0, status=50<ready,opdone>, error=0
 > atapi0.0: req cb 28-0-0-0-0-26-0-0-1-0-0-0-0-0-0-0 len=2048
 > atapi0.0: start
 > atapi0.0: send cmd READ_BIG 28-0-0-0-0-26-0-0-1-0-0-0-0-0-0-0
 > atapi0.0: intr ireason=0x2, len=2048, status=58<ready,opdone,drq>, error=0
 > atapi0.0: intr ireason=0x3, len=0, status=50<ready,opdone>, error=0
 > 
 > # umount /cdrom
 > 
 > atapi0.0: req cb 28-0-0-0-0-26-0-0-1-0-0-0-0-0-0-0 len=2048
 > atapi0.0: start
 > atapi0.0: send cmd READ_BIG 28-0-0-0-0-26-0-0-1-0-0-0-0-0-0-0
 > atapi0.0: intr ireason=0x2, len=2048, status=58<ready,opdone,drq>, error=0
 > atapi0.0: intr ireason=0x3, len=0, status=50<ready,opdone>, error=0
 > atapi0.0: req w 1e-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0 len=0
 > atapi0.0: start
 > atapi0.0: send cmd PREVENT_ALLOW 1e-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0
 > atapi0.0: intr ireason=0x3, len=0, status=50<ready,opdone>, error=0
 > 
 > # cdcontrol -f /dev/cdrom eject
 > 
 > atapi0.0: intr ireason=0x3, len=0, status=50<ready,opdone>, error=0
 > atapi0.0: req w 1e-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0 len=0
 > atapi0.0: start
 > atapi0.0: send cmd PREVENT_ALLOW 1e-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0
 > atapi0.0: intr ireason=0x3, len=0, status=50<ready,opdone>, error=0
 > atapi0.0: req w 0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0 len=0
 > atapi0.0: start
 > atapi0.0: send cmd TEST_UNIT_READY 0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0
 > atapi0.0: intr ireason=0x3, len=0, status=50<ready,opdone>, error=0
 > atapi0.0: req w 43-0-0-0-0-0-0-0-c-0-0-0-0-0-0-0 len=12
 > atapi0.0: start
 > atapi0.0: send cmd READ_TOC 43-0-0-0-0-0-0-0-c-0-0-0-0-0-0-0
 > atapi0.0: intr ireason=0x2, len=12, status=58<ready,opdone,drq>, error=0
 > atapi0.0: intr ireason=0x3, len=0, status=50<ready,opdone>, error=0
 > atapi0.0: req w 43-0-0-0-0-0-0-0-c-0-0-0-0-0-0-0 len=12
 > atapi0.0: start
 > atapi0.0: send cmd READ_TOC 43-0-0-0-0-0-0-0-c-0-0-0-0-0-0-0
 > atapi0.0: intr ireason=0x2, len=12, status=58<ready,opdone,drq>, error=0
 > atapi0.0: intr ireason=0x3, len=0, status=50<ready,opdone>, error=0
 > atapi0.0: req w 25-0-0-0-0-0-0-0-8-0-0-0-0-0-0-0 len=8
 > atapi0.0: start
 > atapi0.0: send cmd READ_CAPACITY 25-0-0-0-0-0-0-0-8-0-0-0-0-0-0-0
 > atapi0.0: intr ireason=0x2, len=8, status=58<ready,opdone,drq>, error=0
 > atapi0.0: intr ireason=0x3, len=0, status=50<ready,opdone>, error=0
 > atapi0.0: req w 1e-0-0-0-1-0-0-0-0-0-0-0-0-0-0-0 len=0
 > atapi0.0: start
 > atapi0.0: send cmd PREVENT_ALLOW 1e-0-0-0-1-0-0-0-0-0-0-0-0-0-0-0
 > atapi0.0: intr ireason=0x3, len=0, status=50<ready,opdone>, error=0
 > atapi0.0: req w 1e-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0 len=0
 > atapi0.0: start
 > atapi0.0: send cmd PREVENT_ALLOW 1e-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0
 > atapi0.0: intr ireason=0x3, len=0, status=50<ready,opdone>, error=0
 > atapi0.0: req w 1b-1-0-0-0-0-0-0-0-0-0-0-0-0-0-0 len=0
 > atapi0.0: start
 > atapi0.0: send cmd START_STOP 1b-1-0-0-0-0-0-0-0-0-0-0-0-0-0-0
 > atapi0.0: intr ireason=0x3, len=0, status=50<ready,opdone>, error=0
 > atapi0.0: req w 1e-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0 len=0
 > atapi0.0: start
 > atapi0.0: send cmd PREVENT_ALLOW 1e-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0
 > atapi0.0: intr ireason=0x3, len=0, status=50<ready,opdone>, error=0
 > atapi0.0: req w 1b-0-0-0-2-0-0-0-0-0-0-0-0-0-0-0 len=0
 > atapi0.0: start
 > atapi0.0: send cmd START_STOP 1b-0-0-0-2-0-0-0-0-0-0-0-0-0-0-0
 > 
 > # cdcontrol -f /dev/cdrom close
 > 
 > atapi0.0: intr ireason=0x3, len=0, status=50<ready,opdone>, error=0
 > atapi0.0: req w 1e-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0 len=0
 > atapi0.0: start
 > atapi0.0: send cmd PREVENT_ALLOW 1e-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0
 > atapi0.0: intr ireason=0x3, len=0, status=50<ready,opdone>, error=0
 > atapi0.0: req w 0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0 len=0
 > atapi0.0: start
 > atapi0.0: send cmd TEST_UNIT_READY 0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0
 > atapi0.0: intr ireason=0x3, len=0, status=51<ready,opdone,check>, error=20
 > atapi0.0: req w 1e-0-0-0-1-0-0-0-0-0-0-0-0-0-0-0 len=0
 > atapi0.0: start
 > atapi0.0: send cmd PREVENT_ALLOW 1e-0-0-0-1-0-0-0-0-0-0-0-0-0-0-0
 > atapi0.0: intr ireason=0x3, len=0, status=51<ready,opdone,check>, error=20
 > atapi0.0: req w 0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0 len=0
 > atapi0.0: start
 > atapi0.0: send cmd TEST_UNIT_READY 0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0
 > atapi0.0: intr ireason=0x3, len=0, status=51<ready,opdone,check>, error=20
 > atapi0.0: req w 1e-0-0-0-1-0-0-0-0-0-0-0-0-0-0-0 len=0
 > atapi0.0: start
 > atapi0.0: send cmd PREVENT_ALLOW 1e-0-0-0-1-0-0-0-0-0-0-0-0-0-0-0
 > atapi0.0: intr ireason=0x3, len=0, status=51<ready,opdone,check>, error=20
 > atapi0.0: req w 1e-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0 len=0
 > atapi0.0: start
 > atapi0.0: send cmd PREVENT_ALLOW 1e-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0
 > atapi0.0: intr ireason=0x3, len=0, status=51<ready,opdone,check>, error=20
 > atapi0.0: req w 0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0 len=0
 > atapi0.0: start
 > atapi0.0: send cmd TEST_UNIT_READY 0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0
 > atapi0.0: intr ireason=0x3, len=0, status=51<ready,opdone,check>, error=20
 > atapi0.0: req w 1e-0-0-0-1-0-0-0-0-0-0-0-0-0-0-0 len=0
 > atapi0.0: start
 > atapi0.0: send cmd PREVENT_ALLOW 1e-0-0-0-1-0-0-0-0-0-0-0-0-0-0-0
 > atapi0.0: intr ireason=0x3, len=0, status=51<ready,opdone,check>, error=20
 > atapi0.0: req w 1b-1-0-0-0-0-0-0-0-0-0-0-0-0-0-0 len=0
 > atapi0.0: start
 > atapi0.0: send cmd START_STOP 1b-1-0-0-0-0-0-0-0-0-0-0-0-0-0-0
 > 
 > # mount /cdrom
 > cd9660: /dev/cdrom: Input/output error
 > 
 > atapi0.0: req w 0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0 len=0
 > atapi0.0: start
 > atapi0.0: send cmd TEST_UNIT_READY 0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0
 > atapi0.0: intr ireason=0x3, len=0, status=51<ready,opdone,check>, error=20
 > atapi0.0: req w 1e-0-0-0-1-0-0-0-0-0-0-0-0-0-0-0 len=0
 > atapi0.0: start
 > atapi0.0: send cmd PREVENT_ALLOW 1e-0-0-0-1-0-0-0-0-0-0-0-0-0-0-0
 > atapi0.0: intr ireason=0x3, len=0, status=51<ready,opdone,check>, error=20
 > atapi0.0: req w 0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0 len=0
 > atapi0.0: start
 > atapi0.0: send cmd TEST_UNIT_READY 0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0
 > atapi0.0: intr ireason=0x3, len=0, status=51<ready,opdone,check>, error=20
 > atapi0.0: req w 1e-0-0-0-1-0-0-0-0-0-0-0-0-0-0-0 len=0
 > atapi0.0: start
 > atapi0.0: send cmd PREVENT_ALLOW 1e-0-0-0-1-0-0-0-0-0-0-0-0-0-0-0
 > atapi0.0: intr ireason=0x3, len=0, status=51<ready,opdone,check>, error=20
 > atapi0.0: req w 1e-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0 len=0
 > atapi0.0: start
 > atapi0.0: send cmd PREVENT_ALLOW 1e-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0
 > atapi0.0: intr ireason=0x3, len=0, status=51<ready,opdone,check>, error=20
 > atapi0.0: req w 0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0 len=0
 > atapi0.0: start
 > atapi0.0: send cmd TEST_UNIT_READY 0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0
 > atapi0.0: intr ireason=0x3, len=0, status=51<ready,opdone,check>, error=20
 > atapi0.0: req w 1e-0-0-0-1-0-0-0-0-0-0-0-0-0-0-0 len=0
 > atapi0.0: start
 > atapi0.0: send cmd PREVENT_ALLOW 1e-0-0-0-1-0-0-0-0-0-0-0-0-0-0-0
 > atapi0.0: intr ireason=0x3, len=0, status=51<ready,opdone,check>, error=20
 > atapi0.0: req w 1e-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0 len=0
 > atapi0.0: start
 > atapi0.0: send cmd PREVENT_ALLOW 1e-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0
 > atapi0.0: intr ireason=0x3, len=0, status=51<ready,opdone,check>, error=20
 > 
 > 
 > >How-To-Repeat:
 > 	
 > The "mount" commands shown below assume that /etc/fstab contains
 > something like: 
 > 
 >     /dev/wcd0c              /cdrom          cd9660  ro,noauto       0       0
 > 
 > # cdcontrol -f /dev/cdrom debug on
 > # mount /cdrom
 > # umount /cdrom
 > # cdcontrol -f /dev/cdrom eject
 > # cdcontrol -f /dev/cdrom close
 > # mount /cdrom
 > cd9660: /dev/cdrom: Input/output error
 > 
 > >Fix:
 > 	
 > Fix not known
 > 
 > Workaround:  Reboot every time you want to mount a new CD-ROM :-(
 > >Audit-Trail:
 > >Unformatted:
 > 
 > To Unsubscribe: send mail to majordomo@FreeBSD.org
 > with "unsubscribe freebsd-bugs" in the body of the message
 > 
 
 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
 Sren Schmidt          (sos@freebsd.org)       FreeBSD Core Team member
 

From: Michael Hohmuth <hohmuth@inf.tu-dresden.de>
To: =?ISO-8859-1?Q?S=F8ren?= Schmidt <sos@freebsd.dk>
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: i386/8855: can't mount CD in ATAPI drive after eject/reload
Date: 25 Nov 1998 15:08:40 +0100

 Sren Schmidt <sos@freebsd.dk> writes:
 
 > Try this patch see if it helps:
 > 
 > Index: atapi.c
 
 > -       /* Wait for DRQ from 50 usec to 3 msec for slow devices */
 > -       int cnt = ata->intrcmd ? 10000 : ata->slow ? 3000 : 50;
 > +       /* Wait for DRQ from 100 usec to 3 msec for slow devices */
 > +       int cnt = ata->intrcmd ? 10000 : ata->slow ? 3000 : 100;
 
 Sren,
 
 thanks for your reply!  Unfortunately, your patch doesn't change
 anything... :-(
 
 BTW: I just noticed the debug output I quoted was missing a few lines
 which appear five seconds after the START_STOP command has been logged:
 
 > > [...]
 > > # cdcontrol -f /dev/cdrom close
 > > 
 > > atapi0.0: intr ireason=0x3, len=0, status=50<ready,opdone>, error=0
 > > atapi0.0: req w 1e-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0 len=0
 [...]
 > > atapi0.0: start
 > > atapi0.0: send cmd START_STOP 1b-1-0-0-0-0-0-0-0-0-0-0-0-0-0-0
 
 
 atapi0.0: send cmd PREVENT_ALLOW 1e-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0
 atapi0.0: intr ireason=0x3, len=0, status=50<ready,opdone>, error=0
 
 Here, the error code is 0 again, but this doesn't change the output
 "error=20" for the following "mount" command:
 
 > > # mount /cdrom
 > > cd9660: /dev/cdrom: Input/output error
 > > 
 > > atapi0.0: req w 0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0 len=0
 > > atapi0.0: start
 > > atapi0.0: send cmd TEST_UNIT_READY 0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0
 > > atapi0.0: intr ireason=0x3, len=0, status=51<ready,opdone,check>, error=20
 
 [ and so on ]
 
 Michael 
 -- 
 hohmuth@innocent.com, hohmuth@inf.tu-dresden.de
 http://home.pages.de/~hohmuth/
Responsible-Changed-From-To: freebsd-bugs->sos 
Responsible-Changed-By: n_hibma 
Responsible-Changed-When: Sat Jul 24 04:26:58 PDT 1999 
Responsible-Changed-Why:  
Atapi is Soren's baby. 
State-Changed-From-To: open->closed 
State-Changed-By: sos 
State-Changed-When: Mon Feb 28 11:28:01 PST 2000 
State-Changed-Why:  
Fixed in 4.0. 
>Unformatted:
