public inbox for linux-ide@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH/RFT] sata: rcar_sata: Reset SATA PHY on resume
@ 2017-04-18  7:02 Simon Horman
  2017-04-18  7:17 ` Tejun Heo
  2017-04-18  9:20 ` Sergei Shtylyov
  0 siblings, 2 replies; 5+ messages in thread
From: Simon Horman @ 2017-04-18  7:02 UTC (permalink / raw)
  To: linux-renesas-soc
  Cc: linux-arm-kernel, Magnus Damm, linux-ide, Simon Horman,
	Khiem Nguyen

In the case where power is cut on suspend the SATA PHY state needs to be
suspended on resume.

This is the case on the Salvator-X board with the r8a7795 or r8a7796 SoC.
In that environment it has been observed that SATA partitions cannot not be
accessed on resume.

Based on work by Khiem Nguyen.

Cc: Khiem Nguyen <khiem.nguyen.xt@rvc.renesas.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
* Compile and boot tested only
---
 drivers/ata/sata_rcar.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/drivers/ata/sata_rcar.c b/drivers/ata/sata_rcar.c
index 5d38245a7a73..4f4f7788a6cf 100644
--- a/drivers/ata/sata_rcar.c
+++ b/drivers/ata/sata_rcar.c
@@ -969,16 +969,9 @@ static int sata_rcar_resume(struct device *dev)
 {
 	struct ata_host *host = dev_get_drvdata(dev);
 	struct sata_rcar_priv *priv = host->private_data;
-	void __iomem *base = priv->base;
 
 	clk_prepare_enable(priv->clk);
-
-	/* ack and mask */
-	iowrite32(0, base + SATAINTSTAT_REG);
-	iowrite32(0x7ff, base + SATAINTMASK_REG);
-	/* enable interrupts */
-	iowrite32(ATAPI_INT_ENABLE_SATAINT, base + ATAPI_INT_ENABLE_REG);
-
+	sata_rcar_init_controller(host);
 	ata_host_resume(host);
 
 	return 0;
-- 
2.7.0.rc3.207.g0ac5344


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-04-20  9:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-18  7:02 [PATCH/RFT] sata: rcar_sata: Reset SATA PHY on resume Simon Horman
2017-04-18  7:17 ` Tejun Heo
2017-04-18  7:30   ` Simon Horman
2017-04-18  9:20 ` Sergei Shtylyov
2017-04-20  9:05   ` Simon Horman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox