Re: Testing CAM wrapper for ata(4) controller drivers

From: Bernd Walter <ticso_at_cicely7.cicely.de>
Date: Tue, 8 Dec 2009 15:00:31 +0100
On Fri, Dec 04, 2009 at 12:00:58PM +0200, Alexander Motin wrote:
> 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.

Just in case you are not aware of the CF DMA history.
CF slots originally had not DMA support and support including pins
had been assigned in a later revision.
Now it can happen that a card is DMA capable, but if placed into a non
DMA aware Slot the wiring is missing.
Because of this you can buy CF cards, which had been setup by the
vendor to not report DMA ability.
Some vendors offer tools to toogle this feature.
The only way to handle this automatically is to try DMA and fall back
to non DMA.

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

-- 
B.Walter <bernd_at_bwct.de> http://www.bwct.de
Modbus/TCP Ethernet I/O Baugruppen, ARM basierte FreeBSD Rechner uvm.
Received on Tue Dec 08 2009 - 13:00:37 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:58 UTC