Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 27 Dec 2004 14:27:18 GMT
From:      Sergiy Vyshnevetskiy <serg@vostok.net>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   kern/75540: Incorrect probing/configuration of nVidia nForce3/4 SATA controller
Message-ID:  <200412271427.iBRERIH4060222@www.freebsd.org>
Resent-Message-ID: <200412271430.iBREUNMp060721@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         75540
>Category:       kern
>Synopsis:       Incorrect probing/configuration of nVidia nForce3/4 SATA controller
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Dec 27 14:30:23 GMT 2004
>Closed-Date:
>Last-Modified:
>Originator:     Sergiy Vyshnevetskiy
>Release:        5-stable
>Organization:
>Environment:
FreeBSD serg.vostok.net 5.3-STABLE FreeBSD 5.3-STABLE #0: Mon Dec  6 11:01:12 EET 2004     root@serg.vostok.net:/usr/5/src/sys/i386/compile/SERG  i386
>Description:
Kernel detects nVidia nForce3/nForce4 SATA controller as generic ATA controller - fixed by the first part of the patch.
Then it would say, that you managed to connect an ATA-133(!) disk to SATA controller with 40-pin cable(!), so DMA would be limited to UDMA33. That nonsence is corrected by the second part of the patch.
>How-To-Repeat:
Install FreeBSD on a box with nForce3/nForce4 chipset and attach a SATA HDD to it.
>Fix:
--- sys/dev/ata/ata-chipset.c.orig      Sun Oct 10 18:01:47 2004
+++ sys/dev/ata/ata-chipset.c   Sun Dec  5 23:24:15 2004
@@ -1114,8 +1114,14 @@
      { ATA_NFORCE2_MCP, 0, AMDNVIDIA, NVIDIA, ATA_UDMA6, "nVidia nForce2 MCP" },
      { ATA_NFORCE3,     0, AMDNVIDIA, NVIDIA, ATA_UDMA6, "nVidia nForce3" },
      { ATA_NFORCE3_PRO, 0, AMDNVIDIA, NVIDIA, ATA_UDMA6, "nVidia nForce3 Pro" },
+     { ATA_NFORCE3_PRO_S1, 0, AMDNVIDIA, NVIDIA, ATA_SA150, "nVidia nForce3 Pro" },
+     { ATA_NFORCE3_PRO_S2, 0, AMDNVIDIA, NVIDIA, ATA_SA150, "nVidia nForce3 Pro" },
      { ATA_NFORCE3_MCP, 0, AMDNVIDIA, NVIDIA, ATA_UDMA6, "nVidia nForce3 MCP" },
+     { ATA_NFORCE3_MCP_S1, 0, AMDNVIDIA, NVIDIA, ATA_SA150, "nVidia nForce3 MCP" },
+     { ATA_NFORCE3_MCP_S2, 0, AMDNVIDIA, NVIDIA, ATA_SA150, "nVidia nForce3 MCP" },
      { ATA_NFORCE4,     0, AMDNVIDIA, NVIDIA, ATA_UDMA6, "nVidia nForce4" },
+     { ATA_NFORCE4_S1,     0, AMDNVIDIA, NVIDIA, ATA_SA150, "nVidia nForce4" },
+     { ATA_NFORCE4_S2,     0, AMDNVIDIA, NVIDIA, ATA_SA150, "nVidia nForce4" },
      { 0, 0, 0, 0, 0, 0}};
     char buffer[64];
 
@@ -2861,9 +2867,17 @@
 static int
 ata_check_80pin(struct ata_device *atadev, int mode)
 {
+    device_t parent = device_get_parent(atadev->channel->dev);
+    struct ata_pci_controller *ctlr = device_get_softc(parent);
+
+    if (mode >= ATA_UDMA2 && mode < ATA_SA150 && ctlr->chip->max_dma >= ATA_SA150) {
+       ata_prtdev(atadev,"DMA set to SA150 for any device attached to SATA controller\n");
+       return ATA_SA150;
+    }
+
     if (mode > ATA_UDMA2 && !(atadev->param->hwres & ATA_CABLE_ID)) {
        ata_prtdev(atadev,"DMA limited to UDMA33, non-ATA66 cable or device\n");
-       mode = ATA_UDMA2;
+       return ATA_UDMA2;
     }
     return mode;
 }


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200412271427.iBRERIH4060222>