summaryrefslogtreecommitdiffstats
path: root/drivers/ata/ahci_brcm.c
diff options
context:
space:
mode:
authorFlorian Fainelli <f.fainelli@gmail.com>2019-12-10 10:53:48 -0800
committerJens Axboe <axboe@kernel.dk>2019-12-25 20:48:30 -0700
commit3c696ac4173678b62e74e26644d9f3d662973bfa (patch)
tree599745427854c876a45e3efa222458072e543416 /drivers/ata/ahci_brcm.c
parentbf0e5013bc2dcac205417e1252205dca39dfc005 (diff)
downloadlinux-3c696ac4173678b62e74e26644d9f3d662973bfa.tar.gz
linux-3c696ac4173678b62e74e26644d9f3d662973bfa.tar.bz2
linux-3c696ac4173678b62e74e26644d9f3d662973bfa.zip
ata: ahci_brcm: Manage reset line during suspend/resume
We were not managing the reset line during suspend/resume, but this needs to be done to ensure that the controller can exit low power modes correctly, especially with deep sleep suspend mode that may reset parts of the logic. 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>
Diffstat (limited to 'drivers/ata/ahci_brcm.c')
-rw-r--r--drivers/ata/ahci_brcm.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/ata/ahci_brcm.c b/drivers/ata/ahci_brcm.c
index 66a570d0da83..76612577a59a 100644
--- a/drivers/ata/ahci_brcm.c
+++ b/drivers/ata/ahci_brcm.c
@@ -343,10 +343,16 @@ static int brcm_ahci_suspend(struct device *dev)
struct ata_host *host = dev_get_drvdata(dev);
struct ahci_host_priv *hpriv = host->private_data;
struct brcm_ahci_priv *priv = hpriv->plat_data;
+ int ret;
brcm_sata_phys_disable(priv);
- return ahci_platform_suspend(dev);
+ ret = ahci_platform_suspend(dev);
+
+ if (!IS_ERR_OR_NULL(priv->rcdev))
+ reset_control_assert(priv->rcdev);
+
+ return ret;
}
static int brcm_ahci_resume(struct device *dev)
@@ -354,7 +360,12 @@ static int brcm_ahci_resume(struct device *dev)
struct ata_host *host = dev_get_drvdata(dev);
struct ahci_host_priv *hpriv = host->private_data;
struct brcm_ahci_priv *priv = hpriv->plat_data;
- int ret;
+ int ret = 0;
+
+ if (!IS_ERR_OR_NULL(priv->rcdev))
+ ret = reset_control_deassert(priv->rcdev);
+ if (ret)
+ return ret;
/* Make sure clocks are turned on before re-configuration */
ret = ahci_platform_enable_clks(hpriv);