Bug 105795 - Kernel does not support DMA for nforce3 boards
Kernel does not support DMA for nforce3 boards
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: kernel (Show other bugs)
3.0
x86_64 Linux
medium Severity medium
: ---
: ---
Assigned To: Jim Paradis
Brian Brock
http://www.ussg.iu.edu/hypermail/linu...
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2003-09-27 13:01 EDT by Seth Chandler
Modified: 2013-08-05 21:03 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-10-05 19:54:24 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Seth Chandler 2003-09-27 13:01:57 EDT
Description of problem:
the enterprise kernel for AS 2.9.5 doesn't support DMA for nforce3 motherboards,
making the ide run slow as christmas :-)

I tried to patch this into the redhat stock kernel, and all hunks succeeded, the
last one (in pci_ids.h) with a small offset.  

I could not however compile the stock kernel with it (the bzImage made fine, but
make modules died a horrible death, even after removing the config options that
were killing it, more would just pop up)

I'm sure you guys will have a whole slew of new patches to add, but this one is
almost required for reasonable AMD64 support.

NOTE: to make this work in 2.4.23-pre5 i had to disable apic (i.e. noapic)

Version-Release number of selected component (if applicable):
kernel-2.4.21-1.1931.2.393.ent

How reproducible:
Always

Steps to Reproduce:
You get the point from above :-)

Additional info:
the patch is located in the URL field for bugzilla
Comment 1 Seth Chandler 2003-09-27 15:26:17 EDT
i just want to point out that this is also true for the newest kernel available
on up2date
Comment 2 Seth Chandler 2003-10-02 15:04:51 EDT
NEW KERNEL
--------------------
root@everest:~$ uname -a
Linux everest.sethbc.org 2.4.21-3.ELcustom #2 Sat Sep 27 22:53:29 EDT 2003
x86_64 x86_64 x86_64 GNU/Linux root@everest:~$ hdparm -tT /dev/hda

/dev/hda:
 Timing buffer-cache reads:   3128 MB in  2.00 seconds = 1564.00 MB/sec
 Timing buffered disk reads:  178 MB in  3.01 seconds =  59.14 MB/sec
root@everest:~$


STOCK KERNEL
-----------------
root@everest:~$ uname -a
Linux everest.sethbc.org 2.4.21-3.EL #1 Fri Sep 19 14:03:18 EDT 2003 x86_64
x86_64 x86_64 GNU/Linux root@everest:~$ hdparm -tT /dev/hda

/dev/hda:
 Timing buffer-cache reads:   3184 MB in  2.00 seconds = 1592.00 MB/sec
 Timing buffered disk reads:   12 MB in  3.49 seconds =   3.44 MB/sec
root@everest:~$


I think the variation in the buffer-cache reads is standard (though that number
looks RIDICULOUSLY high in both cases).  The bueffered disk reads on the other
shows a HUGE improvement...


seth
Comment 3 Seth Chandler 2003-10-02 15:05:09 EDT
NEW KERNEL
--------------------
root@everest:~$ uname -a
Linux everest.sethbc.org 2.4.21-3.ELcustom #2 Sat Sep 27 22:53:29 EDT 2003
x86_64 x86_64 x86_64 GNU/Linux root@everest:~$ hdparm -tT /dev/hda

/dev/hda:
 Timing buffer-cache reads:   3128 MB in  2.00 seconds = 1564.00 MB/sec
 Timing buffered disk reads:  178 MB in  3.01 seconds =  59.14 MB/sec
root@everest:~$


STOCK KERNEL
-----------------
root@everest:~$ uname -a
Linux everest.sethbc.org 2.4.21-3.EL #1 Fri Sep 19 14:03:18 EDT 2003 x86_64
x86_64 x86_64 GNU/Linux root@everest:~$ hdparm -tT /dev/hda

/dev/hda:
 Timing buffer-cache reads:   3184 MB in  2.00 seconds = 1592.00 MB/sec
 Timing buffered disk reads:   12 MB in  3.49 seconds =   3.44 MB/sec
