# hparm and DMA

## Acka

Went through the forums and found similar problems to mine when I try to do:

# hdparm -d1 /dev/hda

/dev/hda:

 setting using_dma to 1 (on)

 HDIO_SET_DMA failed: Operation not permitted

 using_dma    =  0 (off)

My mobo chipset is a SiS 645DX

Using kernel 2.6.1

I already did the following:

```

# cd /usr/src/linux && make menuconfig

Device Drivers --->

ATA/ATAPI/MFM/RLL support --->

<*>Echanced IDE/MFM/RLL disk/cdrom/tape/floppy support

[*]Generic PCI IDE Chipset Support

[*]Generic PCI bus-master DMA support

[*]Use PCI DMA by default when available

<*>SiS5513 chipset support

```

# lspci | grep IDE

```

00:02.5 IDE interface: Silicon Integrated Systems [SiS] 5513 [IDE]

```

#dmesg

```

Linux version 2.6.1-gentoo (root@blah) (gcc version 3.2.3 20030422 (Gentoo Linux 1.4 3.2.3-r3, propolice)) #2 SMP Sat Feb 7 18:28:34 GMT 2004

BIOS-provided physical RAM map:

 BIOS-e820: 0000000000000000 - 000000000009f400 (usable)

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

 BIOS-e820: 00000000000d0000 - 00000000000d8000 (reserved)

 BIOS-e820: 00000000000e4000 - 0000000000100000 (reserved)

 BIOS-e820: 0000000000100000 - 000000000fdf0000 (usable)

 BIOS-e820: 000000000fdf0000 - 000000000fdff000 (ACPI data)

 BIOS-e820: 000000000fdff000 - 000000000fe00000 (ACPI NVS)

 BIOS-e820: 000000000fe00000 - 0000000010000000 (reserved)

 BIOS-e820: 00000000fff00000 - 0000000100000000 (reserved)

253MB LOWMEM available.

On node 0 totalpages: 65008

  DMA zone: 4096 pages, LIFO batch:1

  Normal zone: 60912 pages, LIFO batch:14

  HighMem zone: 0 pages, LIFO batch:1

DMI 2.3 present.

ACPI: RSDP (v000 PTLTD                                     ) @ 0x000f6f00

ACPI: RSDT (v001 PTLTD    RSDT   0x06040000  LTP 0x00000000) @ 0x0fdfa178

ACPI: FADT (v001 SiS    M650     0x06040000 PTL  0x000f4240) @ 0x0fdfef64

ACPI: BOOT (v001 PTLTD  $SBFTBL$ 0x06040000  LTP 0x00000001) @ 0x0fdfefd8

ACPI: DSDT (v001 PTLTD       635 0x06040000 MSFT 0x0100000e) @ 0x00000000

Building zonelist for node : 0

Kernel command line: root=/dev/hda3

No local APIC present or hardware disabled

Initializing CPU#0

PID hash table entries: 1024 (order 10: 8192 bytes)

Detected 1992.855 MHz processor.

Using tsc for high-res timesource

Console: colour VGA+ 80x25

Memory: 252312k/260032k available (2753k kernel code, 6988k reserved, 1003k data, 168k init, 0k highmem)

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

Calibrating delay loop... 3932.16 BogoMIPS

Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)

Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)

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

CPU:     After generic identify, caps: 3febf9ff 00000000 00000000 00000000

CPU:     After vendor identify, caps: 3febf9ff 00000000 00000000 00000000

CPU: Trace cache: 12K uops, L1 D cache: 8K

CPU: L2 cache: 512K

CPU: Hyper-Threading is disabled

CPU:     After all inits, caps: 3febf9ff 00000000 00000000 00000080

Intel machine check architecture supported.

Intel machine check reporting enabled on CPU#0.

CPU#0: Intel P4/Xeon Extended MCE MSRs (12) available

CPU#0: Thermal monitoring enabled

Enabling fast FPU save and restore... done.

Enabling unmasked SIMD FPU exception support... done.

Checking 'hlt' instruction... OK.

POSIX conformance testing by UNIFIX

CPU0: Intel(R) Pentium(R) 4 CPU 2.00GHz stepping 04

per-CPU timeslice cutoff: 1463.37 usecs.

task migration cache decay timeout: 2 msecs.

SMP motherboard not detected.

Local APIC not detected. Using dummy APIC emulation.

Starting migration thread for cpu 0

CPUS done 8

NET: Registered protocol family 16

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

PCI: Using configuration type 1

mtrr: v2.0 (20020519)

ACPI: Subsystem revision 20031203

ACPI: IRQ11 SCI: Edge set to Level Trigger.

ACPI: Interpreter enabled

ACPI: Using PIC for interrupt routing

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

PCI: Probing PCI hardware (bus 00)

Uncovering SIS962 that hid as a SIS503 (compatible=1)

Enabling SiS 96x SMBus.

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

ACPI: PCI Interrupt Link [LNKA] (IRQs 10)

ACPI: PCI Interrupt Link [LNKB] (IRQs *10)

ACPI: PCI Interrupt Link [LNKC] (IRQs *5)

ACPI: PCI Interrupt Link [LNKD] (IRQs 5)

ACPI: PCI Interrupt Link [LNKE] (IRQs *5)

ACPI: PCI Interrupt Link [LNKF] (IRQs *5)

ACPI: PCI Interrupt Link [LNKG] (IRQs *5)

ACPI: PCI Interrupt Link [LNKH] (IRQs 5)

ACPI: Power Resource [FN10] (off)

ACPI: Power Resource [FN11] (off)

Linux Plug and Play Support v0.97 (c) Adam Belay

SCSI subsystem initialized

drivers/usb/core/usb.c: registered new driver usbfs

drivers/usb/core/usb.c: registered new driver hub

ACPI: PCI Interrupt Link [LNKB] enabled at IRQ 10

ACPI: PCI Interrupt Link [LNKA] enabled at IRQ 9

ACPI: PCI Interrupt Link [LNKC] enabled at IRQ 5

ACPI: PCI Interrupt Link [LNKE] enabled at IRQ 5

ACPI: PCI Interrupt Link [LNKF] enabled at IRQ 5

ACPI: PCI Interrupt Link [LNKG] enabled at IRQ 5

ACPI: PCI Interrupt Link [LNKH] enabled at IRQ 5

PCI: Using ACPI for IRQ routing

PCI: if you experience problems, try using option 'pci=noacpi' or even 'acpi=off'

SBF: Simple Boot Flag extension found and enabled.

SBF: Setting boot flags 0x1

Machine check exception polling timer started.

devfs: v1.22 (20021013) Richard Gooch (rgooch@atnf.csiro.au)

devfs: boot_options: 0x1

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

udf: registering filesystem

ACPI: AC Adapter [ACAD] (on-line)

ACPI: Battery Slot [BAT0] (battery present)

ACPI: Power Button (FF) [PWRF]

ACPI: Lid Switch [LID]

ACPI: Fan [FN1] (off)

ACPI: Fan [FN2] (off)

ACPI: Processor [CPU0] (supports C1 C2, 8 throttling states)

ACPI: Thermal Zone [THRM] (54 C)

pty: 256 Unix98 ptys configured

request_module: failed /sbin/modprobe -- parport_lowlevel. error = -16

lp: driver loaded but no devices found

Linux agpgart interface v0.100 (c) Dave Jones

[drm:drm_init] *ERROR* Cannot initialize the agpgart module.

Serial: 8250/16550 driver $Revision: 1.90 $ 8 ports, IRQ sharing disabled

ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A

ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A

parport0: PC-style at 0x378 [PCSPP(,...)]

lp0: using parport0 (polling).

Using anticipatory io scheduler

floppy0: no floppy controllers found

8139too Fast Ethernet driver 0.9.26

PCI: Enabling device 0000:00:08.0 (0000 -> 0003)

eth0: RealTek RTL8139 at 0xd080a000, 00:40:ca:ba:fc:93, IRQ 10

eth0:  Identified 8139 chip type 'RTL-8100B/8139D'

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

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

hda: HITACHI_DK23CA-30, ATA DISK drive

hdc: QSI CD-RW/DVD-ROM SBW-161, ATAPI CD/DVD-ROM drive

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

ide1 at 0x170-0x177,0x376 on irq 15

hda: max request size: 128KiB

hda: 58605120 sectors (30005 MB) w/2048KiB Cache, CHS=58140/16/63

 /dev/ide/host0/bus0/target0/lun0: p1 p2 p3

hdc: ATAPI 24X DVD-ROM CD-R/RW drive, 2048kB Cache

Uniform CD-ROM driver Revision: 3.12

ohci1394: $Rev$ Ben Collins <bcollins@debian.org>

PCI: Enabling device 0000:00:0d.0 (0010 -> 0012)

ohci1394: fw-host0: Unexpected PCI resource length of 1000!

ohci1394: fw-host0: OHCI-1394 1.0 (PCI): IRQ=[9]  MMIO=[e0005000-e00057ff]  Max Packet=[2048]

PCI: Enabling device 0000:00:03.3 (0000 -> 0002)

ehci_hcd 0000:00:03.3: EHCI Host Controller

ehci_hcd 0000:00:03.3: irq 5, pci mem d0812000

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

PCI: cache line size of 128 is not supported by device 0000:00:03.3

ehci_hcd 0000:00:03.3: USB 2.0 enabled, EHCI 1.00, driver 2003-Jun-13

hub 1-0:1.0: USB hub found

hub 1-0:1.0: 6 ports detected

drivers/usb/host/uhci-hcd.c: USB Universal Host Controller Interface driver v2.1

drivers/usb/core/usb.c: registered new driver usblp

drivers/usb/class/usblp.c: v0.13: USB Printer Device Class driver

Initializing USB Mass Storage driver...

drivers/usb/core/usb.c: registered new driver usb-storage

USB Mass Storage support registered.

drivers/usb/core/usb.c: registered new driver hid

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

mice: PS/2 mouse device common for all mice

i8042.c: Detected active multiplexing controller, rev 1.1.

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

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

input: ImExPS/2 Logitech Explorer Mouse on isa0060/serio2

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

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

Synaptics Touchpad, model: 1

 Firmware: 5.6

 180 degree mounted touchpad

 Sensor: 18

 new absolute packet format

 Touchpad has extended capability bits

 -> four buttons

 -> multifinger detection

 -> palm detection

input: SynPS/2 Synaptics TouchPad on isa0060/serio4

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

input: AT Translated Set 2 keyboard on isa0060/serio0

Advanced Linux Sound Architecture Driver Version 1.0.0rc2.

request_module: failed /sbin/modprobe -- snd-card-0. error = -16

PCI: Enabling device 0000:00:02.7 (0000 -> 0001)

hub 1-0:1.0: new USB device on port 3, assigned address 2

ieee1394: Host added: ID:BUS[0-00:1023]  GUID[0040ca0111004495]

scsi0 : SCSI emulation for USB Mass Storage devices

  Vendor: Maxtor 2  Model: F040L0            Rev:  0 0

  Type:   Direct-Access                      ANSI SCSI revision: 02

SCSI device sda: 80293248 512-byte hdwr sectors (41110 MB)

sda: assuming drive cache: write through

 /dev/scsi/host0/bus0/target0/lun0: p1

Attached 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

WARNING: USB Mass Storage data integrity not assured

USB Mass Storage device found at 2

intel8x0: clocking to 48000

ALSA device list:

  #0: SiS SI7012 at 0x1400, irq 5

NET: Registered protocol family 2

IP: routing cache hash table of 2048 buckets, 16Kbytes

TCP: Hash tables configured (established 16384 bind 16384)

NET: Registered protocol family 1

NET: Registered protocol family 17

ACPI: (supports S0 S3 S4 S5)

found reiserfs format "3.6" with standard journal

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

reiserfs: checking transaction log (hda3) for (hda3)

Using r5 hash to sort names

VFS: Mounted root (reiserfs filesystem) readonly.

Mounted devfs on /dev

Freeing unused kernel memory: 168k freed

Adding 500464k swap on /dev/hda2.  Priority:-1 extents:1

eth0: link up, 100Mbps, full-duplex, lpa 0x41E1

atkbd.c: Unknown key released (translated set 2, code 0x7a on isa0060/serio0).

atkbd.c: Unknown key released (translated set 2, code 0x7a on isa0060/serio0).

spurious 8259A interrupt: IRQ7.

```

Any feedback will be appreciated.

----------

## jimhend~1

are u sure ur lilo.conf doesnt have any kernel parameters that may be disabling it?

what does hdparm -tT /dev/hda show?

----------

## manywele

When both my friend and I were having UDMA problems it turned out (after much searching and head scratching) that my IDE cable was installed backwards and his was too long.  Changing the cables fixed it for both of us.  Just a thought...something else to check.

----------

## ColinAnderson

I had this problem, and it turns out I had disabled a kernel configuration parameter that's needed for the Pentium 4 chipset.  I re-enabled this and it works like a charm.

Quoted by adaptr from this thread: https://forums.gentoo.org/viewtopic.php?t=126742

 *Quote:*   

> ... An Intel-chipset mainboard, for example, will always use the Intel PIIX4 IDE controller, called PIIX in the kernel config ...

 

Enable that and try your luck -- it worked for me.   :Smile: 

----------

## Taucha

Hey there.

I have the folling Problem. 

# hdparm -d1 /dev/hda 

/dev/hda: 

setting using_dma to 1 (on) 

HDIO_SET_DMA failed: Operation not permitted 

using_dma = 0 (off) 

(so it's like Acka's prob)

I have 2 equal hd's hda and hdh.

hdh is running on a promise UDMA Controler and hda on the onboardcontroler. 

by trying to turn the dma mode on on hda i got the errormessage above.

But ... when i change my hda with an other harddisk (other modell) the dma is on when i boot my system with this hd. 

It's now confusing, why the controler enables dma on one disk, and not on the other. 

Has anyone a solution?

----------

## Acka

jimhend~1 not using Lilo. Using Grub and dont see anything in Grub thats telling my HD or system to switch DMA off.

manywele Im on a laptop   :Wink: 

----------

## Acka

ColinAnderson

 *Quote:*   

> 
> 
> ... An Intel-chipset mainboard, for example, will always use the Intel PIIX4 IDE controller, called PIIX in the kernel config ...

 

I think that means that if you are using an Intel chipset, then enable PIIX4 support. I dont think this has anything to do with your Pentium 4 processor   :Smile: 

----------

## Taucha

i found my problem.

my bios seems to be rather old.

my small hd has been correctly identified by the bios. but not the new hd.

dma is working with the small hd and it works with my new hd's when i attach them to my raid / UDMA Controler. 

thx guys.

Taucha

----------

## ColinAnderson

What does it matter?  It DOESN'T.  He has an Intel chip -- therefore an Intel-based chipset.  If he doesn't have that parameter installed in the kernel, that might be his problem.  That was my problem, I enabled it, now DMA is working.  It might be worth a try.  :-\

