Testing CAM wrapper for ata(4) controller drivers

Alexander Motin mav at FreeBSD.org
Fri Dec 4 10:01:03 UTC 2009

Goran Lowkrantz wrote:
> Tested on a ASUSTeK M2N-VM DVI with good results. Only problem found was
> with a CF card in a SATA-CF adapter. It lies that it can handle DMA but
> fails miserably. Searched the web but could find no way to disable DMA
> when using CAM-ATA.

I have also seen problems with DMA on SATA-CF adapters. What's
interesting is that same cards in PATA-CF adapter are working fine. Will
try them more.

Generally modes can be controlled via `camcontrol negotiate ...`.
To change SATA connection speed (in addition to driver hints) you may do:
camcontrol negotiate ada0 -U -R 1500
camcontrol reset X
camcontrol rescan X
camcontrol negotiate ada0
To change PATA mode you may do now:
camcontrol negotiate ada0 -U -M WDMA0
camcontrol rescan X
camcontrol negotiate ada0
But now it is impossible to switch between PIO and DMA PATA modes after
device was probed. This part is to be implemented yet.

> Here is the inital rescan result after attaching it and the timeout when
> doing an identify:
> (aprobe0:ahcich0:0:0:0): SIGNATURE: 0000
> ada2 at ahcich0 bus 0 scbus2 target 0 lun 0
> ada2: <SanDisk SDCFX-1024 HDX 3.17> ATA/ATAPI-4 device
> ada2: 150.000MB/s transfers (SATA 1.x, PIO4, PIO size 2048bytes)

It reported itself as working in PIO mode ^^^. It is some different case.

> ada2: 977MB (2001888 512 byte sectors: 16H 63S/T 1986C)
> (aprobe0:ahcich1:0:15:0): SIGNATURE: 0000
> (aprobe0:ahcich2:0:15:0): SIGNATURE: 0000
> ahcich0: Timeout on slot 0
> ahcich0: is 00000000 cs 00000001 ss 00000000 rs 00000001 tfd d0 serr
> 00000000

Looks like card doesn't dropped BUSY flag (tfd d0). Or SATA adapter
haven't translated it properly.

> # camcontrol readcap ada2
> (pass5:ahcich0:0:0:0): READ CAPACITY(10). CDB: 25 0 0 0 0 0 0 0 0 0
> (pass5:ahcich0:0:0:0): CAM Status: Unconditionally Re-queue Request

readcap uses SCSI command to read capacity. It won't work for ATA
devices, only for ATAPI.


Alexander Motin

More information about the freebsd-current mailing list