root@everest:~$


I think the variation in the buffer-cache reads is standard (though that number
looks RIDICULOUSLY high in both cases).  The bueffered disk reads on the other
shows a HUGE improvement...


seth
Comment 4 Seth Chandler 2003-10-02 15:07:00 EDT
gah sorry about that, i was reposting a comment lost in the bugzilla crash, and
appear to have assigned this to someone (and on top of that my comment went
through twice), stupid touchpad.  feel free to shuffle around as necessary....
Comment 5 Justin M. Forbes 2003-10-24 12:02:19 EDT
Bug not fixed in gold "2.4.21-4.EL"

Should be fixed with this patch :

diff -ru linux-2.4.21-4.EL/drivers/ide/pci/amd74xx.c
linux-2.4.21-4.EL-Fedora64/drivers/ide/pci/amd74xx.c
--- linux-2.4.21-4.EL/drivers/ide/pci/amd74xx.c 2003-10-24 10:28:41.000000000 -0500
+++ linux-2.4.21-4.EL-Fedora64/drivers/ide/pci/amd74xx.c        2003-10-24
10:51:43.000000000 -0500
@@ -40,6 +40,7 @@
 #define AMD_UDMA_33            0x01
 #define AMD_UDMA_66            0x02
 #define AMD_UDMA_100           0x03
+#define AMD_UDMA_133           0x04
 #define AMD_CHECK_SWDMA                0x08
 #define AMD_BAD_SWDMA          0x10
 #define AMD_BAD_FIFO           0x20
@@ -60,7 +61,13 @@
        { PCI_DEVICE_ID_AMD_OPUS_7441, 0x00, 0x40, AMD_UDMA_100 },             
        /* AMD-768 Opus */
        { PCI_DEVICE_ID_AMD_8111_IDE,  0x00, 0x40, AMD_UDMA_100 },             
        /* AMD-8111 */
         { PCI_DEVICE_ID_NVIDIA_NFORCE_IDE, 0x00, 0x50, AMD_UDMA_100 },        
         /* nVidia nForce */
-        { PCI_DEVICE_ID_NVIDIA_NFORCE2_IDE, 0x00, 0x50, AMD_UDMA_100 },       
          /* nVidia nForce */
+        { PCI_DEVICE_ID_NVIDIA_NFORCE2_IDE, 0x00, 0x50, AMD_UDMA_133 },       
         /* nVidia nForce2 */
+        { PCI_DEVICE_ID_NVIDIA_NFORCE2S_IDE, 0x00, 0x50, AMD_UDMA_133 },      
         /* nVidia nForce2s */
+        { PCI_DEVICE_ID_NVIDIA_NFORCE2S_SATA, 0x00, 0x50, AMD_UDMA_133 },     
         /* nVidia nForce2s SATA */
+        { PCI_DEVICE_ID_NVIDIA_NFORCE3_IDE, 0x00, 0x50, AMD_UDMA_133 },       
         /* NVIDIA nForce3 */
+        { PCI_DEVICE_ID_NVIDIA_NFORCE3S_IDE, 0x00, 0x50, AMD_UDMA_133 },      
         /* NVIDIA nForce3s */
+        { PCI_DEVICE_ID_NVIDIA_NFORCE3S_SATA, 0x00, 0x50, AMD_UDMA_133 },     
         /* NVIDIA nForce3s SATA */
+        { PCI_DEVICE_ID_NVIDIA_NFORCE3S_SATA2, 0x00, 0x50, AMD_UDMA_133 },    
         /* NVIDIA nForce3s SATA2 */

        { 0 }
 };
@@ -70,9 +77,9 @@
 static unsigned int amd_80w;
 static unsigned int amd_clock;

