# Problems with KT600 SATA

## DGolem

I have an Asus A7v600 with the latest bios and a Western Digital SATA drive. Here's my controller from lspci:

```
0000:00:0f.0 RAID bus controller: VIA Technologies, Inc. VIA VT6420 SATA RAID Controller (rev 80)
```

The problem I'm having is whenever I try to use hdparm I get this error:

```
HDIO_GET_MULTCOUNT failed: Inappropriate ioctl for device
```

If I try to get information about the drive using hdparm -i I get:

```
/dev/sda:

 HDIO_GET_IDENTITY failed: Inappropriate ioctl for device
```

If I try to turn dma on I get:

```
/dev/sda:

 setting using_dma to 1 (on)

 HDIO_SET_DMA failed: Inappropriate ioctl for device
```

Now I've been searching all over the forum for the answer to this and I have found other posts with the same problem. The solution has almost always been that the correct driver wasn't loaded and the controller wasn't being supported properly by the kernel. I'm on 2.6.10-ck2 sources and Here are the options I have under SCSI:

```
<*>   SCSI disk support 

<*>   SCSI generic support

[*] Serial ATA (SATA) support                                                                                                    

<*>   VIA SATA support
```

I've got the ATA drivers set not to control SATA so it can't be conflicting (I've even tried taking out ATA entirely). So If I've got the VIA driver loaded why is it acting like it can't recognize my controller? Even running hdparm off the livecd gives me these errors.

----------

## piero

I have the same problem with different chipset.

hdparm /dev/sda:

 *Quote:*   

> 
> 
> /dev/sda:
> 
>  HDIO_GET_MULTCOUNT failed: Inappropriate ioctl for device
> ...

 

dmesg:

 *Quote:*   

> 
> 
> libata version 1.10 loaded.
> 
> ata_piix version 1.03
> ...

 

its a dell dimension 8300.

----------

## Ice Hellion

Yea. My brother has the same problem as DGolem. It seems someone screwed up the SATA drivers for this particular chipset. Someone needs to get on that and fix it. Release a patch or something. Reiser4 helps someone what in speeding the system up to a working speed, but without DMA, a machine is almost unusable. Anyone else have any more input?

----------

## DGolem

I'm going to post some more info about the problem and my system.

```

bash-2.05b# hdparm -tT /dev/sda

/dev/sda:

 Timing cached reads:   1268 MB in  2.00 seconds = 632.83 MB/sec

HDIO_DRIVE_CMD(null) (wait for flush complete) failed: Inappropriate ioctl for device

 Timing buffered disk reads:  172 MB in  3.01 seconds =  57.09 MB/sec

HDIO_DRIVE_CMD(null) (wait for flush complete) failed: Inappropriate ioctl for device

```

Timing cached seems a little slow and I'm still getting ioctl errors that I don't even understand. I've looked everywhere on google for the meaning of "Inappropriate ioctl for device" but haven't really found a thing other than that ioctl is a command that I guess does low level stuff with devices (which makes it sound like a driver problem to me).

Here's my lspci:

```
0000:00:00.0 Host bridge: VIA Technologies, Inc. VT8377 [KT400/KT600 AGP] Host Bridge (rev 80)

0000:00:01.0 PCI bridge: VIA Technologies, Inc. VT8237 PCI Bridge

0000:00:09.0 Ethernet controller: 3Com Corporation 3c940 10/100/1000Base-T [Marvell] (rev 12)

0000:00:0e.0 Multimedia audio controller: Creative Labs SB Audigy (rev 04)

0000:00:0e.1 Input device controller: Creative Labs SB Audigy MIDI/Game port (rev 04)

0000:00:0e.2 FireWire (IEEE 1394): Creative Labs SB Audigy FireWire Port (rev 04)

0000:00:0f.0 RAID bus controller: VIA Technologies, Inc. VIA VT6420 SATA RAID Controller (rev 80)

0000:00:0f.1 IDE interface: VIA Technologies, Inc. VT82C586A/B/VT82C686/A/B/VT823x/A/C PIPC Bus Master IDE (rev 06)

0000:00:10.0 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 81)

0000:00:10.1 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 81)

0000:00:10.2 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 81)

0000:00:10.3 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 81)

0000:00:10.4 USB Controller: VIA Technologies, Inc. USB 2.0 (rev 86)

0000:00:11.0 ISA bridge: VIA Technologies, Inc. VT8237 ISA bridge [K8T800 South]

0000:01:00.0 VGA compatible controller: nVidia Corporation NV38 [GeForce FX 5950 Ultra] (rev a1)

```

Here's my entire dmesg (sorry if it's huge):

