From owner-freebsd-bugs@FreeBSD.ORG Mon Dec 27 14:30:24 2004 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 582FF16A4CE for ; Mon, 27 Dec 2004 14:30:24 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2E59F43D39 for ; Mon, 27 Dec 2004 14:30:24 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.1/8.13.1) with ESMTP id iBREUOBE060722 for ; Mon, 27 Dec 2004 14:30:24 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.1/8.13.1/Submit) id iBREUNMp060721; Mon, 27 Dec 2004 14:30:23 GMT (envelope-from gnats) Resent-Date: Mon, 27 Dec 2004 14:30:23 GMT Resent-Message-Id: <200412271430.iBREUNMp060721@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Sergiy Vyshnevetskiy Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A0CB016A4CE for ; Mon, 27 Dec 2004 14:27:19 +0000 (GMT) Received: from www.freebsd.org (www.freebsd.org [216.136.204.117]) by mx1.FreeBSD.org (Postfix) with ESMTP id 626AA43D1F for ; Mon, 27 Dec 2004 14:27:19 +0000 (GMT) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.13.1/8.13.1) with ESMTP id iBRERIph060223 for ; Mon, 27 Dec 2004 14:27:19 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.13.1/8.13.1/Submit) id iBRERIH4060222; Mon, 27 Dec 2004 14:27:18 GMT (envelope-from nobody) Message-Id: <200412271427.iBRERIH4060222@www.freebsd.org> Date: Mon, 27 Dec 2004 14:27:18 GMT From: Sergiy Vyshnevetskiy To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-2.3 Subject: kern/75540: Incorrect probing/configuration of nVidia nForce3/4 SATA controller X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Dec 2004 14:30:24 -0000 >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: