# New SATA/IDE Drivers and DMA

## Kenji Miyamoto

How could I get these new drivers to work with DMA?  They claim that it is disabled when I run fsck, and hdparm doesn't do anything.

----------

## desultory

Do you have chipset appropriate modules built in to the kernel?

----------

## Kenji Miyamoto

Under the new drivers, yes, but not under the old drivers.

----------

## cyrillic

 *Kenji Miyamoto wrote:*   

> They claim that it is disabled when I run fsck, and hdparm doesn't do anything.

 

What does dmesg have to say when the harddrive gets detected ?

Mine looks like this :

```
# dmesg | less

...

sata_sil 0000:01:0d.0: version 2.0

ACPI: PCI Interrupt Link [APC3] enabled at IRQ 18

ACPI: PCI Interrupt 0000:01:0d.0[A] -> Link [APC3] -> GSI 18 (level, high) -> IRQ 17

ata1: SATA max UDMA/100 cmd 0xF8802080 ctl 0xF880208A bmdma 0xF8802000 irq 17

ata2: SATA max UDMA/100 cmd 0xF88020C0 ctl 0xF88020CA bmdma 0xF8802008 irq 17

scsi0 : sata_sil

ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 310)

ata1.00: ATA-6, max UDMA/100, 625142448 sectors: LBA48 

ata1.00: ata1: dev 0 multi count 16

ata1.00: configured for UDMA/100

scsi 0:0:0:0: Direct-Access     ATA      WDC WD3200JD-22K 08.0 PQ: 0 ANSI: 5

SCSI device sda: 625142448 512-byte hdwr sectors (320073 MB)

sda: Write Protect is off

sda: Mode Sense: 00 3a 00 00

SCSI device sda: write cache: enabled, read cache: enabled, doesn't support DPO or FUA

 sda:

sd 0:0:0:0: Attached scsi disk sda

sd 0:0:0:0: Attached scsi generic sg0 type 0 
```

----------

## Kenji Miyamoto

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

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...

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

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

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

Uniform CD-ROM driver Revision: 3.20

ide-floppy driver 0.99.newide

Loading iSCSI transport class v2.0-724.<7>ata_piix 0000:00:1f.2: version 2.00ac6

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

ACPI: PCI Interrupt 0000:00:1f.2[B] -> GSI 19 (level, low) -> IRQ 19

ata: 0x170 IDE port busy

ata: conflict with ide1

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

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

ata2: DUMMY

scsi0 : ata_piix

ata1.00: ATA-6, max UDMA/100, 156301488 sectors: LBA48 NCQ (depth 0/32)

ata1.00: ata1: dev 0 multi count 16

ata1.00: configured for UDMA/100

scsi1 : ata_piix

scsi 0:0:0:0: Direct-Access     ATA      TOSHIBA MK8032GS AS11 PQ: 0 ANSI: 5

SCSI device sda: 156301488 512-byte hdwr sectors (80026 MB)

sda: Write Protect is off

sda: Mode Sense: 00 3a 00 00

SCSI device sda: drive cache: write back

SCSI device sda: 156301488 512-byte hdwr sectors (80026 MB)

sda: Write Protect is off

sda: Mode Sense: 00 3a 00 00

SCSI device sda: drive cache: write back

 sda: sda1 sda2 sda3 sda4

sd 0:0:0:0: Attached scsi disk sda

sd 0:0:0:0: Attached scsi generic sg0 type 0
```

----------

## Kenji Miyamoto

Does nobody see what the problem is?

```
/dev/sda:

 IO_support   =  0 (default 16-bit)

 readonly     =  0 (off)

 readahead    = 256 (on)

 geometry     = 9729/255/63, sectors = 156301488, start = 0

/dev/hdc:

 IO_support   =  1 (32-bit)

 unmaskirq    =  0 (off)

 using_dma    =  0 (off)

 keepsettings =  0 (off)

 readonly     =  0 (off)

 readahead    = 256 (on)

 HDIO_GETGEO failed: Inappropriate ioctl for device
```

It looks like the ATA DVD drive is at least doing something properly.

----------

## cyrillic

 *Kenji Miyamoto wrote:*   

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

 

You need to get rid of the (older) IDE drivers if you want to use the (newer) libata SCSI drivers, or vice-versa.

----------

## Kenji Miyamoto

Unfortunately, I still don't get DMA support, at least according to hdparm.  It's the same on another computer with the same PATA host controller, but with the main drives (sda and sdb, previously hda and hdc) on it, not only the CD-ROM.

----------

## rapsure

DMA is done automatically with the new libata drivers for the pata devices. DMA can not be set with hdparm or any other utility when the device is managed with the new libata drivers. The new drivers automatically configure the devices for the highest speed of communication that the device supports which includes DMA transfers. To find out what the device as been configured for check the kernel messages.

----------

## depontius

 *rapsure wrote:*   

> DMA is done automatically with the new libata drivers for the pata devices. DMA can not be set with hdparm or any other utility when the device is managed with the new libata drivers. The new drivers automatically configure the devices for the highest speed of communication that the device supports which includes DMA transfers. To find out what the device as been configured for check the kernel messages.

 

I just tried out libata on my laptop with the new 2.6.19-gentoo-r5 kernel. It seems to work well, so far. Switching partitions to use device labels instead of /dev names certainly helps things along, and makes it possible to go back. I have smartd working, changing to /dev/sda with the "-d ata" flag, and get results from "hdparm -I /dev/sda", but not "hdparm -i /dev/sda", and haven't tried other stuff yet.

Anyone have any idea when hdparm will be fully enabled under libata/pata?

----------

