From neil@darlow.co.uk  Mon Jan 22 09:51:56 2007
Return-Path: <neil@darlow.co.uk>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id E7E1F16A400
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 22 Jan 2007 09:51:56 +0000 (UTC)
	(envelope-from neil@darlow.co.uk)
Received: from router.darlow.co.uk (cpc1-bigg1-0-0-cust731.lutn.cable.ntl.com [80.6.42.220])
	by mx1.freebsd.org (Postfix) with ESMTP id 52C1913C461
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 22 Jan 2007 09:51:56 +0000 (UTC)
	(envelope-from neil@darlow.co.uk)
Received: from router.darlow.co.uk (localhost [127.0.0.1])
	by router.darlow.co.uk (Postfix) with ESMTP id D2F69102E3E
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 22 Jan 2007 09:51:54 +0000 (GMT)
Received: by router.darlow.co.uk (Postfix, from userid 1001)
	id A99F4102C4B; Mon, 22 Jan 2007 09:51:54 +0000 (GMT)
Message-Id: <20070122095154.A99F4102C4B@router.darlow.co.uk>
Date: Mon, 22 Jan 2007 09:51:54 +0000 (GMT)
From: Neil Darlow <neil@darlow.co.uk>
Reply-To: Neil Darlow <neil@darlow.co.uk>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: atapicam error after upgrade to 6.2 
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         108202
>Category:       kern
>Synopsis:       [atapicam] atapicam error after upgrade to 6.2 [regression]
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jan 22 10:00:34 GMT 2007
>Closed-Date:    Thu Jul 15 10:39:32 UTC 2010
>Last-Modified:  Thu Jul 15 10:39:32 UTC 2010
>Originator:     Neil Darlow
>Release:        FreeBSD 6.2-RELEASE i386
>Organization:
>Environment:
System: FreeBSD router.darlow.co.uk 6.2-RELEASE FreeBSD 6.2-RELEASE #0: Mon Jan 15 19:14:27 GMT 2007 root@router.darlow.co.uk:/usr/obj/usr/src/sys/ROUTER i386
>Description:
I use atapicam.ko to write DVDs using the growisofs port. Following an
upgrade to FreeBSD-6.2 I have observed errors associated with /dev/cd0.

My hardware is:
	VIA EPIA PD10000 motherboard
	Maxtor 160GB ATA133 drive on ad0
	Optiarc DVD writer on acd0/cd0
	Maxtor 160GB ATA133 drive on ad4

The two hard drives are configured as a gmirror RAID-1 array which has a
GELI encrypted swap partition with padlock.ko providing hardware AES support.

The following dmesg output summary gives details of the hardware and error
condition. The output shows an error followed by:
	1) kldunload atapicam
	2) kldload atapicam
	3) mount -t cd9660 /dev/acd0 /media/cdrom

Note that even though errors are reported and I am unable to mount acd0,
write operations to DVD using growisofs appear to work without errors
being reported (I use dar to backup the system daily and write the archives
to DVD with growisofs).

I never observed errors of this type under FreeBSD-6.1 and have only
noticed them since the upgrade to 6.2. The fact that growisofs writes
to DVD without error and that I only have problems in accessing the drive
via mount leads me to suspect a driver issue.