```

Linux version 2.6.10-ck4 (root@porcelain-tux) (gcc version 3.3.5 (Gentoo Linux 3.3.5-r1, ssp-3.3.2-3, pie-8.7.7.1)) #3 Sun Jan 16 00:36:49 EST 2005

BIOS-provided physical RAM map:

 BIOS-e820: 0000000000000000 - 000000000009d800 (usable)

 BIOS-e820: 000000000009d800 - 00000000000a0000 (reserved)

 BIOS-e820: 00000000000f0000 - 0000000000100000 (reserved)

 BIOS-e820: 0000000000100000 - 000000001fffb000 (usable)

 BIOS-e820: 000000001fffb000 - 000000001ffff000 (ACPI data)

 BIOS-e820: 000000001ffff000 - 0000000020000000 (ACPI NVS)

 BIOS-e820: 00000000fec00000 - 00000000fec01000 (reserved)

 BIOS-e820: 00000000fee00000 - 00000000fee01000 (reserved)

 BIOS-e820: 00000000ffff0000 - 0000000100000000 (reserved)

511MB LOWMEM available.

On node 0 totalpages: 131067

  DMA zone: 4096 pages, LIFO batch:1

  Normal zone: 126971 pages, LIFO batch:16

  HighMem zone: 0 pages, LIFO batch:1

DMI 2.3 present.

ACPI: RSDP (v000 ASUS                                  ) @ 0x000f5e20

ACPI: RSDT (v001 ASUS   A7V600   0x42302e31 MSFT 0x31313031) @ 0x1fffb000

ACPI: FADT (v001 ASUS   A7V600   0x42302e31 MSFT 0x31313031) @ 0x1fffb0b2

ACPI: BOOT (v001 ASUS   A7V600   0x42302e31 MSFT 0x31313031) @ 0x1fffb030

ACPI: MADT (v001 ASUS   A7V600   0x42302e31 MSFT 0x31313031) @ 0x1fffb058

ACPI: DSDT (v001   ASUS A7V600   0x00001000 MSFT 0x0100000b) @ 0x00000000

ACPI: Local APIC address 0xfee00000

ACPI: LAPIC (acpi_id[0x00] lapic_id[0x00] enabled)

Processor #0 6:10 APIC version 16

ACPI: LAPIC_NMI (acpi_id[0x00] high edge lint[0x1])

ACPI: IOAPIC (id[0x02] address[0xfec00000] gsi_base[0])

IOAPIC[0]: apic_id 2, version 3, address 0xfec00000, GSI 0-23

ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl edge)

ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 low level)

ACPI: IRQ0 used by override.

ACPI: IRQ2 used by override.

ACPI: IRQ9 used by override.

Enabling APIC mode:  Flat.  Using 1 I/O APICs

Using ACPI (MADT) for SMP configuration information

Built 1 zonelists

Kernel command line: root=/dev/sda3 vga=795 video=vesafb:ywrap,mtrr

mapped APIC to ffffd000 (fee00000)

mapped IOAPIC to ffffc000 (fec00000)

Initializing CPU#0

CPU 0 irqstacks, hard=c051a000 soft=c0519000

PID hash table entries: 2048 (order: 11, 32768 bytes)

Detected 1749.890 MHz processor.

Using tsc for high-res timesource

Console: colour dummy device 80x25

Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)

Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)

Memory: 514348k/524268k available (2920k kernel code, 9328k reserved, 1056k data, 192k init, 0k highmem)

Checking if this processor honours the WP bit even in supervisor mode... Ok.

Calibrating delay loop... 3448.83 BogoMIPS (lpj=1724416)

Mount-cache hash table entries: 512 (order: 0, 4096 bytes)

CPU: After generic identify, caps: 0383fbff c1c3fbff 00000000 00000000

CPU: After vendor identify, caps:  0383fbff c1c3fbff 00000000 00000000

CPU: L1 I Cache: 64K (64 bytes/line), D cache 64K (64 bytes/line)

CPU: L2 Cache: 512K (64 bytes/line)

CPU: After all inits, caps:        0383fbff c1c3fbff 00000000 00000020

Intel machine check architecture supported.

Intel machine check reporting enabled on CPU#0.

CPU: AMD Athlon(TM) XP 3000+ stepping 00

Enabling fast FPU save and restore... done.

Enabling unmasked SIMD FPU exception support... done.

Checking 'hlt' instruction... OK.

ENABLING IO-APIC IRQs

..TIMER: vector=0x31 pin1=2 pin2=-1

NET: Registered protocol family 16

PCI: PCI BIOS revision 2.10 entry at 0xf1970, last bus=1

PCI: Using configuration type 1

mtrr: v2.0 (20020519)

ACPI: Subsystem revision 20041105

ACPI: Interpreter enabled

ACPI: Using IOAPIC for interrupt routing

ACPI: PCI Interrupt Link [LNKA] (IRQs 3 4 5 6 7 9 10 *11 12)

ACPI: PCI Interrupt Link [LNKB] (IRQs 3 4 5 6 7 9 *10 11 12)

ACPI: PCI Interrupt Link [LNKC] (IRQs 3 *4 5 6 7 9 10 11 12)

ACPI: PCI Interrupt Link [LNKD] (IRQs 3 4 5 6 7 9 10 11 12) *0, disabled.

ACPI: PCI Interrupt Link [LNKE] (IRQs *3 4 5 6 7 9 10 11 12)

ACPI: PCI Interrupt Link [LNKF] (IRQs 3 4 5 6 *7 9 10 11 12)

ACPI: PCI Interrupt Link [LNKG] (IRQs 3 4 5 *6 7 9 10 11 12)

ACPI: PCI Interrupt Link [LNKH] (IRQs 3 4 5 6 7 9 10 11 12) *15, disabled.

ACPI: PCI Root Bridge [PCI0] (00:00)

PCI: Probing PCI hardware (bus 00)

ACPI: PCI Interrupt Routing Table [\_SB_.PCI0._PRT]

ACPI: PCI Interrupt Routing Table [\_SB_.PCI0.PCI1._PRT]

SCSI subsystem initialized

usbcore: registered new driver usbfs

usbcore: registered new driver hub

PCI: Using ACPI for IRQ routing

** PCI interrupts are no longer routed automatically.  If this

** causes a device to stop working, it is probably because the

** driver failed to call pci_enable_device().  As a temporary

** workaround, the "pci=routeirq" argument restores the old

** behavior.  If this argument makes the device work again,

** please email the output of "lspci" to bjorn.helgaas@hp.com

** so I can fix the driver.

Simple Boot Flag at 0x3a set to 0x1

Machine check exception polling timer started.

audit: initializing netlink socket (disabled)

audit(1105853860.559:0): initialized

Installing knfsd (copyright (C) 1996 okir@monad.swb.de).

NTFS driver 2.1.22 [Flags: R/O].

vesafb: framebuffer at 0xd0000000, mapped to 0xe0880000, using 10240k, total 262144k

vesafb: mode is 1280x1024x32, linelength=5120, pages=0

vesafb: protected mode interface info at c000:fb30

vesafb: pmi: set display start = c00cfb66, set palette = c00cfbd0

vesafb: pmi: ports = 3b4 3b5 3ba 3c0 3c1 3c4 3c5 3c6 3c7 3c8 3c9 3cc 3ce 3cf 3d0 3d1 3d2 3d3 3d4 3d5 3da 

vesafb: scrolling: ywrap using protected mode interface, yres_virtual=2048

vesafb: Truecolor: size=8:8:8:8, shift=24:16:8:0

Console: switching to colour frame buffer device 160x64

fb0: VESA VGA frame buffer device

ACPI: Power Button (FF) [PWRF]

Real Time Clock Driver v1.12

Linux agpgart interface v0.100 (c) Dave Jones

agpgart: Detected VIA KT400/KT400A/KT600 chipset

agpgart: Maximum main memory to use for agp memory: 439M

agpgart: AGP aperture is 256M @ 0xe0000000

serio: i8042 AUX port at 0x60,0x64 irq 12

serio: i8042 KBD port at 0x60,0x64 irq 1

io scheduler noop registered

io scheduler anticipatory registered

io scheduler deadline registered

io scheduler cfq registered

elevator: using cfq as default io scheduler

floppy0: no floppy controllers found

loop: loaded (max 8 devices)

ACPI: PCI interrupt 0000:00:09.0[A] -> GSI 18 (level, low) -> IRQ 18

ACPI: PCI interrupt 0000:00:09.0[A] -> GSI 18 (level, low) -> IRQ 18

eth0: 3Com Gigabit LOM (3C940)

      PrefPort:A  RlmtMode:Check Link State

Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2

ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx

VP_IDE: IDE controller at PCI slot 0000:00:0f.1

ACPI: PCI interrupt 0000:00:0f.1[A] -> GSI 20 (level, low) -> IRQ 20

VP_IDE: chipset revision 6

VP_IDE: not 100% native mode: will probe irqs later

VP_IDE: VIA vt8237 (rev 00) IDE UDMA133 controller on pci0000:00:0f.1

    ide0: BM-DMA at 0x9800-0x9807, BIOS settings: hda:DMA, hdb:DMA

    ide1: BM-DMA at 0x9808-0x980f, BIOS settings: hdc:pio, hdd:pio

Probing IDE interface ide0...

hda: Pioneer DVD-ROM ATAPIModel DVD-120S, ATAPI CD/DVD-ROM drive

hdb: CR-48XATE, ATAPI CD/DVD-ROM drive

ide0 at 0x1f0-0x1f7,0x3f6 on irq 14

Probing IDE interface ide1...

Probing IDE interface ide1...

Probing IDE interface ide2...

ide2: Wait for ready failed before probe !

Probing IDE interface ide3...

ide3: Wait for ready failed before probe !

Probing IDE interface ide4...

ide4: Wait for ready failed before probe !

Probing IDE interface ide5...

ide5: Wait for ready failed before probe !

hda: ATAPI 126X DVD-ROM drive, 256kB Cache, UDMA(33)

Uniform CD-ROM driver Revision: 3.20

hdb: ATAPI 40X CD-ROM CD-R/RW drive, 2048kB Cache, UDMA(33)

libata version 1.10 loaded.

sata_via version 1.0

ACPI: PCI interrupt 0000:00:0f.0[A] -> GSI 20 (level, low) -> IRQ 20

sata_via(0000:00:0f.0): routed to hard irq line 0

ata1: SATA max UDMA/133 cmd 0xB800 ctl 0xB402 bmdma 0xA400 irq 20

ata2: SATA max UDMA/133 cmd 0xB000 ctl 0xA802 bmdma 0xA408 irq 20

ata1: dev 0 cfg 49:2f00 82:346b 83:7f61 84:4003 85:3469 86:3c41 87:4003 88:407f

ata1: dev 0 ATA, max UDMA/133, 312581808 sectors: lba48

ata1: dev 0 configured for UDMA/133

scsi0 : sata_via

ata2: no device found (phy stat 00000000)

scsi1 : sata_via

  Vendor: ATA       Model: WDC WD1600JD-00H  Rev: 08.0

  Type:   Direct-Access                      ANSI SCSI revision: 05

SCSI device sda: 312581808 512-byte hdwr sectors (160042 MB)

SCSI device sda: drive cache: write back

SCSI device sda: 312581808 512-byte hdwr sectors (160042 MB)

SCSI device sda: drive cache: write back

 sda: sAttached scsi disk sda at scsi0, channel 0, id 0, lun 0

Attached scsi generic sg0 at scsi0, channel 0, id 0, lun 0,  type 0

ACPI: PCI interrupt 0000:00:10.4[C] -> GSI 21 (level, low) -> IRQ 21

ehci_hcd 0000:00:10.4: VIA Technologies, Inc. USB 2.0

ehci_hcd 0000:00:10.4: irq 21, pci mem 0xcc000000

ehci_hcd 0000:00:10.4: new USB bus registered, assigned bus number 1

ehci_hcd 0000:00:10.4: USB 2.0 initialized, EHCI 1.00, driver 26 Oct 2004

hub 1-0:1.0: USB hub found

hub 1-0:1.0: 8 ports detected

USB Universal Host Controller Interface driver v2.2

ACPI: PCI interrupt 0000:00:10.0[A] -> GSI 21 (level, low) -> IRQ 21

PCI: Via IRQ fixup for 0000:00:10.0, from 0 to 5

uhci_hcd 0000:00:10.0: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller

uhci_hcd 0000:00:10.0: irq 21, io base 0x9400

uhci_hcd 0000:00:10.0: new USB bus registered, assigned bus number 2

hub 2-0:1.0: USB hub found

hub 2-0:1.0: 2 ports detected

ACPI: PCI interrupt 0000:00:10.1[A] -> GSI 21 (level, low) -> IRQ 21

PCI: Via IRQ fixup for 0000:00:10.1, from 0 to 5

uhci_hcd 0000:00:10.1: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (#2)

uhci_hcd 0000:00:10.1: irq 21, io base 0x9000

uhci_hcd 0000:00:10.1: new USB bus registered, assigned bus number 3

hub 3-0:1.0: USB hub found

hub 3-0:1.0: 2 ports detected

ACPI: PCI interrupt 0000:00:10.2[B] -> GSI 21 (level, low) -> IRQ 21

PCI: Via IRQ fixup for 0000:00:10.2, from 0 to 5

uhci_hcd 0000:00:10.2: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (#3)

uhci_hcd 0000:00:10.2: irq 21, io base 0x8800

uhci_hcd 0000:00:10.2: new USB bus registered, assigned bus number 4

hub 4-0:1.0: USB hub found

hub 4-0:1.0: 2 ports detected

ACPI: PCI interrupt 0000:00:10.3[B] -> GSI 21 (level, low) -> IRQ 21

PCI: Via IRQ fixup for 0000:00:10.3, from 0 to 5

uhci_hcd 0000:00:10.3: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (#4)

uhci_hcd 0000:00:10.3: irq 21, io base 0x8400

uhci_hcd 0000:00:10.3: new USB bus registered, assigned bus number 5

hub 5-0:1.0: USB hub found

hub 5-0:1.0: 2 ports detected

Initializing USB Mass Storage driver...

usbcore: registered new driver usb-storage

USB Mass Storage support registered.

usb 2-1: new low speed USB device using uhci_hcd and address 2

usb 2-2: new low speed USB device using uhci_hcd and address 3

input: USB HID v1.10 Mouse [B16_b_02 USB-PS/2 Optical Mouse] on usb-0000:00:10.0-1

input: USB HID v1.00 Keyboard [LiteOn Generic Standardard USB Keyboard] on usb-0000:00:10.0-2

usbcore: registered new driver usbhid

drivers/usb/input/hid-core.c: v2.0:USB HID core driver

mice: PS/2 mouse device common for all mice

usb 3-2: new low speed USB device using uhci_hcd and address 2

input: PC Speaker

Advanced Linux Sound Architecture Driver Version 1.0.6 (Sun Aug 15 07:17:53 2004 UTC).

ACPI: PCI interrupt 0000:00:0e.0[A] -> GSI 17 (level, low) -> IRQ 17

ALSA device list:

  #0: Sound Blaster Audigy2 (rev.4) at 0xd400, irq 17

oprofile: using NMI interrupt.

NET: Registered protocol family 2

IP: routing cache hash table of 4096 buckets, 32Kbytes

TCP: Hash tables configured (established 32768 bind 65536)

ip_conntrack version 2.1 (4095 buckets, 32760 max) - 300 bytes per conntrack

ip_tables: (C) 2000-2002 Netfilter core team

ipt_recent v0.3.1: Stephen Frost <sfrost@snowman.net>.  http://snowman.net/projects/ipt_recent/

arp_tables: (C) 2002 David S. Miller

NET: Registered protocol family 1

NET: Registered protocol family 17

ACPI wakeup devices: 

PCI0 PCI1 USB0 USB1 USB2 USB3 SU20 MC97 

ACPI: (supports S0 S1 S4 S5)

ReiserFS: sda3: found reiserfs format "3.6" with standard journal

input: USB HID v1.10 Joystick [Logitech Logitech Attack 3] on usb-0000:00:10.1-2

ReiserFS: sda3: using ordered data mode

ReiserFS: sda3: journal params: device sda3, size 8192, journal first block 18, max trans len 1024, max batch 900, max commit age 30, max trans age 30

ReiserFS: sda3: checking transaction log (sda3)

ReiserFS: sda3: Using r5 hash to sort names

VFS: Mounted root (reiserfs filesystem) readonly.

Freeing unused kernel memory: 192k freed

Adding 506036k swap on /dev/sda2.  Priority:-1 extents:1

nvidia: module license 'NVIDIA' taints kernel.

ACPI: PCI interrupt 0000:01:00.0[A] -> GSI 16 (level, low) -> IRQ 16

NVRM: loading NVIDIA Linux x86 NVIDIA Kernel Module  1.0-6629  Wed Nov  3 13:12:51 PST 2004

eth0: network connection up using port A

    speed:           100

    autonegotiation: yes

    duplex mode:     full

    flowctrl:        symmetric

    irq moderation:  disabled

    scatter-gather:  enabled

agpgart: Found an AGP 3.5 compliant device at 0000:00:00.0.

da1 sda2 sda3agpgart: X passes broken AGP3 flags (1f000a1f). Fixed.

agpgart: Putting AGP V3 device at 0000:00:00.0 into 8x mode

agpgart: Putting AGP V3 device at 0000:01:00.0 into 8x mode

agpgart: Found an AGP 3.5 compliant device at 0000:00:00.0.

agpgart: X passes broken AGP3 flags (1f000a1f). Fixed.

agpgart: Putting AGP V3 device at 0000:00:00.0 into 8x mode

agpgart: Putting AGP V3 device at 0000:01:00.0 into 8x mode

drivers/usb/input/hid-input.c: event field not found

```

