From owner-freebsd-bugs@FreeBSD.ORG Wed Feb 15 01:50:07 2006 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org 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 C1DCF16A420 for ; Wed, 15 Feb 2006 01:50:07 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3536643D48 for ; Wed, 15 Feb 2006 01:50:07 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id k1F1o6PF077146 for ; Wed, 15 Feb 2006 01:50:06 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id k1F1o6MD077144; Wed, 15 Feb 2006 01:50:06 GMT (envelope-from gnats) Resent-Date: Wed, 15 Feb 2006 01:50:06 GMT Resent-Message-Id: <200602150150.k1F1o6MD077144@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, Alan Amesbury Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0FD0F16A420 for ; Wed, 15 Feb 2006 01:44:46 +0000 (GMT) (envelope-from amesbury@indefi.net) Received: from mail.indefi.net (temp.gui.org [209.98.153.52]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9442743D49 for ; Wed, 15 Feb 2006 01:44:43 +0000 (GMT) (envelope-from amesbury@indefi.net) Received: by mail.indefi.net (Postfix, from userid 1169) id 89FFF11429; Tue, 14 Feb 2006 19:44:41 -0600 (CST) Message-Id: <20060215014441.89FFF11429@mail.indefi.net> Date: Tue, 14 Feb 2006 19:44:41 -0600 (CST) From: Alan Amesbury To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Alan Amesbury Subject: kern/93369: [PATCH] Fix failed detection of Nvidia NForce2 chipset X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Alan Amesbury List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Feb 2006 01:50:07 -0000 >Number: 93369 >Category: kern >Synopsis: [PATCH] Fix failed detection of Nvidia NForce2 chipset >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: update >Submitter-Id: current-users >Arrival-Date: Wed Feb 15 01:50:06 GMT 2006 >Closed-Date: >Last-Modified: >Originator: Alan Amesbury >Release: FreeBSD 5.4-RELEASE-p11 i386 >Organization: University of Minnesota >Environment: System: FreeBSD modem.oitsec.umn.edu 5.4-RELEASE-p11 FreeBSD 5.4-RELEASE-p11 #5: Tue Feb 14 18:21:41 CST 2006 root@modem.oitsec.umn.edu:/usr/obj/usr/src/sys/OITSEC-5_4-L i386 MSI K7N2 Delta2-LSR motherboard with Nvidia NForce2 chipset (MCP2S). >Description: At boot, FreeBSD identifies the SATA chipset as "GENERIC ATA controller" with mode of UDMA33. This is VERY similar to PR #71321, but not quite identical; the chip ID reported by 'pciconf' is different, and the chipset not being identified correctly is SATA, not PATA. NOTE: The if-else statement in my patch *appears* to work, i.e., I haven't noticed any instability having applied this patch. Someone who knows what they're doing should probably take a closer look. % pciconf -lv . . . atapci0@pci0:9:0: class=0x01018a card=0x57001462 chip=0x008510de rev=0xa3 hdr=0x00 vendor = 'NVIDIA Corporation' device = 'MCP2S Parallel ATA Controller' class = mass storage subclass = ATA atapci1@pci0:11:0: class=0x010185 card=0x57001462 chip=0x008e10de rev=0xa3 hdr=0x00 vendor = 'NVIDIA Corporation' device = 'MCP2S Serial ATA Compatible Controller' class = mass storage subclass = ATA . . . % dmesg | grep ata atapci0: port 0xf000-0xf00f,0x376,0x170-0x177,0x3f6,0x1f0-0x1f7 at device 9.0 on pci0 ata0: channel #0 on atapci0 ata1: channel #1 on atapci0 atapci1: port 0xbc00-0xbc0f,0xb70-0xb73,0x970-0x977,0xbf0-0xbf3,0x9f0-0x9f7 irq 22 at device 11.0 on pci0 ata2: channel #0 on atapci1 ata3: channel #1 on atapci1 ad0: 57241MB [116301/16/63] at ata0-master UDMA100 acd0: CDROM at ata1-master PIO4 ata2-master: DMA limited to UDMA33, non-ATA66 cable or device ad4: 238475MB [484521/16/63] at ata2-master UDMA33 >How-To-Repeat: Boot FreeBSD 5.4-RELEASE-p11 on a similarly equipped motherboard. >Fix: These patches to files in /sys/dev/ata appear to fix the problem: % diff -bu ata-chipset.c.orig ata-chipset.c; diff -bu ata-pci.h.orig ata-pci.h --- ata-chipset.c.orig Tue Feb 14 18:39:36 2006 +++ ata-chipset.c Tue Feb 14 19:34:01 2006 @@ -1216,6 +1216,7 @@ {{ ATA_NFORCE1, 0, AMDNVIDIA, NVIDIA, ATA_UDMA5, "nVidia nForce" }, { ATA_NFORCE2, 0, AMDNVIDIA, NVIDIA, ATA_UDMA6, "nVidia nForce2" }, { ATA_NFORCE2_MCP, 0, AMDNVIDIA, NVIDIA, ATA_UDMA6, "nVidia nForce2 MCP" }, + { ATA_NFORCE2_MCP2S, 0, AMDNVIDIA, NVIDIA, ATA_SA150, "nVidia nForce2 MCP2S" }, { ATA_NFORCE3, 0, AMDNVIDIA, NVIDIA, ATA_UDMA6, "nVidia nForce3" }, { ATA_NFORCE3_PRO, 0, AMDNVIDIA, NVIDIA, ATA_UDMA6, "nVidia nForce3 Pro" }, { ATA_NFORCE3_MCP, 0, AMDNVIDIA, NVIDIA, ATA_UDMA6, "nVidia nForce3 MCP" }, @@ -1244,7 +1245,12 @@ /* disable prefetch, postwrite */ pci_write_config(dev, 0x51, pci_read_config(dev, 0x51, 1) & 0x0f, 1); + if (ctlr->chip->max_dma < ATA_SA150) { ctlr->setmode = ata_via_family_setmode; + } + else { + ctlr->setmode = ata_sata_setmode; + } return 0; } --- ata-pci.h.orig Tue Feb 14 18:39:43 2006 +++ ata-pci.h Tue Feb 14 18:51:31 2006 @@ -142,6 +142,7 @@ #define ATA_NFORCE1 0x01bc10de #define ATA_NFORCE2 0x006510de #define ATA_NFORCE2_MCP 0x008510de +#define ATA_NFORCE2_MCP2S 0x008e10de #define ATA_NFORCE3 0x00d510de #define ATA_NFORCE3_PRO 0x00e510de #define ATA_NFORCE3_PRO_S1 0x00e310de Post-boot dmesg info: % dmesg | grep ata atapci0: port 0xf000-0xf00f,0x376,0x170-0x177,0x3f6,0x1f0-0x1f7 at device 9.0 on pci0 ata0: channel #0 on atapci0 ata1: channel #1 on atapci0 atapci1: port 0xbc00-0xbc0f,0xb70-0xb73,0x970-0x977,0xbf0-0xbf3,0x9f0-0x9f7 irq 22 at device 11.0 on pci0 ata2: channel #0 on atapci1 ata3: channel #1 on atapci1 ad0: 57241MB [116301/16/63] at ata0-master UDMA100 acd0: CDROM at ata1-master PIO4 ad4: 238475MB [484521/16/63] at ata2-master SATA150 >Release-Note: >Audit-Trail: >Unformatted: