summaryrefslogtreecommitdiffstats
path: root/sys/dev/ata
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2010-09-02 12:32:29 +0000
committermav <mav@FreeBSD.org>2010-09-02 12:32:29 +0000
commite758e6c84a7db8d8f7ed49f0dfe53a87092cd69e (patch)
treeeac0878f9e9c99ef42e06a4abef126e1cbaa8484 /sys/dev/ata
parentaac03a91b1506311ed759f27fd9c9bf95858a91c (diff)
downloadFreeBSD-src-e758e6c84a7db8d8f7ed49f0dfe53a87092cd69e.zip
FreeBSD-src-e758e6c84a7db8d8f7ed49f0dfe53a87092cd69e.tar.gz
Add fix for SiI3114 and SiI3512 chips bug, which caused sending R_ERR in
response to DMA activate FIS under certain circumstances. This is recommended fix from chip datasheet. If triggered, this bug most likely cause write command timeout. MFC after: 2 weeks
Diffstat (limited to 'sys/dev/ata')
-rw-r--r--sys/dev/ata/chipsets/ata-siliconimage.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/dev/ata/chipsets/ata-siliconimage.c b/sys/dev/ata/chipsets/ata-siliconimage.c
index ff22f07..0fe4e1c 100644
--- a/sys/dev/ata/chipsets/ata-siliconimage.c
+++ b/sys/dev/ata/chipsets/ata-siliconimage.c
@@ -365,7 +365,15 @@ ata_sii_status(device_t dev)
static void
ata_sii_reset(device_t dev)
{
+ struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev));
struct ata_channel *ch = device_get_softc(dev);
+ int offset = ((ch->unit & 1) << 7) + ((ch->unit & 2) << 8);
+ uint32_t val;
+
+ /* Apply R_ERR on DMA activate FIS errata workaround. */
+ val = ATA_INL(ctlr->r_res2, 0x14c + offset);
+ if ((val & 0x3) == 0x1)
+ ATA_OUTL(ctlr->r_res2, 0x14c + offset, val & ~0x3);
if (ata_sata_phy_reset(dev, -1, 1))
ata_generic_reset(dev);
OpenPOWER on IntegriCloud