Messages in this thread Patch in this message |  | | From | Florian Fainelli <> | Subject | [PATCH v3 2/3] ata: ahci_brcm: Perform reset after obtaining resources | Date | Tue, 7 Jan 2020 10:30:21 -0800 |
| |
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> --- drivers/ata/ahci_brcm.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/drivers/ata/ahci_brcm.c b/drivers/ata/ahci_brcm.c index 718516fe6997..c229fea39a47 100644 --- a/drivers/ata/ahci_brcm.c +++ b/drivers/ata/ahci_brcm.c @@ -456,15 +456,9 @@ static int brcm_ahci_probe(struct platform_device *pdev) if (IS_ERR(priv->rcdev)) return PTR_ERR(priv->rcdev); - ret = reset_control_deassert(priv->rcdev); - if (ret) - return ret; - hpriv = ahci_platform_get_resources(pdev, 0); - if (IS_ERR(hpriv)) { - ret = PTR_ERR(hpriv); - goto out_reset; - } + if (IS_ERR(hpriv)) + return PTR_ERR(hpriv); hpriv->plat_data = priv; hpriv->flags = AHCI_HFLAG_WAKE_BEFORE_STOP | AHCI_HFLAG_NO_WRITE_TO_RO; @@ -481,6 +475,10 @@ static int brcm_ahci_probe(struct platform_device *pdev) break; } + ret = reset_control_deassert(priv->rcdev); + if (ret) + return ret; + ret = ahci_platform_enable_clks(hpriv); if (ret) goto out_reset; -- 2.17.1
|  |