aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnurag Kumar Vulisha <anurag.kumar.vulisha@xilinx.com>2017-08-21 07:17:23 -0400
committerTejun Heo <tj@kernel.org>2017-10-23 10:09:27 -0400
commit26bf3b6658a2137cd6a88b2f14f36d3c31c7b2ee (patch)
tree2968285e498e8bb86546c588c4ca499f80256df1
parent6e037fb7708653035adbcd739ac295b9744e06cf (diff)
ata: ceva: Correct the suspend and resume logic for SATA
The present suspend code disables the port interrupts and stops the HBA. On resume it enables the interrupts and HBA. This works fine until the FPD power domain is not off. If FPD is off then the ceva vendor specific configurations like OOB, AXI settings are lost, they need to be re-programmed and also since SERDES is also in FPD , SATA lane phy init needs to be called again (which is not happening in the present sequence) Because of this incorrect sequence SATA fails to work on resume. This patch corrects the code to make Suspend & Resume work in normal and FPD off cases. Signed-off-by: Anurag Kumar Vulisha <anuragku@xilinx.com> Reviewed-by: Shubhrajyoti Datta <shubhraj@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com> Signed-off-by: Tejun Heo <tj@kernel.org>
-rw-r--r--drivers/ata/ahci_ceva.c29
1 files changed, 27 insertions, 2 deletions
diff --git a/drivers/ata/ahci_ceva.c b/drivers/ata/ahci_ceva.c
index 113c1f617da9..c0742cbe4faa 100644
--- a/drivers/ata/ahci_ceva.c
+++ b/drivers/ata/ahci_ceva.c
@@ -298,12 +298,37 @@ disable_resources:
298 298
299static int __maybe_unused ceva_ahci_suspend(struct device *dev) 299static int __maybe_unused ceva_ahci_suspend(struct device *dev)
300{ 300{
301 return ahci_platform_suspend_host(dev); 301 return ahci_platform_suspend(dev);
302} 302}
303 303
304static int __maybe_unused ceva_ahci_resume(struct device *dev) 304static int __maybe_unused ceva_ahci_resume(struct device *dev)
305{ 305{
306 return ahci_platform_resume_host(dev); 306 struct ata_host *host = dev_get_drvdata(dev);
307 struct ahci_host_priv *hpriv = host->private_data;
308 int rc;
309
310 rc = ahci_platform_enable_resources(hpriv);
311 if (rc)
312 return rc;
313
314 /* Configure CEVA specific config before resuming HBA */
315 ahci_ceva_setup(hpriv);
316
317 rc = ahci_platform_resume_host(dev);
318 if (rc)
319 goto disable_resources;
320
321 /* We resumed so update PM runtime state */
322 pm_runtime_disable(dev);
323 pm_runtime_set_active(dev);
324 pm_runtime_enable(dev);
325
326 return 0;
327
328disable_resources:
329 ahci_platform_disable_resources(hpriv);
330
331 return rc;
307} 332}
308 333
309static SIMPLE_DEV_PM_OPS(ahci_ceva_pm_ops, ceva_ahci_suspend, ceva_ahci_resume); 334static SIMPLE_DEV_PM_OPS(ahci_ceva_pm_ops, ceva_ahci_suspend, ceva_ahci_resume);