From root@cox-internet.com  Wed Jan 14 22:44:28 2004
Return-Path: <root@cox-internet.com>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 2BC0D16A4CF
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 14 Jan 2004 22:44:28 -0800 (PST)
Received: from cox-internet.com (cdm-208-180-67-158.bcst.cox-internet.com [208.180.67.158])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 13C8543D46
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 14 Jan 2004 22:44:22 -0800 (PST)
	(envelope-from root@cox-internet.com)
Received: from cox-internet.com (localhost [127.0.0.1])
	by cox-internet.com (8.12.10/8.12.10) with ESMTP id i0F6iMqw000798;
	Thu, 15 Jan 2004 00:44:22 -0600 (CST)
	(envelope-from root@cox-internet.com)
Received: (from root@localhost)
	by cox-internet.com (8.12.10/8.12.10/Submit) id i0F6iMBC000797;
	Thu, 15 Jan 2004 00:44:22 -0600 (CST)
	(envelope-from root)
Message-Id: <200401150644.i0F6iMBC000797@cox-internet.com>
Date: Thu, 15 Jan 2004 00:44:22 -0600 (CST)
From: Charlie & <root@cox-internet.com>
Reply-To: Charlie & <zdenko@cox-internet.com>
To: FreeBSD-gnats-submit@freebsd.org
Cc: zdenko@cox-internet.com
Subject: ata(4) driver misses PATA-slave in mixed SATA+PATA card: Promise SATA150 TX2plus (2 SATA + 1 PATA)
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         61379
>Category:       kern
>Synopsis:       ata(4) driver misses PATA-slave in mixed SATA+PATA card: Promise SATA150 TX2plus (2 SATA + 1 PATA)
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    sos
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jan 14 22:50:07 PST 2004
>Closed-Date:    Mon Aug 16 12:13:01 GMT 2004
>Last-Modified:  Mon Aug 16 12:13:01 GMT 2004
>Originator:     Zdenko Tomasic
>Release:        FreeBSD 5.2-CURRENT i386
>Organization:
>Environment:
System: FreeBSD cox-internet.com 5.2-CURRENT FreeBSD 5.2-CURRENT #0: Wed Jan 14 14:33:19 CST 2004 root@cdm-208-180-121-209.bcst.cox-internet.com:/usr/obj/usr/src/sys/GENERIC i386


	
i386,pentiuum II, ata(4)
>Description:
	
ata(4) driver misses PATA-slave in mixed SATA+PATA card: Promise SATA150 TX2plus (2 SATA + 1 PATA)
currently, there are no SATA drives (card has 2 SATA ports), but there are 
2 PATA drives (card has 1 PATA port), both 200GB Western Digitals
only ata4-master one is found (as ad8), corresponding slave is missing.
perhaps driver  treats all ports in a card as either PATA or SATA (but not both).

verbose boot excerpt:

atapci0: <Intel PIIX4 UDMA33 controller> port 0xd800-0xd80f at device 4.1 on pci0
ata0: reset tp1 mask=03 ostat0=8e ostat1=50
ata0-master: stat=0xff err=0x50 lsb=0xff msb=0xff
ata0-master: stat=0xff err=0xff lsb=0xff msb=0xff
ata0-master: stat=0xff err=0xff lsb=0xff msb=0xff
ata0-master: stat=0xff err=0xff lsb=0xff msb=0xff
ata0-master: stat=0xff err=0xff lsb=0xff msb=0xff
ata0-master: stat=0xff err=0xff lsb=0xff msb=0xff
ata0-master: stat=0xff err=0xff lsb=0xff msb=0xff
ata0-master: stat=0xff err=0xff lsb=0xff msb=0xff
ata0-master: stat=0xff err=0xff lsb=0xff msb=0xff
ata0-master: stat=0xff err=0xff lsb=0xff msb=0xff
ata0-master: stat=0xff err=0xff lsb=0xff msb=0xff
ata0-master: stat=0xff err=0xff lsb=0xff msb=0xff
ata0-master: stat=0xff err=0xff lsb=0xff msb=0xff
ata0-master: stat=0xff err=0xff lsb=0xff msb=0xff
ata0-master: stat=0xff err=0xff lsb=0xff msb=0xff
ata0-master: stat=0xff err=0xff lsb=0xff msb=0xff
ata0-master: stat=0xff err=0xff lsb=0xff msb=0xff
ata0-master: stat=0xff err=0xff lsb=0xff msb=0xff
ata0-master: stat=0xff err=0xff lsb=0xff msb=0xff
ata0-master: stat=0xff err=0xff lsb=0xff msb=0xff
ata0-master: stat=0xff err=0xff lsb=0xff msb=0xff
ata0-master: stat=0xff err=0xff lsb=0xff msb=0xff
ata0-master: stat=0xff err=0xff lsb=0xff msb=0xff
ata0-slave:  stat=0x50 err=0x01 lsb=0x00 msb=0x00
ata0: reset tp2 mask=02 stat0=ff stat1=50 devices=0x2<ATA_SLAVE>
ata0: at 0x1f0 irq 14 on atapci0
ata0: [MPSAFE]
ata1: reset tp1 mask=03 ostat0=50 ostat1=00
ata1-master: stat=0x80 err=0x80 lsb=0x80 msb=0x80
ata1-master: stat=0x80 err=0x80 lsb=0x80 msb=0x80
ata1-master: stat=0x80 err=0x80 lsb=0x80 msb=0x80
ata1-master: stat=0x80 err=0x80 lsb=0x80 msb=0x80
ata1-master: stat=0x00 err=0x01 lsb=0x14 msb=0xeb
ata1-slave:  stat=0x00 err=0x00 lsb=0x00 msb=0x00
ata1: reset tp2 mask=03 stat0=00 stat1=00 devices=0x4<ATAPI_MASTER>
ata1: at 0x170 irq 15 on atapci0
ata1: [MPSAFE]
atapci1: <Promise PDC20375 SATA150 controller> port 0xa400-0xa47f,0xa800-0xa80f,0xb000-0xb03f mem 0xd3000000-0xd301ffff,0xd3800000-0xd3800fff irq 10 at device 12.0 on pci0
atapci1: [MPSAFE]
ata2: reset tp1 mask=01 ostat0=7f ostat1=7f
ata2-master: stat=0x7f err=0x00 lsb=0x00 msb=0x00
ata2-master: stat=0x7f err=0x00 lsb=0x00 msb=0x00
ata2-master: stat=0x7f err=0x00 lsb=0x00 msb=0x00
ata2-master: stat=0x7f err=0x00 lsb=0x00 msb=0x00
ata2-master: stat=0x7f err=0x00 lsb=0x00 msb=0x00
ata2-master: stat=0x7f err=0x00 lsb=0x00 msb=0x00
ata2-master: stat=0x7f err=0x00 lsb=0x00 msb=0x00
ata2-master: stat=0x7f err=0x00 lsb=0x00 msb=0x00
ata2-master: stat=0x7f err=0x00 lsb=0x00 msb=0x00
ata2-master: stat=0x7f err=0x00 lsb=0x00 msb=0x00
ata2-master: stat=0x7f err=0x00 lsb=0x00 msb=0x00
ata2-master: stat=0x7f err=0x00 lsb=0x00 msb=0x00
ata2-master: stat=0x7f err=0x00 lsb=0x00 msb=0x00
ata2-master: stat=0x7f err=0x00 lsb=0x00 msb=0x00
ata2-master: stat=0x7f err=0x00 lsb=0x00 msb=0x00
ata2-master: stat=0x7f err=0x00 lsb=0x00 msb=0x00
ata2-master: stat=0x7f err=0x00 lsb=0x00 msb=0x00
ata2-master: stat=0x7f err=0x00 lsb=0x00 msb=0x00
ata2-master: stat=0x7f err=0x00 lsb=0x00 msb=0x00
ata2-master: stat=0x7f err=0x00 lsb=0x00 msb=0x00
ata2-master: stat=0x7f err=0x00 lsb=0x00 msb=0x00
ata2-master: stat=0x7f err=0x00 lsb=0x00 msb=0x00
ata2: reset tp2 mask=00 stat0=ff stat1=00 devices=0x0
ata2: at 0xd3800000 on atapci1
ata2: [MPSAFE]
ata3: reset tp1 mask=01 ostat0=7f ostat1=7f
ata3-master: stat=0x7f err=0x00 lsb=0x00 msb=0x00
ata3-master: stat=0x7f err=0x00 lsb=0x00 msb=0x00
ata3-master: stat=0x7f err=0x00 lsb=0x00 msb=0x00
ata3-master: stat=0x7f err=0x00 lsb=0x00 msb=0x00
ata3-master: stat=0x7f err=0x00 lsb=0x00 msb=0x00
ata3-master: stat=0x7f err=0x00 lsb=0x00 msb=0x00
ata3-master: stat=0x7f err=0x00 lsb=0x00 msb=0x00
ata3-master: stat=0x7f err=0x00 lsb=0x00 msb=0x00
ata3-master: stat=0x7f err=0x00 lsb=0x00 msb=0x00
ata3-master: stat=0x7f err=0x00 lsb=0x00 msb=0x00
ata3-master: stat=0x7f err=0x00 lsb=0x00 msb=0x00
ata3-master: stat=0x7f err=0x00 lsb=0x00 msb=0x00
ata3-master: stat=0x7f err=0x00 lsb=0x00 msb=0x00
ata3-master: stat=0x7f err=0x00 lsb=0x00 msb=0x00
ata3-master: stat=0x7f err=0x00 lsb=0x00 msb=0x00
ata3-master: stat=0x7f err=0x00 lsb=0x00 msb=0x00
ata3-master: stat=0x7f err=0x00 lsb=0x00 msb=0x00
ata3-master: stat=0x7f err=0x00 lsb=0x00 msb=0x00
ata3-master: stat=0x7f err=0x00 lsb=0x00 msb=0x00
ata3-master: stat=0x7f err=0x00 lsb=0x00 msb=0x00
ata3-master: stat=0x7f err=0x00 lsb=0x00 msb=0x00
ata3-master: stat=0x7f err=0x00 lsb=0x00 msb=0x00
ata3: reset tp2 mask=00 stat0=ff stat1=00 devices=0x0
ata3: at 0xd3800000 on atapci1
ata3: [MPSAFE]
ata4: reset tp1 mask=01 ostat0=50 ostat1=50
ata4-master: stat=0x50 err=0x01 lsb=0x00 msb=0x00
ata4: reset tp2 mask=01 stat0=50 stat1=00 devices=0x1<ATA_MASTER>
ata4: at 0xd3800000 on atapci1
ata4: [MPSAFE]
ata0-slave: pio=0x0c wdma=0x22 udma=0x44 cable=80pin
ata0-slave: setting PIO4 on Intel PIIX4 chip
ata0-slave: setting UDMA33 on Intel PIIX4 chip
GEOM: create disk ad1 dp=0xc5dfe560
ad1: <Maxtor 53073U6/DA6207V0> ATA-5 disk at ata0-slave
ad1: 29311MB (60030432 sectors), 59554 C, 16 H, 63 S, 512 B
ad1: 1 secs/int, 1 depth queue, UDMA33
GEOM: new disk ad1
ar: FreeBSD check1 failed
ata1: spurious interrupt - status=0x50 error=0x00
ata1-master: pio=0x0c wdma=0x22 udma=0x44 cable=80pin
ata1-master: setting PIO4 on Intel PIIX4 chip
acd0: <Pioneer DVD-ROM ATAPIModel DVD-106S 0108/E1.08> DVDROM drive at ata1 as master
acd0: read 6875KB/s (6875KB/s), 256KB buffer, PIO4
acd0: Reads: CDR, CDRW, CDDA stream, DVDROM, DVDR, packet
acd0: Writes:
acd0: Audio: play, 256 volume levels
acd0: Mechanism: ejectable tray, unlocked
acd0: Medium: no/blank disc
ata4-master: pio=0x0c wdma=0x22 udma=0x45 cable=40pin
ata4-master: setting PIO4 on Promise PDC20375 chip
ata4-master: setting UDMA100 on Promise PDC20375 chip
[0] f:00 typ:11 s(CHS):0/1/1 e(CHS):1023/0/63 s:63 l:4096512
[1] f:80 typ:165 s(CHS):1023/255/63 e(CHS):1023/15/63 s:4096575 l:55933857
[2] f:00 typ:0 s(CHS):0/0/0 e(CHS):0/0/0 s:0 l:0
[3] f:00 typ:0 s(CHS):0/0/0 e(CHS):0/0/0 s:0 l:0
GEOM: Configure ad1s1, start 32256 length 2097414144 end 2097446399
GEOM: Configure ad1s2, start 2097446400 length 28638134784 end 30735581183
GEOM: create disk ad8 dp=0xc5dfe760
ad8: <WDC WD2000JB-00EVA0/15.05R15> ATA-6 disk at ata4-master
ad8: 190782MB (390721968 sectors), 387621 C, 16 H, 63 S, 512 B
ad8: 1 secs/int, 1 depth queue, UDMA100
ar: Promise check1 failed
GEOM: Configure ad1s2a, start 0 length 268435456 end 268435455
GEOM: Configure ad1s2b, start 268435456 length 516096000 end 784531455
GEOM: Configure ad1s2c, start 0 length 28638134784 end 28638134783
GEOM: Configure ad1s2d, start 784531456 length 206438400 end 990969855
GEOM: Configure ad1s2e, start 990969856 length 1651507200 end 2642477055
GEOM: Configure ad1s2f, start 2642477056 length 25995657728 end 28638134783
GEOM: new disk ad8
[0] f:00 typ:6 s(CHS):0/1/1 e(CHS):99/254/63 s:63 l:1606437
[1] f:80 typ:165 s(CHS):100/0/1 e(CHS):1023/254/63 s:1606500 l:389110365
[2] f:00 typ:0 s(CHS):0/0/0 e(CHS):0/0/0 s:0 l:0
[3] f:00 typ:0 s(CHS):0/0/0 e(CHS):0/0/0 s:0 l:0
GEOM: Configure ad8s1, start 32256 length 822495744 end 822527999
GEOM: Configure ad8s2, start 822528000 length 199224506880 end 200047034879
GEOM: Configure ad8s2a, start 0 length 164505600 end 164505599
GEOM: Configure ad8s2b, start 4277145600 length 1316044800 end 5593190399
GEOM: Configure ad8s2c, start 0 length 199224506880 end 199224506879
GEOM: Configure ad8s2e, start 164505600 length 4112640000 end 4277145599
GEOM: Configure ad8s2f, start 5593190400 length 2467584000 end 8060774399
GEOM: Configure ad8s2g, start 8060774400 length 191163732480 end 199224506879