It's hard to find any info on this and when I do manage to find someone with my exact problem it either goes unsanswered or it turns out they either forgot to load the driver or they set dma to disk only.... I've done neither.

BTW, I'm hoping someone can at least tell me whether DMA is actually on or off and whether or not I've got it on at full speed from this. I can see some messages about UDMA being at 133 but I'm not sure how to tell if it's actually turning on. And is it normal for a newer dvd drive to say it's running at UDMA(33) (hdparm says it's on udma2)?

----------

## nexus780

Having that problem too...

Got a MSI K7N2 Delta ILSR with on Board "RAID" (Promise PDC20376 (FastTrak 376) (rev 02)) and on it two SATA disks (one Hitachi 160 GB, one brand new Maxtor 300 GB with NCQ). Just tried getting some info on the new one (to check, just to be safe) and then do some testing on it. But:

```
bash-2.05b# hdparm -i /dev/sda 

/dev/sda:

 HDIO_GET_IDENTITY failed: Inappropriate ioctl for device

bash-2.05b# hdparm -i /dev/sda1

/dev/sda1:

 HDIO_GET_IDENTITY failed: Inappropriate ioctl for device
```

I looked in google and these forums, too, but couldn't find anything. I'm running 2.6.10-gentoo-r4 and the new SATA driver type (can't remember its name now). If there is anything to try that destroys all data on the drive (not the drive itself  :Wink:  ) that'd be fine for me.

Edit: The new one is of course sdb, but the same thing happens. It doesn't matter whether the device is in general use is it? (got my - completely unused swap and one not used but mounted reiserfs partition with 250GB or so)

----------

## DGolem

This is weird. I decided I was pissed off at the libata driver and to just go back to using the standard IDE driver for both my IDE and SATA controllers as a temporary workaround. I took out everything in the SCSI section and selected this option in the IDE section:

```
[*]     Support for SATA (deprecated; conflicts with libata SATA driver)
```

Now my harddrive shows up as hde. Anyway I run hdparm and now this is what I get:

```
bash-2.05b# hdparm /dev/hde

/dev/hde:

 multcount    = 16 (on)

 IO_support   =  0 (default 16-bit)

 unmaskirq    =  0 (off)

 using_dma    =  1 (on)

 keepsettings =  0 (off)

 readonly     =  0 (off)

 readahead    = 256 (on)

 geometry     = 19457/255/63, sectors = 160041885696, start = 0
```

Oh good it looks like I finally have dma on..... but then i run this:

```
bash-2.05b# hdparm -i /dev/hde

/dev/hde:

 Model=WDC WD1600JD-00HBB0, FwRev=08.02D08, SerialNo=WD-WMAL91216048

 Config={ HardSect NotMFM HdSw>15uSec SpinMotCtl Fixed DTR>5Mbs FmtGapReq }

 RawCHS=16383/16/63, TrkSize=57600, SectSize=600, ECCbytes=74

 BuffType=DualPortCache, BuffSize=8192kB, MaxMultSect=16, MultSect=16

 CurCHS=65535/1/63, CurSects=4128705, LBA=yes, LBAsects=268435455

 IORDY=on/off, tPIO={min:120,w/IORDY:120}, tDMA={min:120,rec:120}

 PIO modes:  pio0 pio1 pio2 pio3 pio4 

 DMA modes:  mdma0 mdma1 mdma2 

 UDMA modes: udma0 udma1 udma2 

 AdvancedPM=no WriteCache=enabled

 Drive conforms to: device does not report version: 

 * signifies the current active mode

```

WTF? Not a single mode is selected as active and my drive seems just as slow as ever..... what does this mean?

----------

## piero

same problem here ..

dmesg:

```
libata version 1.10 loaded.

ata_piix version 1.03

ata1: SATA max UDMA/133 cmd 0xEFF0 ctl 0xEFE6 bmdma 0xEF60 irq 18

ata2: SATA max UDMA/133 cmd 0xEFA8 ctl 0xEFE2 bmdma 0xEF68 irq 18

ata1: dev 0 cfg 49:2f00 82:7c6b 83:7b09 84:4003 85:7c69 86:3a01 87:4003 88:207f

ata1: dev 0 ATA, max UDMA/133, 240121728 sectors:

ata1: dev 0 configured for UDMA/133

scsi0 : ata_piix

ata2: SATA port has no device.

scsi1 : ata_piix
```

hdparm:

```
zelos ps # hdparm /dev/sda

/dev/sda:

 HDIO_GET_MULTCOUNT failed: Inappropriate ioctl for device

 IO_support   =  0 (default 16-bit)

 readonly     =  0 (off)

 readahead    = 256 (on)

 geometry     = 14946/255/63, sectors = 122942324736, start = 0

zelos ps # hdparm -tT /dev/sda

/dev/sda:

 Timing cached reads:   3744 MB in  2.00 seconds = 1871.35 MB/sec

HDIO_DRIVE_CMD(null) (wait for flush complete) failed: Inappropriate ioctl fordevice

 Timing buffered disk reads:  142 MB in  3.00 seconds =  47.26 MB/sec

HDIO_DRIVE_CMD(null) (wait for flush complete) failed: Inappropriate ioctl fordevice

```

----------

## jesse_kahtava

yeh, i have the same problem with the kt600. i honestly didn't notice this problem, though, until now. it'd be great to get this working properly... i'd love a speed increase (who wouldn't)!