----------

## Acka

Anyone provide a solution here??   :Confused: 

----------

## Taucha

perhaps its "just" your bios.

that is my problem. it's to old and doesn't provide dma on my hd   :Sad: 

T.

----------

## Acka

I used Gentoo before during the summer. I was able to get DMA running on my laptop. Maybe its just 2.6.1 or the way I moved from 2.4.2 to 2.6.1.

----------

## pharaoh

All my DMA problems were solved once I compiled the correct chipset driver into the kernel.  But now how would I set the default to ATA100 ?  The man page is confusing abou the -X setting.

----------

## Acka

 *pharaoh wrote:*   

> All my DMA problems were solved once I compiled the correct chipset driver into the kernel.  But now how would I set the default to ATA100 ?  The man page is confusing abou the -X setting.

 

Can you tell me where you went in menuconfig to enable appropriate chipset?

----------

## pharaoh

 *Quote:*   

> Can you tell me where you went in menuconfig to enable appropriate chipset?

 

using 2.6.2-rc2-mm1, but that shouldn't matter...

Device Drivers  --->  ATA/ATAPI/MFM/RLL support  --->

Scroll halfway down that list and you start seeing all the chipsets.  You need to find out which one you need to enable...I have an Abit board and I found the chipset listed in the board's manual on one of the first pages, and also on their website when I looked up the board.

----------

## Acka

Yep found it, unfortunately Im my mobo is using a SIS chipset, to be more specific a SiS645DX.

Its already built in with the <*> SiS5513 chipset support and I also have the following 

[*] Use PCI DMA by default when available

Still no DMA   :Confused: 

----------

## pharaoh

Yeah I do see your chipset under that SiS so it is the right one.  So you're running this kernel and you set the hdparm flags and you still get the error??

----------

## Acka

Yep:

```

# hdparm -d1 /dev/hda

/dev/hda:

 setting using_dma to 1 (on)

 HDIO_SET_DMA failed: Operation not permitted

 using_dma    =  0 (off)

```

Might have something to do with ACPI

----------

## pharaoh

Sorry bro, I'm way too much of a newb to help you on this  =\   All I know is that procedure fixed me up real nice.  Good luck man   :Very Happy: 

----------

## Quen

I've had this problem as well, and just recently figured out how to fix it.

If the dma options are all set in your kernel and you have the right chipset selected, then the problem might be that you have the reiserfs debug option selected in the file systems section of your kernel.  Doing this disables your DMA (among other things).  The official word from namesys.com is that you should only use the debug option if you're on the verge of sending a bug report for the file system itself.

Hope this helps.

----------

## thorne

THANKS! All this time I thought I had problems with alsa and arts, but as it turns out, I never enabled my chipset in the kernel.  DMA is now enabled and my system is rockin' with 2.6.3_rc2 ...

 :Very Happy: 

----------

