Subject: kern/34885: piixide.c 1.29 doesn't work
To: None <kern-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: None <yamt@mwd.biglobe.ne.jp>
List: netbsd-bugs
Date: 10/23/2006 12:30:00
>Number:         34885
>Category:       kern
>Synopsis:       piixide.c 1.29 doesn't work
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Oct 23 12:30:00 +0000 2006
>Originator:     YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
>Release:        NetBSD 4.99.3
>Organization:
	
>Environment:
	
	
System: NetBSD siro.lan 4.99.3 NetBSD 4.99.3 (build.siro2) #24: Mon Oct 23 20:04:36 JST 2006 takashi@kaeru:/home/takashi/work/kernel/build.siro2 i386
Architecture: i386
Machine: i386
>Description:

	my piixide1 stopped working after the following change:

> revision 1.29
> date: 2006/09/03 18:30:35;  author: xtraeme;  state: Exp;  lines: +119 -3
> branches:  1.29.4;
> * Add support for ICH8 and ICH8M SATA/RAID controllers.
> * If the controller is in AHCI, ask for SATA IDE mode of operation.
> 
> jsg@openbsd says:
> 
> "X60/T60 Thinkpads are shipped in AHCI configuration by default,
>  this makes them work without changing a BIOS option."
> 
> Tested by eye of the beholder. From OpenBSD.
> 
> Ok'ed tls.

	the following is a diff of dmesg:
	
@@ -283,12 +297,11 @@ atabus1 at piixide0 channel 1
 piixide1 at pci0 dev 31 function 2
 piixide1: Intel 82801EB Serial ATA Controller (rev. 0x02)
 piixide1: bus-master DMA support present
-piixide1: primary channel configured to compatibility mode
-piixide1: primary channel interrupting at ioapic0 pin 14 (irq 14)
-atabus2 at piixide1 channel 0
-piixide1: secondary channel configured to compatibility mode
-piixide1: secondary channel interrupting at ioapic0 pin 15 (irq 15)
-atabus3 at piixide1 channel 1
+piixide1: primary channel configured to native-PCI mode
+piixide1: using ioapic0 pin 18 (irq 0) for native-PCI interrupt
+piixide1: couldn't map primary channel cmd regs
+piixide1: secondary channel configured to native-PCI mode
+piixide1: couldn't map secondary channel cmd regs
 Intel 82801EB/ER SMBus Controller (SMBus serial bus, revision 0x02) at pci0 dev 31 function 3 not configured
 auich0 at pci0 dev 31 function 5: i82801EB (ICH5) AC-97 Audio
 auich0: interrupting at ioapic0 pin 17 (irq 11)
@@ -321,12 +334,6 @@ uhidev0 at uhub3 port 2 configuration 1 
 uhidev0: Logitech USB-PS/2 Trackball, rev 1.00/2.10, addr 3, iclass 3/1
 ums0 at uhidev0: 2 buttons
 wsmouse0 at ums0 mux 0
-wd0 at atabus2 drive 0: <HDS722516VLSA80>
-wd0: drive supports 16-sector PIO transfers, LBA48 addressing
-wd0: 153 GB, 319120 cyl, 16 head, 63 sec, 512 bytes/sect x 321672960 sectors
-wd0: 32-bit data port
-wd0: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 5 (Ultra/100)
-wd0(piixide1:0:0): using PIO mode 4, Ultra-DMA mode 5 (Ultra/100) (using DMA)
 boot device: sd0
 root on sd0a dumps on sd0b
 root file system type: ffs

	the following is an output of "pcictl /dev/pci0 dump -d 31 -f2".
	(taken with a kernel with piixide.c rev.1.29 reverted.)
	
PCI configuration registers:
  Common header:
    0x00: 0x24d18086 0x02a00005 0x01018a02 0x00000000

    Vendor Name: Intel (0x8086)
    Device Name: 82801EB Serial ATA Controller (0x24d1)
    Command register: 0x0005
      I/O space accesses: on
      Memory space accesses: off
      Bus mastering: on
      Special cycles: off
      MWI transactions: off
      Palette snooping: off
      Parity error checking: off
      Address/data stepping: off
      System error (SERR): off
      Fast back-to-back transactions: off
    Status register: 0x02a0
      Capability List support: off
      66 MHz capable: on
      User Definable Features (UDF) support: off
      Fast back-to-back capable: on
      Data parity error detected: off
      DEVSEL timing: medium (0x1)
      Slave signaled Target Abort: off
      Master received Target Abort: off
      Master received Master Abort: off
      Asserted System Error (SERR): off
      Parity error detected: off
    Class Name: mass storage (0x01)
    Subclass Name: IDE (0x01)
    Interface: 0x8a
    Revision ID: 0x02
    BIST: 0x00
    Header Type: 0x00 (0x00)
    Latency Timer: 0x00
    Cache Line Size: 0x00

  Type 0 ("normal" device) header:
    0x10: 0x00000001 0x00000001 0x00000001 0x00000001
    0x20: 0x0000fc01 0x00000000 0x00000000 0x72801462
    0x30: 0x00000000 0x00000000 0x00000000 0x00000100

    Base address register at 0x10
      type: i/o
      base: 0x00000000, not sized
    Base address register at 0x14
      type: i/o
      base: 0x00000000, not sized
    Base address register at 0x18
      type: i/o
      base: 0x00000000, not sized
    Base address register at 0x1c
      type: i/o
      base: 0x00000000, not sized
    Base address register at 0x20
      type: i/o
      base: 0x0000fc00, not sized
    Base address register at 0x24
      not implemented(?)
    Cardbus CIS Pointer: 0x00000000
    Subsystem vendor ID: 0x1462
    Subsystem ID: 0x7280
    Expansion ROM Base Address: 0x00000000
    Reserved @ 0x34: 0x00000000
    Reserved @ 0x38: 0x00000000
    Maximum Latency: 0x00
    Minimum Grant: 0x00
    Interrupt pin: 0x01 (pin A)
    Interrupt line: 0x00

  Device-dependent header:
    0x40: 0x8000a307 0x00000000 0x00010001 0x00000000
    0x50: 0x00000000 0x001010f0 0x00000000 0x00000000
    0x60: 0x00000000 0x00000000 0x00000000 0x00000000
    0x70: 0x00020001 0x00000000 0x00000000 0x00000000
    0x80: 0x00007005 0x00000000 0x00000000 0x00000000
    0x90: 0x00130000 0x00000020 0x00000000 0x00000000
    0xa0: 0x00000040 0x00220043 0x00000000 0x00000000
    0xb0: 0x00000000 0x00000000 0x00000000 0x00000000
    0xc0: 0x00000000 0x00000000 0x00000000 0x00000000
    0xd0: 0x00000000 0x00000000 0x00000000 0x00000000
    0xe0: 0x00000000 0x00000000 0x00000000 0x00000000
    0xf0: 0x00000000 0x00000000 0x00040f66 0x00000000

>How-To-Repeat:
>Fix:

>Unformatted: