From doconnor@cain.gsoft.com.au  Wed Dec  4 16:35:27 2002
Return-Path: <doconnor@cain.gsoft.com.au>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id AD32937B401
	for <FreeBSD-gnats-submit@freebsd.org>; Wed,  4 Dec 2002 16:35:27 -0800 (PST)
Received: from cain.gsoft.com.au (genesi.lnk.telstra.net [139.130.136.161])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 0BF6843E4A
	for <FreeBSD-gnats-submit@freebsd.org>; Wed,  4 Dec 2002 16:35:25 -0800 (PST)
	(envelope-from doconnor@cain.gsoft.com.au)
Received: from cain.gsoft.com.au (localhost [127.0.0.1])
	by cain.gsoft.com.au (8.12.4/8.12.6) with ESMTP id gB50ZKiX068151
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 5 Dec 2002 11:05:20 +1030 (CST)
	(envelope-from doconnor@cain.gsoft.com.au)
Received: (from doconnor@localhost)
	by cain.gsoft.com.au (8.12.4/8.12.5/Submit) id gB50ZKOX068150;
	Thu, 5 Dec 2002 11:05:20 +1030 (CST)
Message-Id: <200212050035.gB50ZKOX068150@cain.gsoft.com.au>
Date: Thu, 5 Dec 2002 11:05:20 +1030 (CST)
From: "Daniel O'Connor" <doconnor@gsoft.com.au>
Reply-To: "Daniel O'Connor" <doconnor@gsoft.com.au>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: Fix reading of mixed-mode CD's in ATAPI CDROM drives
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         46000
>Category:       kern
>Synopsis:       Fix reading of mixed-mode CD's in ATAPI CDROM drives
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    sos
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Dec 04 16:40:01 PST 2002
>Closed-Date:    Thu Feb 20 12:32:41 PST 2003
>Last-Modified:  Thu Feb 20 12:32:41 PST 2003
>Originator:     Daniel O'Connor
>Release:        FreeBSD 4.7-RC i386
>Organization:
>Environment:
System: FreeBSD cain.gsoft.com.au 4.7-RC FreeBSD 4.7-RC #11: Mon Sep 30 17:25:01 CST 2002 doconnor@cain.gsoft.com.au:/usr/obj/usr/src/sys/CAIN i386


>Description:
The ATAPI CD code picks the block size of the first track as the default when
trying to mount a CD, this breaks when you have a mixed mode CD and the first
track is audio (Tries to read a data track with a block size of 2352 bytes)

>How-To-Repeat:
mount_cd9660 /dev/acd0c /mnt

>Fix:

Obtained from Chris Faulhaber <jedgar@fxp.org>
See message ID 20021015010307.GA39347@peitho.fxp.org on -stable.

Index: sys/dev/ata/atapi-cd.c
===================================================================
RCS file: /usr/CVS-Repository/src/sys/dev/ata/atapi-cd.c,v
retrieving revision 1.48.2.17
diff -u -r1.48.2.17 atapi-cd.c
--- sys/dev/ata/atapi-cd.c      31 Jul 2002 11:19:25 -0000      1.48.2.17
+++ sys/dev/ata/atapi-cd.c      5 Dec 2002 00:29:40 -0000
@@ -1263,7 +1263,7 @@
     }
     cdp->toc.hdr.len = ntohs(cdp->toc.hdr.len);
 
-    cdp->block_size = (cdp->toc.tab[0].control & 4) ? 2048 : 2352;
+    cdp->block_size = 2048;
     acd_set_ioparm(cdp);
     bzero(ccb, sizeof(ccb));
     ccb[0] = ATAPI_READ_CAPACITY;

http://www.gsoft.com.au/~doconnor/atapi-cd-mixed.patch

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->sos 
Responsible-Changed-By: johan 
Responsible-Changed-When: Thu Dec 19 10:54:37 PST 2002 
Responsible-Changed-Why:  
Over to ATA maintainer. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=46000 
State-Changed-From-To: open->closed 
State-Changed-By: sos 
State-Changed-When: Thu Feb 20 12:31:46 PST 2003 
State-Changed-Why:  
Use the /dev/acdXtN devices to access individual tracks and the 
block sixe will be correct. 

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