mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-25 13:14:07 +08:00
ata: ahci_brcm: BCM7425 AHCI requires AHCI_HFLAG_DELAY_ENGINE
Set AHCI_HFLAG_DELAY_ENGINE for the BCM7425 AHCI controller thus making it conforming to the 'strict' AHCI implementation which this controller is based on. This solves long link establishment with specific hard drives (e.g.: Seagate ST1000VM002-9ZL1 SC12) that would otherwise have to complete the error recovery handling before finally establishing a succesful SATA link at the desired speed. We re-order the hpriv->flags assignment to also remove the NONCQ quirk since we can set the flag directly. Fixes: 9586114cf1e9 ("ata: ahci_brcmstb: add support MIPS-based platforms") Fixes: 423be77daabe ("ata: ahci_brcmstb: add quirk for broken ncq") Cc: stable@vger.kernel.org Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
parent
c0cdf2ac4b
commit
1a3d78cb6e
@ -76,8 +76,7 @@ enum brcm_ahci_version {
|
|||||||
};
|
};
|
||||||
|
|
||||||
enum brcm_ahci_quirks {
|
enum brcm_ahci_quirks {
|
||||||
BRCM_AHCI_QUIRK_NO_NCQ = BIT(0),
|
BRCM_AHCI_QUIRK_SKIP_PHY_ENABLE = BIT(0),
|
||||||
BRCM_AHCI_QUIRK_SKIP_PHY_ENABLE = BIT(1),
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct brcm_ahci_priv {
|
struct brcm_ahci_priv {
|
||||||
@ -432,18 +431,27 @@ static int brcm_ahci_probe(struct platform_device *pdev)
|
|||||||
if (!IS_ERR_OR_NULL(priv->rcdev))
|
if (!IS_ERR_OR_NULL(priv->rcdev))
|
||||||
reset_control_deassert(priv->rcdev);
|
reset_control_deassert(priv->rcdev);
|
||||||
|
|
||||||
if ((priv->version == BRCM_SATA_BCM7425) ||
|
|
||||||
(priv->version == BRCM_SATA_NSP)) {
|
|
||||||
priv->quirks |= BRCM_AHCI_QUIRK_NO_NCQ;
|
|
||||||
priv->quirks |= BRCM_AHCI_QUIRK_SKIP_PHY_ENABLE;
|
|
||||||
}
|
|
||||||
|
|
||||||
hpriv = ahci_platform_get_resources(pdev, 0);
|
hpriv = ahci_platform_get_resources(pdev, 0);
|
||||||
if (IS_ERR(hpriv)) {
|
if (IS_ERR(hpriv)) {
|
||||||
ret = PTR_ERR(hpriv);
|
ret = PTR_ERR(hpriv);
|
||||||
goto out_reset;
|
goto out_reset;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
hpriv->plat_data = priv;
|
||||||
|
hpriv->flags = AHCI_HFLAG_WAKE_BEFORE_STOP | AHCI_HFLAG_NO_WRITE_TO_RO;
|
||||||
|
|
||||||
|
switch (priv->version) {
|
||||||
|
case BRCM_SATA_BCM7425:
|
||||||
|
hpriv->flags |= AHCI_HFLAG_DELAY_ENGINE;
|
||||||
|
/* fall through */
|
||||||
|
case BRCM_SATA_NSP:
|
||||||
|
hpriv->flags |= AHCI_HFLAG_NO_NCQ;
|
||||||
|
priv->quirks |= BRCM_AHCI_QUIRK_SKIP_PHY_ENABLE;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
ret = ahci_platform_enable_clks(hpriv);
|
ret = ahci_platform_enable_clks(hpriv);
|
||||||
if (ret)
|
if (ret)
|
||||||
goto out_reset;
|
goto out_reset;
|
||||||
@ -463,15 +471,8 @@ static int brcm_ahci_probe(struct platform_device *pdev)
|
|||||||
/* Must be done before ahci_platform_enable_phys() */
|
/* Must be done before ahci_platform_enable_phys() */
|
||||||
brcm_sata_phys_enable(priv);
|
brcm_sata_phys_enable(priv);
|
||||||
|
|
||||||
hpriv->plat_data = priv;
|
|
||||||
hpriv->flags = AHCI_HFLAG_WAKE_BEFORE_STOP;
|
|
||||||
|
|
||||||
brcm_sata_alpm_init(hpriv);
|
brcm_sata_alpm_init(hpriv);
|
||||||
|
|
||||||
if (priv->quirks & BRCM_AHCI_QUIRK_NO_NCQ)
|
|
||||||
hpriv->flags |= AHCI_HFLAG_NO_NCQ;
|
|
||||||
hpriv->flags |= AHCI_HFLAG_NO_WRITE_TO_RO;
|
|
||||||
|
|
||||||
ret = ahci_platform_enable_phys(hpriv);
|
ret = ahci_platform_enable_phys(hpriv);
|
||||||
if (ret)
|
if (ret)
|
||||||
goto out_disable_phys;
|
goto out_disable_phys;
|
||||||
|
Loading…
Reference in New Issue
Block a user