----------

## DGolem

Still nothing on google. Even though hdparm doesn't perform too bad it really does feel like I lack dma. The CPU usage goes up (more than I think it should) anytime I do anything with the drive and it's slower than any IDE I've ever run linux on in the past. Since it's not looking like there's a solution to this if it's not fixed by 2.6.11 (I really think it's a driver issue) I'm going to just go ahead and buy a controller card from Promise or something.

----------

## Kern3lP4nic

Exact same problem here, with a Maxtor DiamondMax10 and ICH5 chipset:

```

# hdparm /dev/sda

/dev/sda:

 HDIO_GET_MULTCOUNT failed: Inappropriate ioctl for device

 IO_support   =  0 (default 16-bit)

 readonly     =  0 (off)

 readahead    = 256 (on)

 geometry     = 24792/255/63, sectors = 203928109056, start = 0

```

dmesg:

```

ide-scsi: No active request in idescsi_eh_reset

scsi: Device offlined - not ready after error recovery: host 0 channel 0 id 0 lun 0

libata version 1.10 loaded.

ata_piix version 1.03

ACPI: PCI interrupt 0000:00:1f.2[A] -> GSI 18 (level, low) -> IRQ 18

PCI: Setting latency timer of device 0000:00:1f.2 to 64

ata1: SATA max UDMA/133 cmd 0xC000 ctl 0xC402 bmdma 0xD000 irq 18

ata2: SATA max UDMA/133 cmd 0xC800 ctl 0xCC02 bmdma 0xD008 irq 18

ata1: SATA port has no device.

scsi1 : ata_piix

ata2: dev 0 cfg 49:2f00 82:7c6b 83:7f09 84:4063 85:7c68 86:3e01 87:4063 88:207f

ata2: dev 0 ATA, max UDMA/133, 398297088 sectors: lba48

ata2: dev 0 configured for UDMA/133

scsi2 : ata_piix

  Vendor: ATA       Model: Maxtor 6B200M0    Rev: BANC

  Type:   Direct-Access                      ANSI SCSI revision: 05

SCSI device sda: 398297088 512-byte hdwr sectors (203928 MB)

SCSI device sda: drive cache: write back

SCSI device sda: 398297088 512-byte hdwr sectors (203928 MB)

SCSI device sda: drive cache: write back

 sda: unknown partition table

Attached scsi disk sda at scsi2, channel 0, id 0, lun 0

Attached scsi generic sg0 at scsi2, channel 0, id 0, lun 0,  type 0

```

If someone has a solution please let me know....

----------

## DGolem

Is it possible it's an incompatibility between the drive and the controller? I'm not sure if there's any way to test it unless Western Digital or Maxtor's diagnostic tools can tell. I'm going to see if I can't find a blacklist or a whitelist of compatible drives for my controller (though I'd be REALLY surprised to find out via doesn't support someone as big as WD or Maxtor... I mean my drive is just about the only 7200 rpm sata drive they make).

----------

## DGolem

Oh yeah forgot to mention. I got 2.6.11 a while ago, thinking maybe an actual kernel revision might fix it and even though there was some via sata stuff in the changelog, same errors.

----------

## floam

Those are not "errors". You're trying to do ATA commands on a SCSI device, of course it won't work.  It won't be possible for those (or  S.M.A.R.T.) to work until ATA passthru is supported by libata. I use it here, but it may or may not be stable. You need to pull libata-dev with bitkeeper.

----------

## Kern3lP4nic

Thanks for the answer but I'm very confused, I have to admit that.

First I want to show relevant (gentoo 2.6.11-r4) options that gave me the messages above:

```

--- SCSI device support

[ ]   legacy /proc/scsi/ support

---   SCSI support type (disk, tape, CD-ROM)

<*>   SCSI disk support

< >   SCSI tape support

< >   SCSI OnStream SC-x0 tape support

< >   SCSI CDROM support

<*>   SCSI generic support

....

--SCSI low-level drivers

[*] Serial ATA (SATA) support

< >   AHCI SATA support (NEW)

< >   ServerWorks Frodo / Apple K2 SATA support (NEW)

<*>   Intel PIIX/ICH SATA support (NEW)

< >   NVIDIA SATA support (NEW)

< >   Promise PATA 2027x support (NEW)

< >   Promise PATA 2027x support (NEW)

< >   Promise SATA TX2/TX4 support (NEW)

< >   Pacific Digital SATA QStor support (NEW)

< >   Promise SATA SX4 support (NEW)

< >   Silicon Image SATA support (NEW)

< >   SiS 964/180 SATA support (NEW)

< >   ULi Electronics SATA support (NEW)

< >   VIA SATA support (NEW)

< >   VITESSE VSC-7174 SATA support (NEW)

```

by the way, I see it now, this is the same configuration advised here http://gentoo-wiki.com/HARDWARE_SATA

Now I'm using the deprecated SATA driver in ATA/ATAPI/MFM/RLL and it seems to work (even if I have not really tested it yet):

```

# hdparm /dev/hde

/dev/hde:

 multcount    = 16 (on)

 IO_support   =  1 (32-bit)

 unmaskirq    =  1 (on)

 using_dma    =  1 (on)

 keepsettings =  0 (off)

 readonly     =  0 (off)

 readahead    = 256 (on)

 geometry     = 24792/255/63, sectors = 203928109056, start = 0

```

this really seems to confirm what floam wrote BUT here is what the additional info for this option has to say:

 *Quote:*   

> 
> 
> CONFIG_BLK_DEV_IDE_SATA:                                                                                                                               There are two drivers for Serial ATA controllers. The main driver, "libata", exists inside the SCSI subsystem and supports most modern SATA controllers. The IDE driver (which you are currently configuring) supports a few first-generation SATA controllers. In order to eliminate conflicts between the two subsystems, this config option enables the IDE driver's SATA support. Normally this is disabled, as it is preferred that libata supports SATA controllers, and this (IDE) driver supports PATA controllers.
> 
> If unsure, say N.
> ...

 

Now, put it together the gentoo wiki page above... do you see why I'm confused?  :Very Happy: 

Anyway, I think I'll keep the actual settings until one of the following:

1) I figure out what bitkeeper is  :Very Happy: 

2) a kernel with a working version of libata is released (maybe will be 2.6.12? here are some info )

cheers

----------

## jesse_kahtava

so what does this mean? is dma not applicable? is there a different utility to set these options?

----------

## DGolem

Bitkeeper is a source repository program like CVS but it has more features which is why the kernel devs use and prefer it over CVS. Now that the source has been released I guess there's no reason not to.

I find it strange though that something called Serial ATA doesn't actually work with ATA commands. I did know however that the kernel sees it as a SCSI device but considered how long SATA and especially SCSI been supported I assumed it would just work.

I want to try the libata-dev driver but I'm not sure which file to get. I found tarballs of the libata-dev drivers in an ftp server linked to by the gentoo wiki's page on SATA so I wouldn't have to figure out bitkeeper but there's like 3 different patches to choose from. Also I've never patched a kernel myself before and I'm not sure how to use the patch command or even if it will work with the gentoo-dev-sources I'm on or if I need vanilla.

http://www.kernel.org/pub/linux/kernel/people/jgarzik/libata/

----------

## DGolem

OK, I found a guide on patching kernels manually but when I try it using 2.6.11-bk6-libata-dev1.patch.bz2 it pretty much looks like it failed. I think this is only going to work with the vanilla sources which I really don't want to use so I'll just have to hope the changes in libata-dev are included with 2.6.12.

