Bug 70227

Summary: 5.2-CURRENT does not recognize <CD-ROM CDU55E/1.0u> CDROM drive at ata1
Product: Base System Reporter: Claudio Destro <o1b6>
Component: kernAssignee: Søren Schmidt <sos>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 5.2-CURRENT   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description Claudio Destro 2004-08-09 20:40:37 UTC
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: <Intel PIIX4 UDMA33 controller> 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<ATA_MASTER>
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.

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.
Comment 1 Simon L. B. Nielsen freebsd_committer freebsd_triage 2004-08-09 20:52:12 UTC
Responsible Changed
From-To: freebsd-bugs->sos

Over to ata(4) maintainer.
Comment 2 Søren Schmidt freebsd_committer freebsd_triage 2004-08-16 12:40:25 UTC
State Changed
From-To: open->closed

That change wont fly, that bit is needed as part of the spec to 
signal a valid device is there.