From simonw@matteworld.com  Tue Sep 16 10:27:08 2003
Return-Path: <simonw@matteworld.com>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id D4C2416A4B3
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 16 Sep 2003 10:27:08 -0700 (PDT)
Received: from flamingo.mail.pas.earthlink.net (flamingo.mail.pas.earthlink.net [207.217.120.232])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 289B143F3F
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 16 Sep 2003 10:27:06 -0700 (PDT)
	(envelope-from simonw@matteworld.com)
Received: from user-119bq9k.biz.mindspring.com ([66.149.233.52] helo=matteworld.com)
	by flamingo.mail.pas.earthlink.net with esmtp (Exim 3.33 #1)
	id 19zJbV-0006Im-00
	for FreeBSD-gnats-submit@freebsd.org; Tue, 16 Sep 2003 10:27:05 -0700
Message-Id: <3F6747E8.92E8C623@matteworld.com>
Date: Tue, 16 Sep 2003 10:27:04 -0700
From: Simon Walton <simonw@matteworld.com>
Sender: simonw@FreeBSD.ORG
To: FreeBSD-gnats-submit@freebsd.org
Subject: [Patch] ATA controller seems to have wrong ID for ServerWorks chipset

>Number:         56924
>Category:       kern
>Synopsis:       [Patch] ATA controller seems to have wrong ID for ServerWorks chipset
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    sos
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Sep 16 10:30:14 PDT 2003
>Closed-Date:    Sat Oct 25 12:49:19 PDT 2003
>Last-Modified:  Sat Oct 25 12:49:19 PDT 2003
>Originator:     Simon Walton
>Release:        FreeBSD 4.7-RELEASE i386
>Organization:
>Environment:
System: FreeBSD mongo 4.7-RELEASE FreeBSD 4.7-RELEASE #0: Mon Sep 15
17:24:01 PDT 2003 simonw@mongo:/usr/src/sys/compile/MONGO i386

Compaq/HP ProLiant ML310, Pentium 4, 2.2 GHz

>Description:
This server was fitted with two ATA-100 disks on a single IDE port.
According
to the atacontrol command the host was using PIO to access them, and
atacontrol
would not renegotiate to UDMA speeds. The disks gave poor performance.

Investiation shows that the ATA driver apparently checked for the
wrong value of the chip ID. When this was changed the kernel
automatically
negotiated to UDMA 100 and the disk performance was significantly
improved.

The current code seems to check for the chip's subid, not the chip id:

pciconf -lv
...
atapci0@pci0:15:1:      class=0x01018a card=0x02121166 chip=0x02131166
rev=0xa0
hdr=0x00
    vendor   = 'Reliance Computer Corp./ServerWorks'
    class    = mass storage
    subclass = ATA


>How-To-Repeat:

Add ATA disks to the above-specified system. Use atacontrol to observe
the data-rate.

>Fix:

*** /sys/dev/ata/ata-dma.c.orig Tue Aug 26 11:53:22 2003
--- /sys/dev/ata/ata-dma.c      Tue Aug 26 11:54:32 2003
***************
*** 822,827 ****
--- 822,828 ----
        atadev->mode = ATA_PIO0 + apiomode;
        return;
  
+     case 0x02131166:  /* ServerWorks CSB5 ATA66/100 controller */
      case 0x02121166:  /* ServerWorks CSB5 ATA66/100 controller */
        if (udmamode >= 5 && pci_get_revid(parent) >= 0x92) {
            error = ata_command(atadev, ATA_C_SETFEATURES, 0,
*** /sys/dev/ata/ata-pci.c.orig Tue Aug 26 12:10:33 2003
--- /sys/dev/ata/ata-pci.c      Tue Aug 26 12:25:24 2003
***************
*** 242,247 ****
--- 242,248 ----
      case 0x02111166:
        return "ServerWorks ROSB4 ATA33 controller";
  
+     case 0x02131166:
      case 0x02121166:
        if (pci_get_revid(dev) >= 0x92)
            return "ServerWorks CSB5 ATA100 controller";
>Release-Note:
>Audit-Trail:

From: Soren Schmidt <sos@spider.deepcore.dk>
To: Simon Walton <simonw@matteworld.com>
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: kern/56924: [Patch] ATA controller seems to have wrong ID for ServerWorks
 chipset
Date: Tue, 16 Sep 2003 19:57:00 +0200 (CEST)

 It seems Simon Walton wrote:
 > The current code seems to check for the chip's subid, not the chip id:
 > 
 > pciconf -lv
 > ...
 > atapci0@pci0:15:1:      class=0x01018a card=0x02121166 chip=0x02131166
 > rev=0xa0
 > hdr=0x00
 >     vendor   = 'Reliance Computer Corp./ServerWorks'
 >     class    = mass storage
 >     subclass = ATA
 
 Nope, what you have is a CSB6 chip, the code in 4.7 only knows about
 the CSB5...
 
 -Sren

From: Simon Walton <simonw@matteworld.com>
To: Soren Schmidt <sos@spider.deepcore.dk>
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: kern/56924: [Patch] ATA controller seems to have wrong ID for 
 ServerWorkschipset
Date: Tue, 16 Sep 2003 11:24:28 -0700

 Soren Schmidt wrote:
 > 
 > It seems Simon Walton wrote:
 > > The current code seems to check for the chip's subid, not the chip id:
 > >
 > > pciconf -lv
 > > ...
 > > atapci0@pci0:15:1:      class=0x01018a card=0x02121166 chip=0x02131166
 > > rev=0xa0
 > > hdr=0x00
 > >     vendor   = 'Reliance Computer Corp./ServerWorks'
 > >     class    = mass storage
 > >     subclass = ATA
 > 
 > Nope, what you have is a CSB6 chip, the code in 4.7 only knows about
 > the CSB5...
 > 
 > -Sren
 
    OK. Is this fixed in the 4.x branch? I see the same values
 in the CVS repository.
 
 Simon
Responsible-Changed-From-To: freebsd-bugs->sos 
Responsible-Changed-By: kris 
Responsible-Changed-When: Fri Oct 10 22:29:50 PDT 2003 
Responsible-Changed-Why:  
Assign to ata maintainer 

http://www.freebsd.org/cgi/query-pr.cgi?pr=56924 
State-Changed-From-To: open->closed 
State-Changed-By: sos 
State-Changed-When: Sat Oct 25 12:47:58 PDT 2003 
State-Changed-Why:  
The PCI is not "wrong" its for the CSB5, not the CSB6 as you have here. 

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