```
bash-2.05b# bzcat /usr/portage/distfiles/2.6.11-bk6-libata-dev1.patch.bz2 | patch -p1

patching file drivers/scsi/Kconfig

patching file drivers/scsi/Makefile

Hunk #1 FAILED at 121.

1 out of 1 hunk FAILED -- saving rejects to file drivers/scsi/Makefile.rej

patching file drivers/scsi/ahci.c

Hunk #5 succeeded at 266 (offset -1 lines).

Hunk #6 succeeded at 490 (offset -1 lines).

Hunk #7 succeeded at 503 (offset -1 lines).

Hunk #8 succeeded at 516 (offset -1 lines).

Hunk #9 succeeded at 858 (offset -1 lines).

Hunk #10 succeeded at 952 (offset -1 lines).

Hunk #11 succeeded at 970 (offset -1 lines).

Hunk #12 succeeded at 1013 (offset -1 lines).

Hunk #13 succeeded at 1034 (offset -1 lines).

Hunk #14 succeeded at 1046 (offset -1 lines).

patching file drivers/scsi/ata_adma.c

patching file drivers/scsi/libata-core.c

Hunk #16 FAILED at 3411.

Hunk #17 succeeded at 4054 (offset 5 lines).

1 out of 17 hunks FAILED -- saving rejects to file drivers/scsi/libata-core.c.rej

patching file drivers/scsi/libata-scsi.c

patching file drivers/scsi/libata.h

The next patch would create the file drivers/scsi/pata_pdc2027x.c,

which already exists!  Assume -R? [n] y

patching file drivers/scsi/pata_pdc2027x.c

Hunk #1 FAILED at 1.

File drivers/scsi/pata_pdc2027x.c is not empty after patch, as expected

1 out of 1 hunk FAILED -- saving rejects to file drivers/scsi/pata_pdc2027x.c.rej

patching file drivers/scsi/sata_promise.c

Hunk #2 FAILED at 80.

Hunk #3 succeeded at 143 with fuzz 1 (offset 12 lines).

Hunk #4 succeeded at 150 (offset 1 line).

Hunk #5 succeeded at 184 (offset 1 line).

Hunk #6 FAILED at 271.

Hunk #7 succeeded at 232 with fuzz 2 (offset -372 lines).

Hunk #8 FAILED at 303.

Hunk #9 succeeded at 798 (offset 49 lines).

3 out of 9 hunks FAILED -- saving rejects to file drivers/scsi/sata_promise.c.rej

patching file include/linux/ata.h

patching file include/linux/libata.h

Hunk #3 FAILED at 206.

Hunk #4 succeeded at 281 (offset 1 line).

Hunk #5 succeeded at 428 (offset 1 line).

1 out of 5 hunks FAILED -- saving rejects to file include/linux/libata.h.rej

patching file include/scsi/scsi.h
```