-static unsigned char amd_cyc2udma[] = { 6, 6, 5, 4, 0, 1, 1, 2, 2, 3, 3 };
-static unsigned char amd_udma2cyc[] = { 4, 6, 8, 10, 3, 2, 1, 1 };
-static char *amd_dma[] = { "MWDMA16", "UDMA33", "UDMA66", "UDMA100" };
+static unsigned char amd_cyc2udma[] = { 6, 6, 5, 4, 0, 1, 1, 2, 2, 3, 3, 7 };
+static unsigned char amd_udma2cyc[] = { 4, 6, 8, 10, 3, 2, 1, 0 };
+static char *amd_dma[] = { "MWDMA16", "UDMA33", "UDMA66", "UDMA100", "UDMA133" };

 /*
  * AMD /proc entry.
@@ -154,6 +161,11 @@
                        cycle[i] = 666666 / amd_clock;
                        continue;
                }
+               if (den[i] && uen[i] && udma[i] == 0) {
+                       speed[i] = amd_clock * 4;
+                       cycle[i] = 500000 / amd_clock;
+                       continue;
+               }

                speed[i] = 4 * amd_clock / ((den[i] && uen[i]) ? udma[i] :
(active[i] + recover[i]) * 2);
                cycle[i] = 1000000 * ((den[i] && uen[i]) ? udma[i] : (active[i]
+ recover[i]) * 2) / amd_clock / 2;
@@ -200,6 +212,7 @@
                case AMD_UDMA_33:  t = timing->udma ? (0xc0 | (FIT(timing->udma,
2, 5) - 2)) : 0x03; break;
                case AMD_UDMA_66:  t = timing->udma ? (0xc0 |
amd_cyc2udma[FIT(timing->udma, 2, 10)]) : 0x03; break;
                case AMD_UDMA_100: t = timing->udma ? (0xc0 |
amd_cyc2udma[FIT(timing->udma, 1, 10)]) : 0x03; break;
+               case AMD_UDMA_133: t = timing->udma ? (0xc0 |
amd_cyc2udma[FIT(timing->udma, 1, 11)]) : 0x03; break;
                default: return;
        }

@@ -233,7 +246,12 @@
                ide_timing_merge(&p, &t, &t, IDE_TIMING_8BIT);
        }

+       /*
+        * AMD / nForce UDMA timing register should really be programmed
+        * based on UDMA mode not UDMA cycle time...
+        */
        if (speed == XFER_UDMA_5 && amd_clock <= 33333) t.udma = 1;
+       if (speed == XFER_UDMA_6 && amd_clock <= 33333) t.udma = 11;

        amd_set_speed(HWIF(drive)->pci_dev, drive->dn, &t);

@@ -276,7 +294,8 @@
                XFER_PIO | XFER_EPIO | XFER_MWDMA | XFER_UDMA |
                ((amd_config->flags & AMD_BAD_SWDMA) ? 0 : XFER_SWDMA) |
                (w80 && (amd_config->flags & AMD_UDMA) >= AMD_UDMA_66 ?
XFER_UDMA_66 : 0) |
-               (w80 && (amd_config->flags & AMD_UDMA) >= AMD_UDMA_100 ?
XFER_UDMA_100 : 0));
+               (w80 && (amd_config->flags & AMD_UDMA) >= AMD_UDMA_100 ?
XFER_UDMA_100 : 0) |
+               (w80 && (amd_config->flags & AMD_UDMA) >= AMD_UDMA_133 ?
XFER_UDMA_133 : 0));

        amd_set_drive(drive, speed);

