From owner-freebsd-bugs@FreeBSD.ORG Mon Aug 9 19:40:38 2004 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1AAB616A4CF for ; Mon, 9 Aug 2004 19:40:38 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id E269B43D1D for ; Mon, 9 Aug 2004 19:40:37 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.11/8.12.11) with ESMTP id i79JebbX047147 for ; Mon, 9 Aug 2004 19:40:37 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.11/8.12.11/Submit) id i79Jeb0f047146; Mon, 9 Aug 2004 19:40:37 GMT (envelope-from gnats) Resent-Date: Mon, 9 Aug 2004 19:40:37 GMT Resent-Message-Id: <200408091940.i79Jeb0f047146@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Claudio Destro Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CC41116A4CE for ; Mon, 9 Aug 2004 19:34:29 +0000 (GMT) Received: from www.freebsd.org (www.freebsd.org [216.136.204.117]) by mx1.FreeBSD.org (Postfix) with ESMTP id A84D043D3F for ; Mon, 9 Aug 2004 19:34:29 +0000 (GMT) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.12.11/8.12.11) with ESMTP id i79JYTYE022793 for ; Mon, 9 Aug 2004 19:34:29 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.12.11/8.12.11/Submit) id i79JYTL3022792; Mon, 9 Aug 2004 19:34:29 GMT (envelope-from nobody) Message-Id: <200408091934.i79JYTL3022792@www.freebsd.org> Date: Mon, 9 Aug 2004 19:34:29 GMT From: Claudio Destro To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-2.3 Subject: kern/70227: 5.2-CURRENT does not recognize CDROM drive at ata1 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Aug 2004 19:40:38 -0000 >Number: 70227 >Category: kern >Synopsis: 5.2-CURRENT does not recognize CDROM drive at ata1 >Confidential: no >Severity: serious >Priority: high >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Aug 09 19:40:37 GMT 2004 >Closed-Date: >Last-Modified: >Originator: Claudio Destro >Release: 5.2-CURRENT >Organization: >Environment: FreeBSD vulcan 5.2-CURRENT FreeBSD 5.2-CURRENT #2: Mon Aug 9 20:24:16 CEST 2004 root@vulcan:/mnt/ST52520A/usr-obj/usr/src/sys/VULCAN i386 >Description: the 5.2-CURRENT code in src/sys/dev/ata/ata-lowlevel.c does not recognize my 2x Sony CD-ROM on ata1. The following dump is from dmesg bootverbose=yes before my patch: .. atapci0: port 0xb800-0xb80f,0x376,0x170-0x177,0x3f6,0x1f0-0x1f7 at device 4.1 on pci0 atapci0: Reserved 0x10 bytes for rid 0x20 type 4 at 0xb800 atapci0: Reserved 0x8 bytes for rid 0x10 type 4 at 0x1f0 atapci0: Reserved 0x1 bytes for rid 0x14 type 4 at 0x3f6 ata0: reset tp1 mask=03 ostat0=50 ostat1=00 ata0-master: stat=0x50 err=0x01 lsb=0x00 msb=0x00 ata0-slave: stat=0x00 err=0x01 lsb=0x00 msb=0x00 ata0: reset tp2 stat0=50 stat1=00 devices=0x1 ata0: at 0x1f0 irq 14 on atapci0 ata0: [MPSAFE] atapci0: Reserved 0x8 bytes for rid 0x18 type 4 at 0x170 atapci0: Reserved 0x1 bytes for rid 0x1c type 4 at 0x376 ata1: reset tp1 mask=03 ostat0=50 ostat1=50 ata1-master: stat=0x50 err=0x00 lsb=0x14 msb=0xeb ata1-slave: stat=0x50 err=0x50 lsb=0x50 msb=0x50 ata1-slave: stat=0x50 err=0x50 lsb=0x50 msb=0x50 ata1-slave: stat=0x50 err=0x50 lsb=0x50 msb=0x50 .. ata1-slave: stat=0x50 err=0x50 lsb=0x50 msb=0x50 ata1-slave: stat=0x50 err=0x50 lsb=0x50 msb=0x50 ata1-slave: stat=0x50 err=0x50 lsb=0x50 msb=0x50 ata1: reset tp2 stat0=50 stat1=d0 devices=0x0 ata1: at 0x170 irq 15 on atapci0 ata1: [MPSAFE] .. As you can see ata0 is correctly and quickly recognized, while ata1 is not. I think there is another problem with "stat=0x50 err=0x50 lsb=0x50 msb=0x50" because I have no more CD-ROMs attached, but I don't know how to fix it. >How-To-Repeat: >Fix: This patch solves the immediate problem, and in fact it works for me (now I can see my CD-ROM), but I am new to FreeBSD and also I don't know whether this is a correct solution or not: here I simply assume that when err == 0 then it simply means no errors. --- ata-lowlevel.c.orig Sun Aug 8 22:36:18 2004 +++ ata-lowlevel.c Mon Aug 9 20:00:03 2004 @@ -601,7 +601,7 @@ "stat=0x%02x err=0x%02x lsb=0x%02x msb=0x%02x\n", stat0, err, lsb, msb); if (!(stat0 & ATA_S_BUSY)) { - if ((err & 0x7f) == ATA_E_ILI) { + if ((err & 0x7f) == 0 || (err & 0x7f) == ATA_E_ILI) { if (lsb == ATAPI_MAGIC_LSB && msb == ATAPI_MAGIC_MSB) { ch->devices |= ATA_ATAPI_MASTER; } @@ -626,7 +626,7 @@ " stat=0x%02x err=0x%02x lsb=0x%02x msb=0x%02x\n", stat1, err, lsb, msb); if (!(stat1 & ATA_S_BUSY)) { - if ((err & 0x7f) == ATA_E_ILI) { + if ((err & 0x7f) == 0 || (err & 0x7f) == ATA_E_ILI) { if (lsb == ATAPI_MAGIC_LSB && msb == ATAPI_MAGIC_MSB) { ch->devices |= ATA_ATAPI_SLAVE; } >Release-Note: >Audit-Trail: >Unformatted: