NetBSD Problem Report #38011

From martin@duskware.de  Tue Feb 12 11:50:14 2008
Return-Path: <martin@duskware.de>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by narn.NetBSD.org (Postfix) with ESMTP id 6D90D63BD1C
	for <gnats-bugs@gnats.netbsd.org>; Tue, 12 Feb 2008 11:50:14 +0000 (UTC)
Message-Id: <20080212114921.AA9E463BD1C@narn.NetBSD.org>
Date: Tue, 12 Feb 2008 11:49:21 +0000 (UTC)
From: ks@ub.uni-mainz.de
Reply-To: ks@ub.uni-mainz.de
To: netbsd-bugs-owner@NetBSD.org
Subject: sata disks not found on Nvidia MCP55/viaide3: couldn't map sata regs
X-Send-Pr-Version: www-1.0

>Number:         38011
>Category:       kern
>Synopsis:       sata disks not found on Nvidia MCP55/viaide3: couldn't map sata regs
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    mrg
>State:          closed
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Tue Feb 12 11:55:00 +0000 2008
>Closed-Date:    Sat Jan 23 00:48:25 +0000 2010
>Last-Modified:  Sat Jan 23 00:48:25 +0000 2010
>Originator:     Kurt Schreiner
>Release:        -current as of 2008-02-12
>Organization:
Uni Mainz
>Environment:
uname -a
NetBSD ibetty 4.99.54 NetBSD 4.99.54 (ULTRA40) #13: Tue Feb 12 10:42:07 MET 2008  ks@ibetty:/u/NetBSD/arch/amd64/obj/sys/arch/amd64/compile/ULTRA40 amd64

>Description:
>From dmesg:

viaide3 at pci8 dev 5 function 0
viaide3: NVIDIA MCP55 Serial ATA Controller (rev. 0xa3)
viaide3: couldn't map sata regs
viaide4 at pci8 dev 5 function 1
viaide4: NVIDIA MCP55 Serial ATA Controller (rev. 0xa3)
viaide4: couldn't map sata regs

and none of the 4 disks is found..,

after applying the patch below I get:

viaide3 at pci8 dev 5 function 0
viaide3: NVIDIA MCP55 Serial ATA Controller (rev. 0xa3)
viaide3: using ioapic1 pin 16 (irq 11) for native-PCI interrupt
atabus5 at viaide3 channel 0
atabus6 at viaide3 channel 1
viaide4 at pci8 dev 5 function 1
viaide4: NVIDIA MCP55 Serial ATA Controller (rev. 0xa3)
viaide4: using ioapic1 pin 17 (irq 10) for native-PCI interrupt
atabus7 at viaide4 channel 0
atabus8 at viaide4 channel 1
[...]viaide3 port 0: device present, speed: 3.0Gb/s
viaide4 port 0: device present, speed: 3.0Gb/s
viaide3 port 1: device present, speed: 3.0Gb/s
viaide4 port 1: device present, speed: 3.0Gb/s
wd0 at atabus5 drive 0: <SEAGATE ST32500NSSUN250G 0740B568NH>
wd0: 232 GB, 484514 cyl, 16 head, 63 sec, 512 bytes/sect x 488390625 sectors
wd1 at atabus6 drive 0: <SEAGATE ST32500NSSUN250G 0741B58XWL>
wd1: 232 GB, 484514 cyl, 16 head, 63 sec, 512 bytes/sect x 488390625 sectors
wd2 at atabus7 drive 0: <SEAGATE ST32500NSSUN250G 0741B58YZ6>
wd2: 232 GB, 484514 cyl, 16 head, 63 sec, 512 bytes/sect x 488390625 sectors
wd3 at atabus8 drive 0: <SEAGATE ST32500NSSUN250G 0740B568QJ>
wd3: 232 GB, 484514 cyl, 16 head, 63 sec, 512 bytes/sect x 488390625 sectors




after applying the patch below I get:

>How-To-Repeat:
Take a Sun Ultra40 M2 and try to use SATA-disks in the upper 4-disk bay.
>Fix:
cvs diff -u sys/dev/pci/viaide.c 
Index: sys/dev/pci/viaide.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/viaide.c,v
retrieving revision 1.51
diff -u -r1.51 viaide.c
--- sys/dev/pci/viaide.c        18 Jan 2008 01:33:40 -0000      1.51
+++ sys/dev/pci/viaide.c        12 Feb 2008 11:41:22 -0000
@@ -837,6 +837,21 @@
        pciide_mapreg_dma(sc, pa);
        aprint_verbose("\n");

+       /*
+        * enable memory-space access. sometimes memory space is
+        * _not_ enabled so "just do it" to get things going!
+        */
+       {
+       pcireg_t csr;
+       if (pa->pa_memt) {
+           pa->pa_flags |= PCI_FLAGS_MEM_ENABLED;
+           sc->sc_ba5_st = pa->pa_memt;
+       }
+       csr = pci_conf_read(pa->pa_pc, pa->pa_tag, PCI_COMMAND_STATUS_REG);
+       pci_conf_write(pa->pa_pc, pa->pa_tag, PCI_COMMAND_STATUS_REG,
+           csr | PCI_COMMAND_MEM_ENABLE);
+       }
+
        if (sc->sc_dma_ok) {
                sc->sc_wdcdev.sc_atac.atac_cap |= ATAC_CAP_UDMA | ATAC_CAP_DMA;
                sc->sc_wdcdev.irqack = pciide_irqack;

>Release-Note:

>Audit-Trail:
From: Jeff <ijk-lists@speakeasy.net>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: kern/38011
Date: Sat, 12 Apr 2008 20:45:04 -0400

 I experienced the same problem with a Dell PowerEdge T105, it also uses an
 Nvіdia chipset.  With this patch all of my drives are detected.

Responsible-Changed-From-To: kern-bug-people->mrg
Responsible-Changed-By: mrg@NetBSD.org
Responsible-Changed-When: Wed, 23 Dec 2009 00:14:36 +0000
Responsible-Changed-Why:
i've taken care of this...


State-Changed-From-To: open->pending-pullups
State-Changed-By: mrg@NetBSD.org
State-Changed-When: Wed, 23 Dec 2009 00:14:36 +0000
State-Changed-Why:
in -current, probably should be in -5 and maybe -4


From: matthew green <mrg@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/38011 CVS commit: src/sys/dev/pci
Date: Wed, 23 Dec 2009 00:11:36 +0000

 Module Name:	src
 Committed By:	mrg
 Date:		Wed Dec 23 00:11:36 UTC 2009

 Modified Files:
 	src/sys/dev/pci: viaide.c

 Log Message:
 enable mem space if it isn't already enabled.  several bioses leave
 this not enabled, and viaide kind of depends upon it.

 fixes viaide(4) on several machines.

 idea from PR 38011, but reworked a little.


 To generate a diff of this commit:
 cvs rdiff -u -r1.65 -r1.66 src/sys/dev/pci/viaide.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: Kurt Schreiner <ks@ub.uni-mainz.de>
To: gnats-bugs@NetBSD.org
Cc: mrg@NetBSD.org, gnats-admin@NetBSD.org, netbsd-bugs@NetBSD.org
Subject: Re: PR/38011 CVS commit: src/sys/dev/pci
Date: Wed, 23 Dec 2009 21:36:30 +0100

 On Wed, Dec 23, 2009 at 12:15:06AM +0000, matthew green wrote:
 > The following reply was made to PR kern/38011; it has been noted by GNATS.
 > 
 > From: matthew green <mrg@netbsd.org>
 > To: gnats-bugs@gnats.NetBSD.org
 > Cc: 
 > Subject: PR/38011 CVS commit: src/sys/dev/pci
 > Date: Wed, 23 Dec 2009 00:11:36 +0000
 > 
 >  Module Name:	src
 >  Committed By:	mrg
 >  Date:		Wed Dec 23 00:11:36 UTC 2009
 >  
 >  Modified Files:
 >  	src/sys/dev/pci: viaide.c
 >  
 >  Log Message:
 >  enable mem space if it isn't already enabled.  several bioses leave
 >  this not enabled, and viaide kind of depends upon it.
 >  
 >  fixes viaide(4) on several machines.
 >  
 >  idea from PR 38011, but reworked a little.
 Confirmed to work on the system (Sun Ultra40) I did the "hack" for (see
 excerpts from dmesg below). From my POV the PR can be closed.

 viaide0 at pci0 dev 6 function 0: NVIDIA nForce4 IDE Controller (rev. 0xf2)
 viaide0: bus-master DMA support present
 viaide0: primary channel configured to compatibility mode
 viaide0: primary channel interrupting at ioapic0 pin 14
 atabus0 at viaide0 channel 0
 viaide0: secondary channel configured to compatibility mode
 viaide0: secondary channel interrupting at ioapic0 pin 15
 atabus1 at viaide0 channel 1
 viaide1 at pci0 dev 7 function 0: NVIDIA nForce4 Serial ATA Controller (rev. 0xf3)
 viaide1: bus-master DMA support present
 viaide1: primary channel wired to native-PCI mode
 LSI1: Picked IRQ 23 with weight 0
 viaide1: using ioapic0 pin 23 for native-PCI interrupt
 atabus2 at viaide1 channel 0
 viaide1: secondary channel wired to native-PCI mode
 atabus3 at viaide1 channel 1
 viaide2 at pci0 dev 8 function 0: NVIDIA nForce4 Serial ATA Controller (rev. 0xf3)
 viaide2: bus-master DMA support present
 viaide2: primary channel wired to native-PCI mode
 LTID: Picked IRQ 20 with weight 1
 viaide2: using ioapic0 pin 20 for native-PCI interrupt
 atabus4 at viaide2 channel 0
 viaide2: secondary channel wired to native-PCI mode
 atabus5 at viaide2 channel 1
 ppb0 at pci0 dev 9 function 0: NVIDIA nForce4 PCI Host Bridge (rev. 0xf2)
 pci1 at ppb0 bus 1
 pci1: i/o space, memory space enabled
 [...]
 pci4 at mainbus0 bus 128
 pci4: i/o space, memory space enabled, rd/line, rd/mult, wr/inv ok
 NVIDIA nForce4 Memory Controller (miscellaneous memory, revision 0xa3) at pci4 dev 0 function 0 not conf
 igured
 NVIDIA product 0x00d3 (miscellaneous memory, revision 0xf3) at pci4 dev 1 function 0 not configured
 viaide3 at pci4 dev 7 function 0: NVIDIA nForce4 Serial ATA Controller (rev. 0xf3)
 viaide3: bus-master DMA support present
 viaide3: primary channel wired to native-PCI mode
 LTID: Picked IRQ 44 with weight 0
 viaide3: using ioapic1 pin 20 for native-PCI interrupt
 atabus6 at viaide3 channel 0
 viaide3: secondary channel wired to native-PCI mode
 atabus7 at viaide3 channel 1
 viaide4 at pci4 dev 8 function 0: NVIDIA nForce4 Serial ATA Controller (rev. 0xf3)
 viaide4: bus-master DMA support present
 viaide4: primary channel wired to native-PCI mode
 LSI1: Picked IRQ 45 with weight 0
 viaide4: using ioapic1 pin 21 for native-PCI interrupt
 atabus8 at viaide4 channel 0
 viaide4: secondary channel wired to native-PCI mode
 atabus9 at viaide4 channel 1
 [...]
 atapibus0 at atabus0: 2 targets
 cd0 at atapibus0 drive 0: <MATSHITADVD-RAM UJ-845S, , D100> cdrom removable
 viaide1 port 1: device present, speed: 3.0Gb/s
 viaide2 port 0: device present, speed: 3.0Gb/s
 viaide2 port 1: device present, speed: 3.0Gb/s
 viaide1 port 0: device present, speed: 1.5Gb/s
 cd0: 32-bit data port
 cd0: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 2 (Ultra/33)
 cd0(viaide0:0:0): using PIO mode 4, Ultra-DMA mode 2 (Ultra/33) (using DMA)
 wd0 at atabus2 drive 0: <ST3250823AS>
 wd0: drive supports 16-sector PIO transfers, LBA48 addressing
 wd0: 232 GB, 484521 cyl, 16 head, 63 sec, 512 bytes/sect x 488397168 sectors
 wd0: 32-bit data port
 wd0: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 6 (Ultra/133)
 wd0(viaide1:0:0): using PIO mode 4, Ultra-DMA mode 6 (Ultra/133) (using DMA)
 wd1 at atabus3 drive 0: <HITACHI HDS7225SBSUN250G 0548N68BPE>
 wd1: drive supports 16-sector PIO transfers, LBA48 addressing
 wd1: 232 GB, 484514 cyl, 16 head, 63 sec, 512 bytes/sect x 488390625 sectors
 wd1: 32-bit data port
 wd1: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 6 (Ultra/133)
 wd1(viaide1:1:0): using PIO mode 4, Ultra-DMA mode 6 (Ultra/133) (using DMA)
 wd2 at atabus4 drive 0: <SEAGATE ST32500NSSUN250G 0740B56A8Y>
 wd2: drive supports 16-sector PIO transfers, LBA48 addressing
 wd2: 232 GB, 484514 cyl, 16 head, 63 sec, 512 bytes/sect x 488390625 sectors
 wd2: 32-bit data port
 wd2: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 6 (Ultra/133)
 wd2(viaide2:0:0): using PIO mode 4, Ultra-DMA mode 6 (Ultra/133) (using DMA)
 wd3 at atabus5 drive 0: <SEAGATE ST32500NSSUN250G 0740B56AAZ>
 wd3: drive supports 16-sector PIO transfers, LBA48 addressing
 wd3: 232 GB, 484514 cyl, 16 head, 63 sec, 512 bytes/sect x 488390625 sectors
 wd3: 32-bit data port
 wd3: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 6 (Ultra/133)
 wd3(viaide2:1:0): using PIO mode 4, Ultra-DMA mode 6 (Ultra/133) (using DMA)

 Kurt

From: matthew green <mrg@eterna.com.au>
To: ks@ub.uni-mainz.de
Cc: gnats-admin@NetBSD.org, netbsd-bugs@NetBSD.org,
    gnats-bugs@NetBSD.org
Subject: re: PR/38011 CVS commit: src/sys/dev/pci
Date: Thu, 24 Dec 2009 10:42:52 +1100

    Confirmed to work on the system (Sun Ultra40) I did the "hack" for (see
    excerpts from dmesg below). From my POV the PR can be closed.


 thanks for the confirmation!

From: Soren Jacobsen <snj@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/38011 CVS commit: [netbsd-5] src/sys/dev/pci
Date: Sat, 9 Jan 2010 01:56:51 +0000

 Module Name:	src
 Committed By:	snj
 Date:		Sat Jan  9 01:56:51 UTC 2010

 Modified Files:
 	src/sys/dev/pci [netbsd-5]: viaide.c

 Log Message:
 Pull up following revision(s) (requested by mrg in ticket #1227):
 	sys/dev/pci/viaide.c: revision 1.66
 enable mem space if it isn't already enabled.  several bioses leave
 this not enabled, and viaide kind of depends upon it.
 fixes viaide(4) on several machines.
 idea from PR 38011, but reworked a little.


 To generate a diff of this commit:
 cvs rdiff -u -r1.57.4.2 -r1.57.4.3 src/sys/dev/pci/viaide.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: pending-pullups->closed
State-Changed-By: mrg@NetBSD.org
State-Changed-When: Sat, 23 Jan 2010 00:48:25 +0000
State-Changed-Why:
all done.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.