----------

## jesse_kahtava

"Now I'm using the deprecated SATA driver in ATA/ATAPI/MFM/RLL and it seems to work (even if I have not really tested it yet)"

Kern3lP4anic, if you could test this and post results that would be great. I'll try to do it tonight as well and see how it goes, but i won't be home for several hours.

P.S. sorry 'bout the poorly formatted messages. i'm using links2 over ssh on a windows machine at work with an annoying, poorly deployed proxy disabling normal web browser usage.

----------

## DGolem

When I used the standard ATA/ATAPI/MFM/RLL drivers for my sata the errors went away but it would not tell me what mode I was in like whether it was pio or dma. Maybe this is normal for SATA drives I don't know. It might just be SATA uses something different than any of the modes hdparm knows to look for.

----------

## floam

jesse_kahtava: Don't use the deprecated SATA! It's horrible and is deprecated for a reason.

DGolemL: Serial ATA devices can understand ATA just fine. But if the kernel can't pass the ATA commands through the SCSI to them, they obviously can't do anything if they don't get them. You need ATA passthru support in the driver. The reason that the old drivers worked is because they were implemented with the old garbage IDE stuff.

For anyone interested, if you've got 2.6.12-rc1-mm3, I've got a patch I generated from the bitkeeper repository.

http://floam.sh.nu/files/kernel/bk-libata-dev.patch

It'll probably apply to vanilla 2.6.12-rc1, but no promises. And no, it won't be in 2.6.12. Things in libata-dev have to sit there for a while to insure that they are safe.

Fact is, you really shoudn't need to change anything with hdparm anyways. The kernel should always use the fastest mode. The only true use of this is to be able to access S.M.A.R.T (diagnostics, life-uptime, temperature, etc.) I don't see why the original guy is trying to turn UDMA on, it already should be. hdparm is pretty much uneeded with libata.

----------

## Kern3lP4nic

Those are hdparm benchmarks at their third run with deprecated ide-sata.

hda: pata ibm-hitachi 80Gb, 2MB cache

hde: sata maxtor diamondmax10 200GB, 8MB cache

```

shodan linux # hdparm -t /dev/hda /dev/hde

/dev/hda:

 Timing buffered disk reads:   36 MB in  3.05 seconds =  11.81 MB/sec

/dev/hde:

 Timing buffered disk reads:    2 MB in 30.03 seconds =  68.19 kB/sec

```

Given the results, I would definitively say do not use this driver. I'm also getting a lot of garbage in dmesg, here is a snippet:

```

hde: lost interrupt

irq 18: nobody cared!

 [<c0134384>] __report_bad_irq+0x24/0x90

 [<c0134481>] note_interrupt+0x61/0x90

 [<c0133e5b>] __do_IRQ+0x13b/0x150

 [<c01052e7>] do_IRQ+0x47/0x70

 =======================

 [<c01039de>] common_interrupt+0x1a/0x20

 [<c0101053>] default_idle+0x23/0x30

 [<c01010f0>] cpu_idle+0x50/0x60

 [<c04bf78f>] start_kernel+0x13f/0x160

 [<c04bf370>] unknown_bootoption+0x0/0x1c0

handlers:

[<c0290990>] (ide_intr+0x0/0x1a0)

[<c02bbeb0>] (ohci_irq_handler+0x0/0x770)

[<c02ccb90>] (usb_hcd_irq+0x0/0x60)

Disabling IRQ #18

hde: dma_timer_expiry: dma status == 0x24

hde: DMA interrupt recovery

hde: lost interrupt

irq 18: nobody cared!

 [<c0134384>] __report_bad_irq+0x24/0x90

 [<c0134481>] note_interrupt+0x61/0x90

 [<c0133e5b>] __do_IRQ+0x13b/0x150

 [<c01052e7>] do_IRQ+0x47/0x70

 =======================

 [<c01039de>] common_interrupt+0x1a/0x20

handlers:

[<c0290990>] (ide_intr+0x0/0x1a0)

[<c02bbeb0>] (ohci_irq_handler+0x0/0x770)

[<c02ccb90>] (usb_hcd_irq+0x0/0x60)

Disabling IRQ #18

hde: lost interrupt

irq 18: nobody cared!

 [<c0134384>] __report_bad_irq+0x24/0x90

 [<c0134481>] note_interrupt+0x61/0x90

 [<c0133e5b>] __do_IRQ+0x13b/0x150

 [<c01052e7>] do_IRQ+0x47/0x70

 =======================

 [<c01039de>] common_interrupt+0x1a/0x20

handlers:

[<c0290990>] (ide_intr+0x0/0x1a0)

[<c02bbeb0>] (ohci_irq_handler+0x0/0x770)

[<c02ccb90>] (usb_hcd_irq+0x0/0x60)

Disabling IRQ #18

hde: dma_timer_expiry: dma status == 0x24

hde: DMA interrupt recovery

hde: lost interrupt

irq 18: nobody cared!

 [<c0134384>] __report_bad_irq+0x24/0x90

 [<c0134481>] note_interrupt+0x61/0x90

 [<c0133e5b>] __do_IRQ+0x13b/0x150

 [<c01052e7>] do_IRQ+0x47/0x70

 =======================

 [<c01039de>] common_interrupt+0x1a/0x20

handlers:

[<c0290990>] (ide_intr+0x0/0x1a0)

[<c02bbeb0>] (ohci_irq_handler+0x0/0x770)

[<c02ccb90>] (usb_hcd_irq+0x0/0x60)

Disabling IRQ #18

irq 18: nobody cared!

 [<c0134384>] __report_bad_irq+0x24/0x90

 [<c0134481>] note_interrupt+0x61/0x90

 [<c0133e5b>] __do_IRQ+0x13b/0x150

 [<c01052e7>] do_IRQ+0x47/0x70

 =======================

 [<c01039de>] common_interrupt+0x1a/0x20

handlers:

[<c0290990>] (ide_intr+0x0/0x1a0)

[<c02bbeb0>] (ohci_irq_handler+0x0/0x770)

[<c02ccb90>] (usb_hcd_irq+0x0/0x60)

Disabling IRQ #18

hde: dma_timer_expiry: dma status == 0x24

hde: DMA interrupt recovery

hde: lost interrupt

irq 18: nobody cared!

 [<c0134384>] __report_bad_irq+0x24/0x90

 [<c0134481>] note_interrupt+0x61/0x90

 [<c0133e5b>] __do_IRQ+0x13b/0x150

 [<c01052e7>] do_IRQ+0x47/0x70

 =======================

 [<c01039de>] common_interrupt+0x1a/0x20

 [<c0101053>] default_idle+0x23/0x30

 [<c01010f0>] cpu_idle+0x50/0x60

 [<c04bf78f>] start_kernel+0x13f/0x160

 [<c04bf370>] unknown_bootoption+0x0/0x1c0

handlers:

[<c0290990>] (ide_intr+0x0/0x1a0)

[<c02bbeb0>] (ohci_irq_handler+0x0/0x770)

[<c02ccb90>] (usb_hcd_irq+0x0/0x60)

Disabling IRQ #18

hde: dma_timer_expiry: dma status == 0x24

hde: DMA interrupt recovery

hde: lost interrupt

irq 18: nobody cared!

 [<c0134384>] __report_bad_irq+0x24/0x90

 [<c0134481>] note_interrupt+0x61/0x90

 [<c0133e5b>] __do_IRQ+0x13b/0x150

 [<c01052e7>] do_IRQ+0x47/0x70

 =======================

 ...and so on...

 
```

 I'll probably try out the patched 2.6.12-rc1-mm3. I'll let you know.

----------

## Kern3lP4nic

just for the records: I've got similar problems even in windows (sp2 with latest intel chipset drivers installed)!! He tries to automatically install IDE channel drivers, and then aborts complaining that "the drivers are not intended for this platform".

think about sata technology is out from about 2 years now... how can it be so difficult to make it work correctly!??  :Rolling Eyes: 

----------

## floam

It works fine. If you really need that feature (you probably don't) just apply the patch.

And two years is nothing. IDE has been around for over fifteen years. Do you think it was as good as it is now back in 1990?

----------

## DGolem

My only concern right now is whether or not i'm getting peak performance from my drive. The reason, is though my hdparm results seem decent, I usually get around 56 MB timing buffered disk reads, loading times for everything seems very slow. X doesn't even load up as fast as it used to. Loading times are unbearable in newer games. It feels much slower than my last ide drive which was a udma133 7200 rpm drive I think. I'm on reiser3 and here's what i get from time emerge sync for example (I'm on a cable modem and I made sure it connected to a fast server):

```

real    4m58.335s

user    0m57.369s

sys     0m16.401s

```

I know someone on a harddrive similar to my old IDE who can sync in about 1 minute (and this was before he really tweaked anything or prelinked. In fact he uses my same use and cflags.) but then again he's on reiser4. Then again I also know someone else who has reiser4 but is on the 250gig version of my SATA drive and even has the same controlle as I do and he gets about my results. Seems like an i/o thing rather than the filesystem. Maybe the libata driver just hasn't been as thoroughly optimized yet as the ata drivers. If I can I'll find out from him how long it takes for his drive to emerge sync. Maybe I'll run iozone too. I'm going to check out this https://forums.gentoo.org/viewtopic-t-135902-highlight-sata+benchmarks.html SATA performance thread and see if mine is performing on average or what.

----------

## floam

Syncing is hardly dependant upon your harddrive. It uses rsync! It's CPU bound. It compares everything.

----------

## DGolem

Yeah for the caching part at the end since it owns my CPU but the scanning for files part (after it fetches the file list) should be pretty hdd bound right? I mean it hardly touches the CPU. But yeah, it's not going to be the most accurate benchmark. Doesn't matter though because I went ahead and ran a few programs actually meant for hdd benchmarking. You can see the results in this thread: https://forums.gentoo.org/viewtopic-p-2240477.html#2240477

----------

## floam

Anyways, stop running the old SATA, it's going to be removed soon! Either learn to live without, or apply the patch.

----------