atapci0: <VIA 8235 UDMA133 controller> port 0x1f0-0x1f7,0x3f6,0x170-0x177,0x376,0xd000-0xd00f at device 17.1 on pci0
ata0: <ATA channel 0> on atapci0
ata1: <ATA channel 1> on atapci0
atapci1: <SiI 0680 UDMA133 controller> port 0xdc00-0xdc07,0xe000-0xe003,0xe400-0xe407,0xe800-0xe803,0xec00-0xec0f mem 0xe7402000-0xe74020ff irq 11 at device 20.0 on pci0
ata2: <ATA channel 0> on atapci1
ata3: <ATA channel 1> on atapci1
ad0: 156334MB <Maxtor 6L160P0 BAH41G10> at ata0-master UDMA133
GEOM_MIRROR: Device gm0 created (id=2484072667).
GEOM_MIRROR: Device gm0: provider ad0 detected.
acd0: DVDR <Optiarc DVD RW AD-7170A/1.02> at ata1-master UDMA66
ad4: 156334MB <Maxtor 6L160P0 BAH41G10> at ata2-master UDMA133
GEOM_MIRROR: Device gm0: provider ad4 detected.
GEOM_MIRROR: Device gm0: provider ad4 activated.
GEOM_MIRROR: Device gm0: provider ad0 activated.
GEOM_MIRROR: Device gm0: provider mirror/gm0 launched.
cd0 at ata1 bus 0 target 0 lun 0
cd0: <Optiarc DVD RW AD-7170A 1.02> Removable CD-ROM SCSI-0 device 
cd0: 66.000MB/s transfers
cd0: Attempt to query device size failed: NOT READY, Medium not present
GEOM_ELI: Device mirror/gm0s1b.eli created.
GEOM_ELI: Encryption: AES-CBC 256
GEOM_ELI:     Crypto: hardware
(cd0:ata1:0:0:0): READ(10). CDB: 28 0 0 0 0 10 0 0 1 0 
(cd0:ata1:0:0:0): CAM Status: SCSI Status Error
(cd0:ata1:0:0:0): SCSI Status: Check Condition
(cd0:ata1:0:0:0): ILLEGAL REQUEST asc:21,0
(cd0:ata1:0:0:0): Logical block address out of range
(cd0:ata1:0:0:0): Unretryable error
(cd0:ata1:0:0:0): cddone: got error 0x16 back
(cd0:ata1:0:0:0): READ(10). CDB: 28 0 0 0 0 10 0 0 1 0 
(cd0:ata1:0:0:0): CAM Status: SCSI Status Error
(cd0:ata1:0:0:0): SCSI Status: Check Condition
(cd0:ata1:0:0:0): ILLEGAL REQUEST asc:21,0
(cd0:ata1:0:0:0): Logical block address out of range
(cd0:ata1:0:0:0): Unretryable error
(cd0:ata1:0:0:0): cddone: got error 0x16 back
g_vfs_done():cd0[READ(offset=32768, length=2048)]error = 22
atapicam0: detached
(cd0:ata1:0:0:0): lost device
(cd0:ata1:0:0:0): removing device entry
atapicam1: detached
atapicam2: detached
atapicam3: detached
cd0 at ata1 bus 0 target 0 lun 0
cd0: <Optiarc DVD RW AD-7170A 1.02> Removable CD-ROM SCSI-0 device 
cd0: 66.000MB/s transfers
cd0: cd present [4294770689 x 2048 byte records]
(cd0:ata1:0:0:0): READ(10). CDB: 28 0 ff fd 0 0 0 0 1 0 
(cd0:ata1:0:0:0): CAM Status: SCSI Status Error
(cd0:ata1:0:0:0): SCSI Status: Check Condition
(cd0:ata1:0:0:0): ILLEGAL REQUEST asc:21,0
(cd0:ata1:0:0:0): Logical block address out of range
(cd0:ata1:0:0:0): Unretryable error
(cd0:ata1:0:0:0): cddone: got error 0x16 back
(cd0:ata1:0:0:0): READ(10). CDB: 28 0 0 0 0 0 0 0 1 0 
(cd0:ata1:0:0:0): CAM Status: SCSI Status Error
(cd0:ata1:0:0:0): SCSI Status: Check Condition
(cd0:ata1:0:0:0): ILLEGAL REQUEST asc:21,0
(cd0:ata1:0:0:0): Logical block address out of range
(cd0:ata1:0:0:0): Unretryable error
(cd0:ata1:0:0:0): cddone: got error 0x16 back
(cd0:ata1:0:0:0): READ(10). CDB: 28 0 0 0 0 1 0 0 1 0 
(cd0:ata1:0:0:0): CAM Status: SCSI Status Error
(cd0:ata1:0:0:0): SCSI Status: Check Condition
(cd0:ata1:0:0:0): ILLEGAL REQUEST asc:21,0
(cd0:ata1:0:0:0): Logical block address out of range
(cd0:ata1:0:0:0): Unretryable error
(cd0:ata1:0:0:0): cddone: got error 0x16 back
(cd0:ata1:0:0:0): READ(10). CDB: 28 0 0 0 0 0 0 0 1 0 
(cd0:ata1:0:0:0): CAM Status: SCSI Status Error
(cd0:ata1:0:0:0): SCSI Status: Check Condition
(cd0:ata1:0:0:0): ILLEGAL REQUEST asc:21,0
(cd0:ata1:0:0:0): Logical block address out of range
(cd0:ata1:0:0:0): Unretryable error
(cd0:ata1:0:0:0): cddone: got error 0x16 back
(cd0:ata1:0:0:0): READ(10). CDB: 28 0 0 0 0 0 0 0 1 0 
(cd0:ata1:0:0:0): CAM Status: SCSI Status Error
(cd0:ata1:0:0:0): SCSI Status: Check Condition
(cd0:ata1:0:0:0): ILLEGAL REQUEST asc:21,0
(cd0:ata1:0:0:0): Logical block address out of range
(cd0:ata1:0:0:0): Unretryable error
(cd0:ata1:0:0:0): cddone: got error 0x16 back
(cd0:ata1:0:0:0): READ(10). CDB: 28 0 0 0 0 0 0 0 2 0 
(cd0:ata1:0:0:0): CAM Status: SCSI Status Error
(cd0:ata1:0:0:0): SCSI Status: Check Condition
(cd0:ata1:0:0:0): ILLEGAL REQUEST asc:21,0
(cd0:ata1:0:0:0): Logical block address out of range
(cd0:ata1:0:0:0): Unretryable error
(cd0:ata1:0:0:0): cddone: got error 0x16 back
(cd0:ata1:0:0:0): READ(10). CDB: 28 0 0 0 0 10 0 0 1 0 
(cd0:ata1:0:0:0): CAM Status: SCSI Status Error
(cd0:ata1:0:0:0): SCSI Status: Check Condition
(cd0:ata1:0:0:0): ILLEGAL REQUEST asc:21,0
(cd0:ata1:0:0:0): Logical block address out of range
(cd0:ata1:0:0:0): Unretryable error
(cd0:ata1:0:0:0): cddone: got error 0x16 back
g_vfs_done():cd0[READ(offset=32768, length=2048)]error = 22
acd0: FAILURE - READ_BIG ILLEGAL REQUEST asc=0x21 ascq=0x00 
acd0: FAILURE - READ_BIG ILLEGAL REQUEST asc=0x21 ascq=0x00 
acd0: FAILURE - READ_BIG ILLEGAL REQUEST asc=0x21 ascq=0x00 
acd0: FAILURE - READ_BIG ILLEGAL REQUEST asc=0x21 ascq=0x00 
acd0: FAILURE - READ_BIG ILLEGAL REQUEST asc=0x21 ascq=0x00 
acd0: FAILURE - READ_BIG ILLEGAL REQUEST asc=0x21 ascq=0x00 
acd0: FAILURE - READ_BIG ILLEGAL REQUEST asc=0x21 ascq=0x00 
g_vfs_done():acd0[READ(offset=32768, length=2048)]error = 5
>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:

