From nobody@FreeBSD.org  Tue Sep 24 14:55:50 2002
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 576F737B401
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 24 Sep 2002 14:55:50 -0700 (PDT)
Received: from www.freebsd.org (www.FreeBSD.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id EC39643E9C
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 24 Sep 2002 14:55:49 -0700 (PDT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.12.6/8.12.6) with ESMTP id g8OLtn7R067179
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 24 Sep 2002 14:55:49 -0700 (PDT)
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.12.6/8.12.6/Submit) id g8OLtnDu067178;
	Tue, 24 Sep 2002 14:55:49 -0700 (PDT)
Message-Id: <200209242155.g8OLtnDu067178@www.freebsd.org>
Date: Tue, 24 Sep 2002 14:55:49 -0700 (PDT)
From: Patrick Bihan-Faou <patrick@mindstep.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Support for the SiS 651 ATA controller
X-Send-Pr-Version: www-1.0

>Number:         43345
>Category:       kern
>Synopsis:       Support for the SiS 651 ATA controller
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    sos
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Sep 24 15:00:14 PDT 2002
>Closed-Date:    Thu Feb 20 12:27:32 PST 2003
>Last-Modified:  Sat May 31 11:00:28 PDT 2003
>Originator:     Patrick Bihan-Faou
>Release:        RELENG_4 on i386
>Organization:
MindStep Corporation
>Environment:
Checked out using the following tags:

-r RELENG_4 -D "2002/09/14 00:00 UTC"

>Description:
The ATA controller in the SiS951 chipset is not recognized properly. This causes FreeBSD to treat it as a basic ATA controller. However using the default BIOS config (with ultra-dma enabled) this causes the system to freeze as soon as the system tries to use the hard drives.

While this controller supposedly supports ATA-133, using it like other ATA-100 chipsets from SiS fixes the problem.
>How-To-Repeat:
      
>Fix:
Either disable 'ultra-dma' from the bios or add code to detect the SiS951 integrated ATA controller in the same way as the SiS950 chipset.

The parent device ID for this chipset is: 0x06511039

The following patch does the trick:

--- ata-dma.c.orig      Mon Sep 16 15:46:42 2002
+++ ata-dma.c   Mon Sep 16 15:51:14 2002
@@ -503,6 +503,7 @@
            ata_find_dev(parent, 0x06401039, 0) ||      /* SiS 640 */
            ata_find_dev(parent, 0x06451039, 0) ||      /* SiS 645 */
            ata_find_dev(parent, 0x06501039, 0) ||      /* SiS 650 */
+           ata_find_dev(parent, 0x06511039, 0) ||      /* SiS 651 */
            ata_find_dev(parent, 0x07301039, 0) ||      /* SiS 730 */
            ata_find_dev(parent, 0x07331039, 0) ||      /* SiS 733 */
            ata_find_dev(parent, 0x07351039, 0) ||      /* SiS 735 */
bash-2.05a# diff -u ata-pci.c.orig ata-pci.c
--- ata-pci.c.orig      Mon Sep 16 15:41:26 2002
+++ ata-pci.c   Tue Sep 24 19:50:33 2002
@@ -190,6 +190,7 @@
            ata_find_dev(dev, 0x06401039, 0) ||
            ata_find_dev(dev, 0x06451039, 0) ||
            ata_find_dev(dev, 0x06501039, 0) ||
+           ata_find_dev(dev, 0x06511039, 0) ||
            ata_find_dev(dev, 0x07301039, 0) ||
            ata_find_dev(dev, 0x07331039, 0) ||
            ata_find_dev(dev, 0x07351039, 0) ||


These are against:
ata-pic.c 1.32.2.9
ata-dma.c 1.32.2.26


>Release-Note:
>Audit-Trail:

From: Soeren Schmidt <sos@spider.deepcore.dk>
To: Patrick Bihan-Faou <patrick@mindstep.com>
Cc: freebsd-gnats-submit@FreeBSD.ORG
Subject: Re: kern/43345: Support for the SiS 651 ATA controller
Date: Wed, 25 Sep 2002 09:07:18 +0200 (CEST)

 It seems Patrick Bihan-Faou wrote:
 > >Description:
 > The ATA controller in the SiS951 chipset is not recognized properly. This causes FreeBSD to treat it as a basic ATA controller. However using the default BIOS config (with ultra-dma enabled) this causes the system to freeze as soon as the system tries to use the hard drives.
 > 
 > While this controller supposedly supports ATA-133, using it like other ATA-100 chipsets from SiS fixes the problem.
 > >How-To-Repeat:
 
 I have the real solution in the works, so please be patient...
 
 -Sren
Responsible-Changed-From-To: freebsd-bugs->sos 
Responsible-Changed-By: johan 
Responsible-Changed-When: Sun Sep 29 06:36:16 PDT 2002 
Responsible-Changed-Why:  
Over to mr ATA. 

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

From: "Aaron D. Gifford" <agifford@infowest.com>
To: freebsd-gnats-submit@freebsd.org, current@freebsd.org
Cc:  
Subject: Re: kern/43345: Support for the SiS 651 ATA controller
Date: Wed, 12 Feb 2003 10:24:00 -0700

 Hi,
 
 When I attempted to install FreeBSD 5.0-RELEASE on a Shuttle SS51G box, 
 just like some other users, I encountered the "ata0: READ command 
 timeout" error during boot.  I then tried 4.7-RELEASE and saw the same 
 problem.
 
 A quick search of the FreeBSD mail archives turned up other users with 
 my same hardware (which uses the SiS 651 ata controller) who had 
 encountered this.  Those messages told me that I needed to either 
 disable UDMA in my system's BIOS, or set the sysctl variable 
 hw.ata.ata_dma to zero.  I disabled UDMA in my BIOS and was able to 
 complete the install.
 
 Then on one of the messages, I noticed a link to Patrick Bihan-Faou's 
 problem report, read it, and tried out his patch under 5.0-CURRENT 
 (having completed my install of 5.0-RELEASE and updated to -CURRENT). 
 Of course the line numbers were a bit different, but a hand patch of the 
 two files was quick and easy.  A quick kernel recompile, BIOS re-enable 
 of UDMA, and boot proved the patch worked!
 
 Thank you, Patrick, for your patch!
 
 Now for a few questions:
 
 Is there any way Patrick's solution could be temporarily committed to 
 -CURRENT and/or -STABLE until Soeren's forthcoming real solution is 
 available (the one Soeren mentions in the PR)? Is there some bad side 
 effect to Patrick's two-line temporary fix that I should worry about? 
 If there are no negatives to the patch (other than a better fix is 
 coming in the future), is there some other reason that the patch is not 
 a good temporary solution for users with SiS 651 based systems, so they 
 can install and boot to FreeBSD without the work-arounds (BIOS or sysctl 
 setting change)?
 
 Thanks for your good work, Soeren, and thanks again for your patch, Patrick.
 
 Aaron out.
 
 P.S. Here is Patrick's solution as a diff against a recent 5.0-CURRENT:
 
 --- /usr/src/sys/dev/ata/ata-dma.c.orig	Fri Feb  7 11:22:38 2003
 +++ /usr/src/sys/dev/ata/ata-dma.c	Fri Feb  7 11:23:24 2003
 @@ -645,6 +645,7 @@
   	    ata_find_dev(parent, 0x06401039, 0) ||	/* SiS 640 */
   	    ata_find_dev(parent, 0x06451039, 0) ||	/* SiS 645 */
   	    ata_find_dev(parent, 0x06501039, 0) ||	/* SiS 650 */
 +	    ata_find_dev(parent, 0x06511039, 0) ||	/* SiS 651 */
   	    ata_find_dev(parent, 0x07301039, 0) ||	/* SiS 730 */
   	    ata_find_dev(parent, 0x07331039, 0) ||	/* SiS 733 */
   	    ata_find_dev(parent, 0x07351039, 0) ||	/* SiS 735 */
 --- /usr/src/sys/dev/ata/ata-pci.c.orig	Fri Feb  7 11:22:46 2003
 +++ /usr/src/sys/dev/ata/ata-pci.c	Fri Feb  7 11:23:40 2003
 @@ -189,6 +189,7 @@
   	    ata_find_dev(dev, 0x06401039, 0) ||
   	    ata_find_dev(dev, 0x06451039, 0) ||
   	    ata_find_dev(dev, 0x06501039, 0) ||
 +	    ata_find_dev(dev, 0x06511039, 0) ||
   	    ata_find_dev(dev, 0x07301039, 0) ||
   	    ata_find_dev(dev, 0x07331039, 0) ||
   	    ata_find_dev(dev, 0x07351039, 0) ||
 

From: Soeren Schmidt <sos@spider.deepcore.dk>
To: "Aaron D. Gifford" <agifford@infowest.com>
Cc: freebsd-gnats-submit@FreeBSD.ORG, current@FreeBSD.ORG
Subject: Re: kern/43345: Support for the SiS 651 ATA controller
Date: Wed, 12 Feb 2003 19:09:35 +0100 (CET)

 It seems Aaron D. Gifford wrote:
 > Then on one of the messages, I noticed a link to Patrick Bihan-Faou's 
 > problem report, read it, and tried out his patch under 5.0-CURRENT 
 > (having completed my install of 5.0-RELEASE and updated to -CURRENT). 
 > Of course the line numbers were a bit different, but a hand patch of the 
 > two files was quick and easy.  A quick kernel recompile, BIOS re-enable 
 > of UDMA, and boot proved the patch worked!
 
 The patch does *not* work, the reason you have it sortof working is that
 the driver writes to the wrong regs, and your BIOS set up the mode
 correctly..
 I have a working solution here, and it will get committed to -current
 as soon as I have it tested some more. This cannot easily be backported
 to -stable since it is part of a major rewrite of parts of the ATA
 driver. However when it has proven to be working, I'll try to get the
 SiS part backported to the older ATA driver in -stable, time permitting...
 
 -Sren

From: "M. Vasko" <mel.kor@atlas.cz>
To: <freebsd-gnats-submit@FreeBSD.org>
Cc:  
Subject: Re: kern/43345: Support for the SiS 651 ATA controller
Date: Sat, 15 Feb 2003 14:33:59 +0100

 The same problem is with SiS 963 southbridge (new SiS 648 P4 chipset),
 probably with other newer SiS controllers too. 
 In my case this is even worse, because my BIOS doesn't allow to disable
 Ultra-DMA, so I have to disable DMA completely. PIO isn't very performance
 friendly however...
 
 
State-Changed-From-To: open->closed 
State-Changed-By: sos 
State-Changed-When: Thu Feb 20 12:26:41 PST 2003 
State-Changed-Why:  
The right solution has been committed to -current. 

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

From: "Patrick Bihan-Faou" <patrick@mindstep.com>
To: <freebsd-gnats-submit@FreeBSD.org>,
	"Patrick Bihan-Faou" <patrick@mindstep.com>
Cc:  
Subject: Re: kern/43345: Support for the SiS 651 ATA controller
Date: Wed, 26 Feb 2003 20:30:17 +0100

 How about RELENG_4 users ? Machines with the SIS chipsets are quite common
 now, and I am not able to move up to FreeBSD 5.0 let alone -CURRENT.
 
 

From: Marcel Loesberg <marcel.loesberg@esined.net>
To: freebsd-gnats-submit@FreeBSD.org, patrick@mindstep.com
Cc:  
Subject: Re: kern/43345: Support for the SiS 651 ATA controller
Date: Sat, 31 May 2003 19:52:11 +0200

  > How about RELENG_4 users ? Machines with the SIS chipsets are quite
  > common now, and I am not able to move up to FreeBSD 5.0 let alone
  > -CURRENT.
  >
 
 Same here.
 I'm buying a lot of machines these days and most of them have SIS
 chipsets.
 Most of my customers (I rent dedicated servers with FreeBSD on them)
 don't want 5.0 or -CURRENT on "thier" systems so I have to work around
 this problem every time I set-up a machine.
 Is there any way for me to create a boot floppy with a kernel that has
 this patch?
 Also, will closing this PR mean that there will never be a fix for 4.x?
 
>Unformatted:
