mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-04 08:08:54 +00:00
ata: ahci_brcm: Perform reset after obtaining resources
Resources such as clocks, PHYs, regulators are likely to get a probe deferral return code, which could lead to the AHCI controller being reset a few times until it gets successfully probed. Since this is typically the most time consuming operation, move it after the resources have been acquired. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
parent
6fedae3cad
commit
1a0600d112
1 changed files with 6 additions and 6 deletions
|
@ -456,13 +456,9 @@ static int brcm_ahci_probe(struct platform_device *pdev)
|
||||||
if (IS_ERR(priv->rcdev))
|
if (IS_ERR(priv->rcdev))
|
||||||
return PTR_ERR(priv->rcdev);
|
return PTR_ERR(priv->rcdev);
|
||||||
|
|
||||||
reset_control_deassert(priv->rcdev);
|
|
||||||
|
|
||||||
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);
|
return PTR_ERR(hpriv);
|
||||||
goto out_reset;
|
|
||||||
}
|
|
||||||
|
|
||||||
hpriv->plat_data = priv;
|
hpriv->plat_data = priv;
|
||||||
hpriv->flags = AHCI_HFLAG_WAKE_BEFORE_STOP | AHCI_HFLAG_NO_WRITE_TO_RO;
|
hpriv->flags = AHCI_HFLAG_WAKE_BEFORE_STOP | AHCI_HFLAG_NO_WRITE_TO_RO;
|
||||||
|
@ -479,6 +475,10 @@ static int brcm_ahci_probe(struct platform_device *pdev)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ret = reset_control_deassert(priv->rcdev);
|
||||||
|
if (ret)
|
||||||
|
return ret;
|
||||||
|
|
||||||
ret = ahci_platform_enable_clks(hpriv);
|
ret = ahci_platform_enable_clks(hpriv);
|
||||||
if (ret)
|
if (ret)
|
||||||
goto out_reset;
|
goto out_reset;
|
||||||
|
|
Loading…
Reference in a new issue