Subject: kern/30803: piixide driver does not recognize brand new Intel SATA/IDE controller (includes patch)
To: None <kern-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: Bert Kiers <kiersb@pitamac.xs4all.nl>
List: netbsd-bugs
Date: 07/21/2005 13:35:00
>Number:         30803
>Category:       kern
>Synopsis:       piixide driver does not recognize brand new Intel SATA/IDE controller
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Thu Jul 21 13:35:00 +0000 2005
>Originator:     Bert Kiers
>Release:        NetBSD 3.99.7
>Organization:
XS4All Internet BV
>Environment:
Dell Precision 380
System: NetBSD pitamac 3.99.7 NetBSD 3.99.7 (PITAMAC) #2: Wed Jul 20 17:15:13 CEST 2005 kiersb@pitamac:/sys/arch/amd64/compile/PITAMAC amd64
Architecture: x86_64
Machine: amd64
>Description:
	The Intel 82801GB/GR SATA/IDE is not recognized by the piixide driver, so no DMA, so
	one cpu spends 20% handling up to 300000 interrupts/s. Simply teaching the piixide
	driver about that controller fixes that.
	
>How-To-Repeat:
	n.a.
>Fix:

I am not sure about the IDE part; I just copied it from the 82801EB_IDE.


kiersb@pitamac:/usr/src/sys/dev/pci$ diff -c piixide.c.bak piixide.c
*** piixide.c.bak       Fri Jul 15 15:03:56 2005
--- piixide.c   Wed Jul 20 17:13:56 2005
***************
*** 129,134 ****
--- 129,144 ----
          "Intel 82801EB Serial ATA Controller",
          piixsata_chip_map,
        },
+       { PCI_PRODUCT_INTEL_82801G_SATA,
+         0,
+         "Intel 82801GB/GR SATA Controller",
+         piixsata_chip_map,
+       },
+       { PCI_PRODUCT_INTEL_82801G_IDE,
+         0,
+         "Intel 82801GB/GR IDE Controller",
+         piix_chip_map,
+       },
        { PCI_PRODUCT_INTEL_82801ER_SATA,
          0,
          "Intel 82801ER Serial ATA/Raid Controller",
***************
*** 260,265 ****
--- 270,276 ----
                case PCI_PRODUCT_INTEL_82801DB_IDE:
                case PCI_PRODUCT_INTEL_82801DBM_IDE:
                case PCI_PRODUCT_INTEL_82801EB_IDE:
+               case PCI_PRODUCT_INTEL_82801G_IDE:
                case PCI_PRODUCT_INTEL_6300ESB_IDE:
                case PCI_PRODUCT_INTEL_82801FB_IDE:
                        sc->sc_wdcdev.sc_atac.atac_cap |= ATAC_CAP_UDMA;
***************
*** 278,283 ****
--- 289,295 ----
        case PCI_PRODUCT_INTEL_82801DB_IDE:
        case PCI_PRODUCT_INTEL_82801DBM_IDE:
        case PCI_PRODUCT_INTEL_82801EB_IDE:
+       case PCI_PRODUCT_INTEL_82801G_IDE:
        case PCI_PRODUCT_INTEL_6300ESB_IDE:
        case PCI_PRODUCT_INTEL_82801FB_IDE:
                sc->sc_wdcdev.sc_atac.atac_udma_cap = 5;
***************
*** 313,318 ****
--- 325,331 ----
                    sc->sc_pp->ide_product == PCI_PRODUCT_INTEL_82801DB_IDE ||
                    sc->sc_pp->ide_product == PCI_PRODUCT_INTEL_82801DBM_IDE ||
                    sc->sc_pp->ide_product == PCI_PRODUCT_INTEL_82801EB_IDE ||
+                   sc->sc_pp->ide_product == PCI_PRODUCT_INTEL_82801G_IDE ||
                    sc->sc_pp->ide_product == PCI_PRODUCT_INTEL_82801FB_IDE ||
                    sc->sc_pp->ide_product == PCI_PRODUCT_INTEL_6300ESB_IDE) {
                        ATADEBUG_PRINT((", IDE_CONTROL 0x%x",
***************
*** 377,382 ****
--- 390,396 ----
                    sc->sc_pp->ide_product == PCI_PRODUCT_INTEL_82801DB_IDE ||
                    sc->sc_pp->ide_product == PCI_PRODUCT_INTEL_82801DBM_IDE ||
                    sc->sc_pp->ide_product == PCI_PRODUCT_INTEL_82801EB_IDE ||
+                   sc->sc_pp->ide_product == PCI_PRODUCT_INTEL_82801G_IDE ||
                    sc->sc_pp->ide_product == PCI_PRODUCT_INTEL_82801FB_IDE ||
                    sc->sc_pp->ide_product == PCI_PRODUCT_INTEL_6300ESB_IDE) {
                        ATADEBUG_PRINT((", IDE_CONTROL 0x%x",
***************
*** 539,544 ****
--- 553,559 ----
                    sc->sc_pp->ide_product == PCI_PRODUCT_INTEL_82801DB_IDE ||
                    sc->sc_pp->ide_product == PCI_PRODUCT_INTEL_82801DBM_IDE ||
                    sc->sc_pp->ide_product == PCI_PRODUCT_INTEL_82801EB_IDE ||
+                   sc->sc_pp->ide_product == PCI_PRODUCT_INTEL_82801G_IDE ||
                    sc->sc_pp->ide_product == PCI_PRODUCT_INTEL_82801FB_IDE ||
                    sc->sc_pp->ide_product == PCI_PRODUCT_INTEL_6300ESB_IDE) {
                        ideconf |= PIIX_CONFIG_PINGPONG;
***************
*** 550,555 ****
--- 565,571 ----
                    sc->sc_pp->ide_product == PCI_PRODUCT_INTEL_82801DB_IDE ||
                    sc->sc_pp->ide_product == PCI_PRODUCT_INTEL_82801DBM_IDE ||
                    sc->sc_pp->ide_product == PCI_PRODUCT_INTEL_82801EB_IDE ||
+                   sc->sc_pp->ide_product == PCI_PRODUCT_INTEL_82801G_IDE ||
                    sc->sc_pp->ide_product == PCI_PRODUCT_INTEL_82801FB_IDE ||
                    sc->sc_pp->ide_product == PCI_PRODUCT_INTEL_6300ESB_IDE) {
                        /* setup Ultra/100 */


Now the kernel says:

piixide0 at pci0 dev 31 function 1
piixide0: Intel 82801GB/GR IDE Controller (rev. 0x01)
piixide0: bus-master DMA support present
piixide0: primary channel wired to compatibility mode
piixide0: primary channel interrupting at ioapic0 pin 14 (irq 14)
atabus0 at piixide0 channel 0
piixide0: secondary channel wired to compatibility mode
piixide0: secondary channel ignored (disabled)
piixide1 at pci0 dev 31 function 2
piixide1: Intel 82801GB/GR SATA Controller (rev. 0x01)
piixide1: bus-master DMA support present
piixide1: primary channel configured to native-PCI mode
piixide1: using ioapic0 pin 20 (irq 5) for native-PCI interrupt
atabus1 at piixide1 channel 0
piixide1: secondary channel configured to native-PCI mode
atabus2 at piixide1 channel 1
atapibus0 at atabus0: 2 targets
cd0(piixide0:0:0): using PIO mode 4, Ultra-DMA mode 2 (Ultra/33) (using DMA)
wd0 at atabus1 drive 0: <WDC WD1600JD-75HBC0>
wd0(piixide1:0:0): using PIO mode 4, Ultra-DMA mode 6 (Ultra/133) (using DMA)