# no DMA for my laptop DVD

## maestax

Hi to this great community by a noob....

Well, could anyone help me with this please???

I have an asus laptop, Z53J (mb is the same as F3JP). As soon as i bought it, i formatted it and put Gentoo linux. I am very happy to be able to do all my work without the need of windows. Most things work as expected but i have a problem that really annoys me. The optical drive of this laptop (dvd+-rw) is working without DMA support. This causes a lot of cpu usage, very slow writing speeds etc etc. The thing is that the drive supports DMA in windows so it is a software(?), configuration problem?

My system:

Gentoo linux - kernel 2.6.21.r4

```

lspci 

00:00.0 Host bridge: Intel Corporation Mobile 945GM/PM/GMS, 943/940GML and 945GT Express Memory Controller Hub (rev 03)

00:01.0 PCI bridge: Intel Corporation Mobile 945GM/PM/GMS, 943/940GML and 945GT Express PCI Express Root Port (rev 03)

00:1b.0 Audio device: Intel Corporation 82801G (ICH7 Family) High Definition Audio Controller (rev 02)

00:1c.0 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 1 (rev 02)

00:1c.1 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 2 (rev 02)

00:1c.2 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 3 (rev 02)

00:1d.0 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #1 (rev 02)

00:1d.1 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #2 (rev 02)

00:1d.2 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #3 (rev 02)

00:1d.3 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #4 (rev 02)

00:1d.7 USB Controller: Intel Corporation 82801G (ICH7 Family) USB2 EHCI Controller (rev 02)

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

00:1f.0 ISA bridge: Intel Corporation 82801GBM (ICH7-M) LPC Interface Bridge (rev 02)

00:1f.2 IDE interface: Intel Corporation 82801GBM/GHM (ICH7 Family) SATA IDE Controller (rev 02)

00:1f.3 SMBus: Intel Corporation 82801G (ICH7 Family) SMBus Controller (rev 02)

01:00.0 VGA compatible controller: ATI Technologies Inc M66-P [Mobility Radeon X1700]

02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 01)

03:00.0 Network controller: Intel Corporation PRO/Wireless 3945ABG Network Connection (rev 02)

06:01.0 FireWire (IEEE 1394): Ricoh Co Ltd R5C832 IEEE 1394 Controller

06:01.1 Class 0805: Ricoh Co Ltd R5C822 SD/SDIO/MMC/MS/MSPro Host Adapter (rev 19)

06:01.2 System peripheral: Ricoh Co Ltd Unknown device 0843 (rev 01)

06:01.3 System peripheral: Ricoh Co Ltd R5C592 Memory Stick Bus Host Adapter (rev 0a)

```

The hard disk is a SATA and could you please tell me if its speed is normal or if it is low?

```

hdparm -tT /dev/sda 

/dev/sda: 

Timing cached reads: 1712 MB in 2.00 seconds = 856.47 MB/sec 

Timing buffered disk reads: 114 MB in 3.04 seconds = 37.45 MB/sec

```

Continuing with the DVD drive

```

hdparm -tT /dev/hdc 

/dev/hdc:

Timing cached reads: 1890 MB in 2.00 seconds = 944.92 MB/sec BLKFLSBUF failed: Function not implemented Timing buffered disk reads: 6 MB in 3.38 seconds = 1.77 MB/sec BLKFLSBUF failed: Function not implemented

```

Other useful(?) information

```

dmesg | grep ide 

BIOS-provided physical RAM map:

ACPI: IRQ0 used by override.

ACPI: IRQ2 used by override.

ACPI: IRQ9 used by override.

CPU: After generic identify, caps: bfebfbff 20100000 00000000 00000000 0000e3bd 00000000 00000001

CPU: After generic identify, caps: bfebfbff 20100000 00000000 00000000 0000e3bd 00000000 00000001

Boot video device is 0000:01:00.0

ACPI: Video Device [VGA] (multi-head: yes  rom: no  post: no)

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

ide0: I/O resource 0x1F0-0x1F7 not free.

ide0: ports already in use, skipping probe

Probing IDE interface ide1...

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

ata: conflict with ide1

```

```

dmesg | grep IDE 

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

Probing IDE interface ide1...

ata_piix 0000:00:1f.2: MAP [ P0 P2 IDE IDE ]

ata: 0x170 IDE port busy

```

In the kernel i have enabled the "Generic PCI bus-master DMA support"

```

hdparm /dev/hdc

/dev/hdc:

 IO_support    =  0 (default 16-bit)

 unmaskirq     =  0 (off)

 using_dma     =  0 (off)

 keepsettings  =  0 (off)

 readonly      =  0 (off)

 readahead     = 256 (on)

 HDIO_GETGEO failed: Inappropriate ioctl for device

```

```

hdparm -d1 /dev/hdc

/dev/hdc:

 setting using_dma to 1 (on)

 HDIO_SET_DMA failed: Operation not permitted

 using_dma     =  0 (off)

```

Could anyone please tell me what am i doing wrong???

What other configurations should i make?

----------

## mikkoc

You got the same problem of many other people with a laptop...

There are 2 solutions I know of:

1) append this to grub or lilo.conf:

```
libata.atapi_enabled=1 combined_mode=libata pci=routeirq
```

2) recompile the kernel like this howto shows: http://gentoo-wiki.com/HARDWARE_Dell_Inspiron_6400_Fixes_for_common_problems

(the site is currently down I think)

 *Quote:*   

> Optical Drive slow and gives various issues
> 
> This problem occurs if you have you configured your Optical Drive as PATA Device.
> 
> 1. Go to /usr/src/linux
> ...

 

----------

## maestax

thanks a lot!

i' ll try it as soon as i get home and i' ll post the results!

----------

## tarpman

I have an F3JM, which should have the same motherboard.  What you want to do is remove entirely support for IDE from your kernel, and use instead the new libata interface.  If you enable Intel MPIIX PATA support under the libata config, your DVD drive will become /dev/sr0 instead of /dev/hdc, and DMA will be enabled.

----------

## maestax

Well,

i disabled all IDE references from the kernel and i enabled Intel MPIIX PATA support. As you have mentioned, my dvd is now /dev/sr0.

the command hdparm gives now

```
hdparm -tT /dev/sr0

/dev/sr0:

 Timing cached reads:   2012 MB in  2.00 seconds = 1006.54 MB/sec

 Timing buffered disk reads:    6 MB in  3.37 seconds =   1.78 MB/sec

```

how is this? isn't it very low?

Thanks for the help!  :Smile: 

Also,

```
hdparm /dev/sr0

/dev/sr0:

 IO_support    =  0 (default 16-bit)

 readonly      =  0 (off)

 readahead     = 256 (on)

 HDIO_GETGEO failed: Inappropriate ioctl for device

```

is this a problem?

Thanks!

----------

## maestax

Thank you very much!!!

I can now burn at the desired speeds!

Problem solved!

----------

## pv23083

 *maestax wrote:*   

> Thank you very much!!!
> 
> I can now burn at the desired speeds!
> 
> Problem solved!

 

How did you solve it? I did the same as you and I get the same output from hdparm, but the drive is slower. Did you do anything else?

----------

## bourane

So am I, i have tried many thinks but DMA still do not work.

i have got ich7 chipset on my laptop and i think my hard disk is a sata drive and my dvdwriter is an ide drive

here some log of my configuration (now i use the same)

the kernel output :

```
thor(15:15:45) /home/thomas # dmesg | grep ata     

Command line: root=/dev/sda6 video=vesafb vga=792 libata.atapi_enabled=1 ide1=noprobe

libata version 2.20 loaded.

ata_piix 0000:00:1f.2: version 2.10ac1

ata_piix 0000:00:1f.2: MAP [ P0 P2 IDE IDE ]

ata1: SATA max UDMA/133 cmd 0x00000000000101f0 ctl 0x00000000000103f6 bmdma 0x00000000000118b0 irq 14

ata2: PATA max UDMA/100 cmd 0x0000000000010170 ctl 0x0000000000010376 bmdma 0x00000000000118b8 irq 15

scsi0 : ata_piix

ata1.00: ATA-7: TOSHIBA MK1234GSX, AH001H, max UDMA/100

ata1.00: 234441648 sectors, multi 16: LBA48 

ata1.00: configured for UDMA/100

scsi1 : ata_piix

ata2.00: ATAPI, max MWDMA2

ata2.00: configured for MWDMA2

```

IDE controler :

```
thor(15:20:34) /home/thomas # lspci | grep ATA

00:1f.2 IDE interface: Intel Corporation 82801GBM/GHM (ICH7 Family) Serial ATA Storage Controller IDE (rev 02)

```

lshw:

```
        *-ide

             description: IDE interface

             product: 82801GBM/GHM (ICH7 Family) Serial ATA Storage Controller IDE

             vendor: Intel Corporation

             physical id: 1f.2

             bus info: pci@0000:00:1f.2

             logical name: scsi0

             logical name: scsi1

             version: 02

             width: 32 bits

             clock: 66MHz

             capabilities: ide pm bus_master cap_list emulated

             configuration: driver=ata_piix latency=0

           *-disk

                description: SCSI Disk

                product: TOSHIBA MK1234GS

                vendor: ATA

                physical id: 0

                bus info: scsi@0:0.0.0

                logical name: /dev/sda

                version: AH00

                serial: Y6CJF7ONS

                size: 111GB

                capabilities: partitioned partitioned:dos

                configuration: ansiversion=5

[...]

           *-cdrom

                description: DVD-RAM writer

                product: DVD-RAM SDVD8821

                vendor: PHILIPS

                physical id: 1

                bus info: scsi@1:0.0.0

                logical name: /dev/cdrom2

                logical name: /dev/dvd2

                logical name: /dev/sr0

                version: EH19

                capabilities: removable audio cd-r cd-rw dvd dvd-r dvd-ram

                configuration: ansiversion=5 status=ready

              *-disc

                   physical id: 0

                   logical name: /dev/cdrom2

```

hdparm :

```
thor(15:20:44) /home/thomas # hdparm -i /dev/sr0 

/dev/sr0:

 Model=PHILIPS DVD-RAM SDVD8821                , FwRev=EH19    , SerialNo=                    

 Config={ Fixed Removeable DTR<=5Mbs DTR>10Mbs nonMagnetic }

 RawCHS=0/0/0, TrkSize=0, SectSize=0, ECCbytes=0

 BuffType=unknown, BuffSize=0kB, MaxMultSect=0

 (maybe): CurCHS=0/0/0, CurSects=0, LBA=yes, LBAsects=0

 IORDY=yes, tPIO={min:383,w/IORDY:120}, tDMA={min:120,rec:120}

 PIO modes:  pio0 pio1 pio2 pio3 pio4 

 DMA modes:  mdma0 mdma1 *mdma2 

 AdvancedPM=no

 Drive conforms to: unknown:  ATA/ATAPI-3 ATA/ATAPI-4 ATA/ATAPI-5 ATA/ATAPI-6 ATA/ATAPI-7

 * signifies the current active mode

thor(15:24:44) /home/thomas # hdparm /dev/sr0 

/dev/sr0:

 IO_support   =  0 (default 16-bit)

 readonly     =  0 (off)

 readahead    = 256 (on)

 HDIO_GETGEO failed: Inappropriate ioctl for device

thor(15:21:45) /home/thomas # hdparm -d1 /dev/sr0 

/dev/sr0:

 setting using_dma to 1 (on)

 HDIO_SET_DMA failed: Inappropriate ioctl for device

```

the test:

```
thor(15:24:10) /home/thomas # hdparm -tT /dev/sr0 && hdparm -tT /dev/sda

/dev/sr0:

 Timing cached reads:   3980 MB in  2.00 seconds = 1990.11 MB/sec

 Timing buffered disk reads:   14 MB in  3.12 seconds =   4.48 MB/sec

/dev/sda:

 Timing cached reads:   3956 MB in  2.00 seconds = 1977.81 MB/sec

 Timing buffered disk reads:  104 MB in  3.02 seconds =  34.47 MB/sec

```

the last time that i tried to burn a dvd, it takes about an hour and the buffer was empty --> the device can't burn media !

please help !

----------

## bourane

i've got it !

if you can blank a cdrw using "cdrecord dev=/dev/sr0 blank=all" (replace sr0 by your device) then its a K3B bug.

the device, when emulating scsi is "/dev/sr0", you can see that in the k3b device configuration or find in /dev directory

then you know the device, go to K3B settings -> programs -> user

in the cdrecord line, add the folowing option : "dev=/dev/sr0" (or another device)

with this trick, i can burn and my cd without loading 100% of my cpu   :Very Happy:  , i havent yet tested dvd writing

enjoy,

dont blame me for my english, i'm not yet a UK resident

----------