@@ -312,6 +331,7 @@

        switch (amd_config->flags & AMD_UDMA) {

+               case AMD_UDMA_133:
                case AMD_UDMA_100:
                        pci_read_config_byte(dev, AMD_CABLE_DETECT, &t);
                        pci_read_config_dword(dev, AMD_UDMA_TIMING, &u);
@@ -454,6 +474,12 @@
        { PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_8111_IDE,        PCI_ANY_ID,
PCI_ANY_ID, 0, 0, 4},
        { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_IDE, PCI_ANY_ID,
PCI_ANY_ID, 0, 0, 5},
        { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE2_IDE, PCI_ANY_ID,
PCI_ANY_ID, 0, 0, 6},
+       { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE2S_IDE, PCI_ANY_ID,
PCI_ANY_ID, 0, 0, 7},
+       { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE2S_SATA, PCI_ANY_ID,
PCI_ANY_ID, 0, 0, 8},
+       { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE3_IDE, PCI_ANY_ID,
PCI_ANY_ID, 0, 0, 9},
+       { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE3S_IDE, PCI_ANY_ID,
PCI_ANY_ID, 0, 0, 10},
+       { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE3S_SATA, PCI_ANY_ID,
PCI_ANY_ID, 0, 0, 11},
+       { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE3S_SATA2, PCI_ANY_ID,
PCI_ANY_ID, 0, 0, 12},
        { 0, },
 };

diff -ru linux-2.4.21-4.EL/drivers/ide/pci/amd74xx.h
linux-2.4.21-4.EL-Fedora64/drivers/ide/pci/amd74xx.h
--- linux-2.4.21-4.EL/drivers/ide/pci/amd74xx.h 2003-10-24 10:28:41.000000000 -0500
+++ linux-2.4.21-4.EL-Fedora64/drivers/ide/pci/amd74xx.h        2003-10-24
10:51:33.000000000 -0500
@@ -124,6 +124,90 @@
                .bootable       = ON_BOARD,
                .extra          = 0,
        },
