lkml.org 
[lkml]   [2020]   [Jan]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 1/2] ata: ahci_brcm: Perform reset after obtaining resources
Date
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 | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/ata/ahci_brcm.c b/drivers/ata/ahci_brcm.c
index 13ceca687104..c3137ec9fb1c 100644
--- a/drivers/ata/ahci_brcm.c
+++ b/drivers/ata/ahci_brcm.c
@@ -453,10 +453,6 @@ static int brcm_ahci_probe(struct platform_device *pdev)
else
reset_name = "ahci";

- priv->rcdev = devm_reset_control_get(&pdev->dev, reset_name);
- if (!IS_ERR_OR_NULL(priv->rcdev))
- reset_control_deassert(priv->rcdev);
-
hpriv = ahci_platform_get_resources(pdev, 0);
if (IS_ERR(hpriv)) {
ret = PTR_ERR(hpriv);
@@ -478,6 +474,10 @@ static int brcm_ahci_probe(struct platform_device *pdev)
break;
}

+ priv->rcdev = devm_reset_control_get(&pdev->dev, reset_name);
+ if (!IS_ERR_OR_NULL(priv->rcdev))
+ reset_control_deassert(priv->rcdev);
+
ret = ahci_platform_enable_clks(hpriv);
if (ret)
goto out_reset;
--
2.17.1
\
 
 \ /
  Last update: 2020-01-06 19:59    [W:0.065 / U:47.780 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site