Subject: nForce430 ATA133 is now DMA mode-2 by NetBSD ?
To: None <tech-kern@netbsd.org>
From: MASUDA Hideo <h-masuda@ootani.nagata.kobe.jp>
List: tech-kern
Date: 01/31/2006 11:19:12
Hi all,

 I got the M/B with nForce430 ATA133/SATAII chip.
 Under NetBSD/i386 3.0, HDD access is very poor performance.
According to dmesg, HDD is recognized as DMA mode-2 (DMA33).

viaide0 at pci0 dev 13 function 0
viaide0: NVIDIA nForce430 IDE Controller (rev. 0xa1)
viaide0: bus-master DMA support present
viaide0: primary channel configured to compatibility mode
viaide0: primary channel interrupting at ioapic0 pin 14 (irq 14)
atabus0 at viaide0 channel 0
viaide0: secondary channel configured to compatibility mode
viaide0: secondary channel interrupting at ioapic0 pin 15 (irq 15)
atabus1 at viaide0 channel 1
	(snip)
wd0 at atabus0 drive 0: <HDT722525DLAT80>
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(viaide0:0:0): using PIO mode 4, DMA mode 2 (using DMA)
wd1 at atabus1 drive 0: <ST3250823A>
wd1: drive supports 16-sector PIO transfers, LBA48 addressing
wd1: 232 GB, 484521 cyl, 16 head, 63 sec, 512 bytes/sect x 488397168 sectors
wd1: 32-bit data port
wd1: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 5 (Ultra/100)
wd1(viaide0:1:0): using PIO mode 4, DMA mode 2 (using DMA)

 I think that this causes the quirks (?) in dev/pci/viaide.c, and
apply the patch (this may be applied for current (rev. 1.27))
as following:

Index: viaide.c
===================================================================
RCS file: /cvs/cvsroot/src/sys/dev/pci/viaide.c,v
retrieving revision 1.24.2.1
diff -u -r1.24.2.1 viaide.c
--- viaide.c    5 Jan 2006 22:17:39 -0000       1.24.2.1
+++ viaide.c    31 Jan 2006 02:09:24 -0000
@@ -340,6 +340,9 @@
                case PCI_PRODUCT_NVIDIA_NFORCE3_ATA133:
                case PCI_PRODUCT_NVIDIA_NFORCE3_250_ATA133:
                case PCI_PRODUCT_NVIDIA_NFORCE4_ATA133:
+               case PCI_PRODUCT_NVIDIA_NFORCE430_ATA133:
+               case PCI_PRODUCT_NVIDIA_NFORCE430_SATA1:
+               case PCI_PRODUCT_NVIDIA_NFORCE430_SATA2:
                        sc->sc_wdcdev.sc_atac.atac_udma_cap = 6;
                        break;
                }

 Then, dmesg says as follows and seems to work fine.

wd0 at atabus0 drive 0: <HDT722525DLAT80>
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(viaide0:0:0): using PIO mode 4, Ultra-DMA mode 6 (Ultra/133) (using DMA)
wd1 at atabus1 drive 0: <ST3250823A>
wd1: drive supports 16-sector PIO transfers, LBA48 addressing
wd1: 232 GB, 484521 cyl, 16 head, 63 sec, 512 bytes/sect x 488397168 sectors
wd1: 32-bit data port
wd1: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 5 (Ultra/100)
wd1(viaide0:1:0): using PIO mode 4, Ultra-DMA mode 5 (Ultra/100) (using DMA)

 Any comments?

Cheers.
--
MASUDA Hideo