+       {       /* 7 */
+               .vendor         = PCI_VENDOR_ID_NVIDIA,
+               .device         = PCI_DEVICE_ID_NVIDIA_NFORCE2S_IDE,
+               .name           = "NFORCE2",
+               .init_chipset   = init_chipset_amd74xx,
+               .init_iops      = NULL,
+               .init_hwif      = init_hwif_amd74xx,
+               .init_dma       = init_dma_amd74xx,
+               .channels       = 2,
+               .autodma        = AUTODMA,
+               .enablebits     = {{0x50,0x02,0x02}, {0x50,0x01,0x01}},
+               .bootable       = ON_BOARD,
+               .extra          = 0,
+       },
+       {       /* 8 */
+               .vendor         = PCI_VENDOR_ID_NVIDIA,
+               .device         = PCI_DEVICE_ID_NVIDIA_NFORCE2S_SATA,
+               .name           = "NFORCE2",
+               .init_chipset   = init_chipset_amd74xx,
+               .init_iops      = NULL,
+               .init_hwif      = init_hwif_amd74xx,
+               .init_dma       = init_dma_amd74xx,
+               .channels       = 2,
+               .autodma        = AUTODMA,
+               .enablebits     = {{0x50,0x02,0x02}, {0x50,0x01,0x01}},
+               .bootable       = ON_BOARD,
+               .extra          = 0,
+       },
+       {       /* 9 */
+               .vendor         = PCI_VENDOR_ID_NVIDIA,
+               .device         = PCI_DEVICE_ID_NVIDIA_NFORCE3_IDE,
+               .name           = "NFORCE3",
+               .init_chipset   = init_chipset_amd74xx,
+               .init_iops      = NULL,
+               .init_hwif      = init_hwif_amd74xx,
+               .init_dma       = init_dma_amd74xx,
+               .channels       = 2,
+               .autodma        = AUTODMA,
+               .enablebits     = {{0x50,0x02,0x02}, {0x50,0x01,0x01}},
+               .bootable       = ON_BOARD,
+               .extra          = 0,
+       },
+       {       /* 10 */
+               .vendor         = PCI_VENDOR_ID_NVIDIA,
+               .device         = PCI_DEVICE_ID_NVIDIA_NFORCE3S_IDE,
+               .name           = "NFORCE3",
+               .init_chipset   = init_chipset_amd74xx,
+               .init_iops      = NULL,
+               .init_hwif      = init_hwif_amd74xx,
+               .init_dma       = init_dma_amd74xx,
+               .channels       = 2,
+               .autodma        = AUTODMA,
+               .enablebits     = {{0x50,0x02,0x02}, {0x50,0x01,0x01}},
+               .bootable       = ON_BOARD,
+               .extra          = 0,
+       },
+       {       /* 11 */
+               .vendor         = PCI_VENDOR_ID_NVIDIA,
+               .device         = PCI_DEVICE_ID_NVIDIA_NFORCE3S_SATA,
+               .name           = "NFORCE3",
+               .init_chipset   = init_chipset_amd74xx,
+               .init_iops      = NULL,
+               .init_hwif      = init_hwif_amd74xx,
+               .init_dma       = init_dma_amd74xx,
+               .channels       = 2,
+               .autodma        = AUTODMA,
+               .enablebits     = {{0x50,0x02,0x02}, {0x50,0x01,0x01}},
+               .bootable       = ON_BOARD,
+               .extra          = 0,
+       },
+       {       /* 12 */
+               .vendor         = PCI_VENDOR_ID_NVIDIA,
+               .device         = PCI_DEVICE_ID_NVIDIA_NFORCE3S_SATA2,
+               .name           = "NFORCE3",
+               .init_chipset   = init_chipset_amd74xx,
+               .init_iops      = NULL,
+               .init_hwif      = init_hwif_amd74xx,
+               .init_dma       = init_dma_amd74xx,
+               .channels       = 2,
+               .autodma        = AUTODMA,
+               .enablebits     = {{0x50,0x02,0x02}, {0x50,0x01,0x01}},
+               .bootable       = ON_BOARD,
+               .extra          = 0,
+       },
        {
                .vendor         = 0,
                .device         = 0,
diff -ru linux-2.4.21-4.EL/include/linux/pci_ids.h
linux-2.4.21-4.EL-Fedora64/include/linux/pci_ids.h
--- linux-2.4.21-4.EL/include/linux/pci_ids.h   2003-10-24 10:28:08.000000000 -0500
+++ linux-2.4.21-4.EL-Fedora64/include/linux/pci_ids.h  2003-10-24
10:51:33.000000000 -0500
@@ -914,7 +914,13 @@
 #define PCI_DEVICE_ID_NVIDIA_VTNT2             0x002C
 #define PCI_DEVICE_ID_NVIDIA_UVTNT2            0x002D
 #define PCI_DEVICE_ID_NVIDIA_NFORCE2_IDE       0x0065
+#define PCI_DEVICE_ID_NVIDIA_NFORCE2S_IDE      0x0085
+#define PCI_DEVICE_ID_NVIDIA_NFORCE2S_SATA     0x008e
 #define PCI_DEVICE_ID_NVIDIA_ITNT2             0x00A0
+#define PCI_DEVICE_ID_NVIDIA_NFORCE3_IDE       0x00d5
+#define PCI_DEVICE_ID_NVIDIA_NFORCE3S_SATA     0x00e3
+#define PCI_DEVICE_ID_NVIDIA_NFORCE3S_IDE      0x00e5
+#define PCI_DEVICE_ID_NVIDIA_NFORCE3S_SATA2    0x00ee
 #define PCI_DEVICE_ID_NVIDIA_GEFORCE_SDR       0x0100
 #define PCI_DEVICE_ID_NVIDIA_GEFORCE_DDR       0x0101
 #define PCI_DEVICE_ID_NVIDIA_QUADRO            0x0103
Only in linux-2.4.21-4.EL-Fedora64/include/linux: pci_ids.h.orig
Comment 6 Jim Paradis 2003-11-07 16:48:39 EST
An equivalent patch (taken from upstream sources along with some other
bits) has been submitted for U1.  Our SK8N systems are *much* happier now.
Comment 7 Ernie Petrides 2005-10-05 19:54:24 EDT
Closing, since this was fixed in RHEL3 U1.

Note You need to log in before you can comment on or make changes to this bug.