summaryrefslogtreecommitdiff
path: root/drivers/ata
diff options
context:
space:
mode:
authorShaohui Xie <Shaohui.Xie@freescale.com>2012-08-03 08:00:03 (GMT)
committerFleming Andrew-AFLEMING <AFLEMING@freescale.com>2013-05-06 21:34:33 (GMT)
commitae9779830da9e1d02290d6510ecd637d373362a3 (patch)
treec1ca09a86b4a7dad21eca27bbd7b945071ccb4aa /drivers/ata
parentcb74e74b3f5bb0aeaa1a36ee20d311c671da02c8 (diff)
downloadlinux-fsl-qoriq-ae9779830da9e1d02290d6510ecd637d373362a3.tar.xz
powerpc/sata: add workaround for erratum A-005636
When NCQ is enabled, the SATA controller does not support DMA setup FIS with autoactivate enabled from the device. The SATA host may timeout without finishing the transaction. This will have a minor performance impact as disabling the auto-activate feature requires the device to send a DMA setup as well as a DMA activate FIS to enable reception of the first data FIS. Software will set a flag and check if device enables DMA AA by default, then driver will: 1. Disable the DMA setup auto-activate feature by a set features command. 2. if 1# fail, then disable NCQ by setting the queue depth to one. Signed-off-by: Shaohui Xie <Shaohui.Xie@freescale.com> Change-Id: Icd5b9811eb4cb8342532c5c6238282b6c42cc7fa Reviewed-on: http://git.am.freescale.net:8181/2226 Reviewed-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com> Tested-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
Diffstat (limited to 'drivers/ata')
-rw-r--r--drivers/ata/libata-core.c15
-rw-r--r--drivers/ata/sata_fsl.c8
2 files changed, 23 insertions, 0 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 501c209..ac77e65 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -2111,6 +2111,21 @@ static int ata_dev_config_ncq(struct ata_device *dev,
dev->flags |= ATA_DFLAG_NCQ;
}
+ if ((ap->flags & ATA_FLAG_BROKENAA) &&
+ (ata_id_has_fpdma_aa(dev->id)) &&
+ (ata_id_enabled_fpdma_aa(dev->id))) {
+ err_mask = ata_dev_set_feature(dev, SETFEATURES_SATA_DISABLE,
+ SATA_FPDMA_AA);
+ if (err_mask) {
+ ata_dev_printk(dev, KERN_ERR, "failed to disable AA"
+ "(error_mask=0x%x)\n", err_mask);
+ /* turn off NCQ if failed disable SATA_FPDMA_AA */
+ hdepth = 1;
+ dev->flags &= ~ATA_DFLAG_NCQ;
+ dev->flags |= ATA_DFLAG_NCQ_OFF;
+ }
+ }
+
if (!(dev->horkage & ATA_HORKAGE_BROKEN_FPDMA_AA) &&
(ap->flags & ATA_FLAG_FPDMA_AA) &&
ata_id_has_fpdma_aa(dev->id)) {
diff --git a/drivers/ata/sata_fsl.c b/drivers/ata/sata_fsl.c
index 515f66f..ca754b5 100644
--- a/drivers/ata/sata_fsl.c
+++ b/drivers/ata/sata_fsl.c
@@ -1511,6 +1511,14 @@ static int sata_fsl_probe(struct platform_device *ofdev)
else
host_priv->data_snoop = DATA_SNOOP_ENABLE_V1;
+ /*
+ * Since erratum A-005636 applies to all platforms, it only be fixed
+ * on T4 rev2.0, we add a flag to identify the erratum in main path.
+ * XXX: for T4 rev2.0 and other new SoCs use same controller as
+ * T4 Rev2.0. this flag should be removed.
+ */
+ pi.flags |= ATA_FLAG_BROKENAA;
+
/* allocate host structure */
host = ata_host_alloc_pinfo(&ofdev->dev, ppi, SATA_FSL_MAX_PORTS);
if (!host) {