# Enable DMA on DVD Drive (SATA) T43P

## Nick W

Hi, 

I've been trying to enable DMA on my DVD drive on a Thinkpad T43P - I've read the ThinkWiki page where it says to edit include/linux/libata.h in the kernel source to define ATA_ENABLE_PATA  but that isnt working. 

I've also read this redhat bug report that suggests defining ATA_ENABLE_ATAPI. So, libata.h now has these 2 lines:

```

define ATA_ENABLE_PATA     /* define to enable PATA support in some

                 * low-level drivers */

#define ATA_ENABLE_ATAPI

```

I tried uncommenting them, but it guess the file has a different syntax as that just gave me errors. 

It has not enabled DMA, and hdparm -d1 /dev/hdc thows back the following error:

```

/dev/hdc:

 setting using_dma to 1 (on)

 HDIO_SET_DMA failed: Operation not permitted

 using_dma    =  0 (off)

```

and i cant find an sdparm equivelant.

Here's the output of lspci

```

00:00.0 Host bridge: Intel Corporation Mobile 915GM/PM/GMS/910GML Express Processor to DRAM Controller (rev 03)

00:01.0 PCI bridge: Intel Corporation Mobile 915GM/PM Express PCI Express Root Port (rev 03)

00:1c.0 PCI bridge: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) PCI Express Port 1 (rev 03)

00:1c.2 PCI bridge: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) PCI Express Port 3 (rev 03)

00:1d.0 USB Controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB UHCI #1 (rev 03)

00:1d.1 USB Controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB UHCI #2 (rev 03)

00:1d.2 USB Controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB UHCI #3 (rev 03)

00:1d.3 USB Controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB UHCI #4 (rev 03)

00:1d.7 USB Controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB2 EHCI Controller (rev 03)

00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev d3)

00:1e.2 Multimedia audio controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) AC'97 Audio Controller (rev 03)

00:1e.3 Modem: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) AC'97 Modem Controller (rev 03)

00:1f.0 ISA bridge: Intel Corporation 82801FBM (ICH6M) LPC Interface Bridge (rev 03)

00:1f.2 IDE interface: Intel Corporation 82801FBM (ICH6M) SATA Controller (rev 03)

00:1f.3 SMBus: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) SMBus Controller (rev 03)

01:00.0 VGA compatible controller: ATI Technologies Inc M24 1T [FireGL M24 GL] (rev 80)

02:00.0 Ethernet controller: Broadcom Corporation NetXtreme BCM5751M Gigabit Ethernet PCI Express (rev 11)

04:00.0 CardBus bridge: Ricoh Co Ltd RL5c476 II (rev 8d)

04:02.0 Network controller: Intel Corporation PRO/Wireless 2200BG (rev 05)

```

and of dmesg | grep DVD

```

hdc: MATSHITADVD-RAM UJ-822S, ATAPI CD/DVD-ROM drive

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

```

Im using 2.6.14-suspend2-r7 and my kernel config file is here

I can't think of anything more to add  :Smile: 

Can anyone help me?

----------

## widremann

I'm also looking to enable DMA on the DVD for my T43 (and HD as well, although it seems to be going fast enough anyways).

----------

## xbb

did you try to add "libata.atapi_enabled=1" to your kernel boot command line?

----------

## Nick W

No, I didn't. The wiki said that was pretty dangerous......

Q. How do you make sure your hard disk has DMA enabled also?

----------

## Nick W

Just tried the kernel command and unless im doing it wrong, that doesn't work either  :Sad: 

```

title PATA

root (hd0,0)

kernel /boot/kernel-2.6.14-r5.pata resume2=swap:/dev/sda2 libata.atapi_enabled=1

```

Is that right?

----------

## Nick W

OK! I *think* I've got it 

I need someone to help me tell if DMA is enabled though, im not sure how to tell?

This is what dmesg |grep ata brings up:

```

ata_piix version 1.04

ata1: SATA max UDMA/133 cmd 0x1F0 ctl 0x3F6 bmdma 0x18C0 irq 14

ata1: dev 0 cfg 49:0f00 82:746b 83:5be8 84:4003 85:f469 86:1848 87:4003 88:203f

ata1: dev 0 ATA, max UDMA/100, 117210240 sectors:

ata1(0): applying bridge limits

ata1: dev 0 configured for UDMA/100

scsi0 : ata_piix

ata2: SATA max UDMA/133 cmd 0x170 ctl 0x376 bmdma 0x18C8 irq 15

ata2: dev 0 cfg 49:0f00 82:0000 83:0000 84:0000 85:0000 86:0000 87:0000 88:0407

ata2: dev 0 ATAPI, max UDMA/33

ata2(0): applying bridge limits

ata2: dev 0 configured for UDMA/33

scsi1 : ata_piix

ehci_hcd 0000:00:1d.7: unable to enable MWI - not fatal.

ReiserFS: sda3: using ordered data mode

ieee80211: 802.11 data/management/control stack, 1.1.8

```

Is that right?

If there is a better way to tell, please tell me. I cannot use hdparm of course...

thx!

----------

## Nick W

Can anyone tell from that dmesg if DMA is enabled on my DVD drive?

----------

## widremann

 *Nick W wrote:*   

> Can anyone tell from that dmesg if DMA is enabled on my DVD drive?

 

I get pretty much the same thing from dmesg, and it's definitely not enabled for me.  I'm concerned about other messages saying IO ports already in use (for IDE).

----------

## Nick W

How can I TELL if it's enabled if i can't use hdparm?

----------

## widremann

 *Nick W wrote:*   

> How can I TELL if it's enabled if i can't use hdparm?

 

Why can't you use hdparm?  If you mean that it gives you errors when you try to do stuff, then it's probably not enabled.

----------

## Nick W

hdparm doesn't need to be enabled?

This is a SATA drive SCSI (im not good at the terminology but it doesnt run over IDE)... so hdparm gives errors when trying to set the dma...

----------

## Scratalacha

Firstly, hdparm doesn't work properly on SATA devices unless they have the passthru patch enabled. As of 2.6.15 this patch is included in the mainstream kernel. Even with it, you will not be able to enable DMA if you are using the SATA driver as its not fully supported and it cannot be set via IDE drivers because of the SATA bridge. I suggest using the SATA driver with the kernel options "noprobe=/dev/hdc libata.atapi_enabled=1". This has worked fairly well for me as I have a T43p and encountered the same issues. Currently, the SATA support is much faster than the IDE access.

----------

## Nick W

Right, I had the atapi thing in there, but not the noprobe, no i have it, im pretty certain the playback quality is better, thanks! I have IDE disabled entirely on this laptop also. 

So, help me understand this just a bit better please if you have a moment. Is DMA something for IDE drives, and SATA drives do not use it? Am I on a wild goose chase trying to enable DMA on these drives?

thanks!

----------

## Scratalacha

Give this link a look: [url] http://linux.yyz.us/sata/ [/url]

----------

## dsd

libata (i.e. linux SATA) uses DMA out of the box and you don't get to choose otherwise.

----------

## Nick W

Awesome, thanks!

Then if i have IDE disabled in the kernel, i must be  all set  :Smile: 

----------

## chiwi

HI there, I also can't enable DMA for my HDD, but it turns that I don't have SATA on my thinkpad (t42), this is what lspci shows:

00:1f.1 IDE interface: Intel Corporation 82801DBM (ICH4-M) IDE Controller (rev 01)

eventhough I execute 'hdparm -d1 /dev/hda' this messege appears:

```

/dev/hda:

 setting using_dma to 1 (on)

 HDIO_SET_DMA failed: Operation not permitted

 using_dma    =  0 (off)

```

I haven't read anything realted to DMA/disks on the thinkpad/gentoo guides i've read, so i'm kinda lost... =/

any clue anyone?

Thanks..

----------

## chiwi

never mind...i had the wrong driver compiled in the kernel....my fault

Thanks.

----------