>How-To-Repeat:
	
boot with the SATA+PATA card like Promise TX2plus
>Fix:
no fix
	


could provide full verbose boot trace if considered useful
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->sos 
Responsible-Changed-By: simon 
Responsible-Changed-When: Thu Jan 15 03:42:55 PST 2004 
Responsible-Changed-Why:  
Over to ata(4) maintainer. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=61379 
State-Changed-From-To: open->feedback 
State-Changed-By: sos 
State-Changed-When: Thu Jan 15 04:02:45 PST 2004 
State-Changed-Why:  
Hmm, the PDC2037x chips are a bit special in the way they handel 
PATA devices, and from your probe it doesn't seem like it support 
more than a master device. Hoowever it is a bit unclear to me 
how to detect this properly. 
If you up to hacking the kernel, you could try to change  

ch->flags |= (ATA_NO_SLAVE | ATA_USE_16BIT); 

to  

ch->flags |= (ATA_USE_16BIT); 

in ata-chipset::ata_promise_mio_allocate() 

Then get back to me with the result. 

k 

http://www.freebsd.org/cgi/query-pr.cgi?pr=61379 

From: Stephen Casner <casner@acm.org>
To: freebsd-gnats-submit@FreeBSD.org
Cc: zdenko@cox-internet.com
Subject: Re: misc/61379: ata(4) driver misses PATA-slave in mixed SATA+PATA
 card: Promise SATA150 TX2plus (2 SATA + 1 PATA)
Date: Mon, 15 Mar 2004 16:53:16 -0800 (PST)

 I performed the test requested in the Audit-Trail:
 
     If you up to hacking the kernel, you could try to change
 
     ch->flags |= (ATA_NO_SLAVE | ATA_USE_16BIT);
 
     to
 
     ch->flags |= (ATA_USE_16BIT);
 
     in ata-chipset::ata_promise_mio_allocate()
 
     Then get back to me with the result.
 
 This solves the problem.  The slave drive is then detected and
 functions properly.  My test was with 5.2.1 loaded from CD and then
 GENERIC rebuilt with the one change above.  My test is on a Maxtor
 SATA/150 PCI card (using the PDC20375 chip) and two Maxtor 250GB PATA
 drives.  There are no SATA drives connected to the controller.
 
 So, I assume that the ATA_NO_SLAVE restriction should apply to the
 SATA ports 1 and 2 on this controller, but not to the PATA port 3.
 
                                                         -- Steve
State-Changed-From-To: feedback->closed 
State-Changed-By: sos 
State-Changed-When: Mon Aug 16 12:11:49 GMT 2004 
State-Changed-Why:  
Fixed in -current. 

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