From: Thomas Quinot <thomas@FreeBSD.ORG>
To: Neil Darlow <neil@darlow.co.uk>
Cc: FreeBSD-gnats-submit@FreeBSD.org
Subject: Re: kern/108202: atapicam error after upgrade to 6.2
Date: Mon, 22 Jan 2007 11:43:40 +0100

 * Neil Darlow, 2007-01-22 :
 
 > I use atapicam.ko to write DVDs using the growisofs port. Following
 > an upgrade to FreeBSD-6.2 I have observed errors associated with /dev/cd0.
 
 The errors you are reporting are associated with /dev/acd0c:
 
 > 3) mount -t cd9660 /dev/acd0 /media/cdrom
 > acd0: FAILURE - READ_BIG ILLEGAL REQUEST asc=0x21 ascq=0x00 
 > acd0: FAILURE - READ_BIG ILLEGAL REQUEST asc=0x21 ascq=0x00 
 > acd0: FAILURE - READ_BIG ILLEGAL REQUEST asc=0x21 ascq=0x00 
 > acd0: FAILURE - READ_BIG ILLEGAL REQUEST asc=0x21 ascq=0x00 
 > acd0: FAILURE - READ_BIG ILLEGAL REQUEST asc=0x21 ascq=0x00 
 > acd0: FAILURE - READ_BIG ILLEGAL REQUEST asc=0x21 ascq=0x00 
 > acd0: FAILURE - READ_BIG ILLEGAL REQUEST asc=0x21 ascq=0x00 
 > g_vfs_done():acd0[READ(offset=32768, length=2048)]error = 5
 
 Mixing ATAPI/CAM and acd access to the same device is explicitly
 discouraged in the atapicam man page. Can you clarify why you can't use
 /dev/cd0?
 
 Thomas.
 

From: Neil Darlow <neil@darlow.co.uk>
To: bug-followup@FreeBSD.org,  neil@darlow.co.uk
Cc:  
Subject: Re: kern/108202: atapicam error after upgrade to 6.2
Date: Mon, 22 Jan 2007 11:49:43 +0000

 The errors associated with acd0 were from an attempt to determine if the
 problem was just SCSI related. I normally access the device as cd0.
 
 My bug submission includes many lines associated with cd0 i.e. those
 starting with (cd0:ata1:0:0:0).
 
 Looking further into the cronology of the problem, it appears my write
 to DVD completed *before* the first (cd0:ata1:0:0:0): READ(10). CDB: 28
 0 ff fd 0 0 0 0 1 0 error was reported.
 
 After a complete powerdown, and restart, of the system I was able to
 mount cd0 so it appears the hardware got into a spurious state. Whether
 that's the fault of poorly designed device firmware, or a buggy driver,
 frequent power-cycling on a system that is a server is not desirable.
State-Changed-From-To: open->closed 
State-Changed-By: jh 
State-Changed-When: Thu Jul 15 10:39:31 UTC 2010 
State-Changed-Why:  
Appears to be a hardware problem. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=108202 
>Unformatted:
