Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 7 Feb 2009 11:27:34 +0100 (CET)
From:      Mikulas Patocka <mikulas@artax.karlin.mff.cuni.cz>
To:        sos@FreeBSD.org, bofh@terranova.net
Cc:        freebsd-current@freebsd.org
Subject:   HT 1000 SATA suggestion
Message-ID:  <Pine.LNX.4.64.0902071102110.8765@artax.karlin.mff.cuni.cz>

next in thread | raw e-mail | index | archive | help
Hi

I found that you have problems with HT1000 SATA in FreeBSD.

The problem is actually explained in the comments in the Linux driver.

For normal IDE & legacy SATA cards, the sequence to perform DMA is this:

- load register file
- submit the command to the disk
- setup dma sg table address and start dma

But for ServerWorks SATA chips this sequence is wrong. If there is some 
CPU latency and data from the disk arrive BEFORE you start the dma engine, 
the controller will hang or corrupt the data.

The correct sequence is to first start dma and then write the command to 
the taskfile. (Linux does this on serverworks SATA chips for both read and 
write commands, likely it doesn't cause problems with write commands)


I am not a FreeBSD user or developer and I don't have a FreeBSD machine 
here to test, I was just developing ServerWorks SATA driver for another 
system, read the Linux driver, searched for HT1000 on the internet and 
found some your discussion where you desperately tried to work around the 
bugs in the chip and ended up restricting the transfer size (and then 
restricted it even more because it still didn't work perfectly) ... then I 
looked into FreeBSD source and saw that you start DMA after sending the 
command. So I'm writing you this like a suggestion to try.

Mikulas



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.LNX.4.64.0902071102110.8765>