summaryrefslogtreecommitdiff
path: root/drivers/ata
diff options
context:
space:
mode:
authorShaohui Xie <Shaohui.Xie@freescale.com>2014-11-20 05:43:33 (GMT)
committerZhengxiong Jin <Jason.Jin@freescale.com>2015-03-03 06:53:28 (GMT)
commit110fee40717448dabc340476f6942c41c5fa20c7 (patch)
tree3f15bbd61c41d5ec5779110322e6672ed60f84f2 /drivers/ata
parent398d5e52020a08745e49022e32a8e4755e4124bf (diff)
downloadlinux-fsl-qoriq-110fee40717448dabc340476f6942c41c5fa20c7.tar.xz
ls1021a: ahci: restore PORT_CMD value
The value changed after hard reset which caused interrupt cannot work, restore the value after reset then the interrupt can work. Signed-off-by: Shaohui Xie <Shaohui.Xie@freescale.com> Change-Id: I095bf1c4029938e1ad6d0416aeea58463b2dcdf8 Reviewed-on: http://git.am.freescale.net:8181/31842 Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Xiaobo Xie <X.Xie@freescale.com> Reviewed-by: Zhengxiong Jin <Jason.Jin@freescale.com>
Diffstat (limited to 'drivers/ata')
-rw-r--r--drivers/ata/libahci.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c
index cfb7447..689b5f8 100644
--- a/drivers/ata/libahci.c
+++ b/drivers/ata/libahci.c
@@ -1426,15 +1426,19 @@ static int ahci_hardreset(struct ata_link *link, unsigned int *class,
const unsigned long *timing = sata_ehc_deb_timing(&link->eh_context);
struct ata_port *ap = link->ap;
struct ahci_port_priv *pp = ap->private_data;
+ void __iomem *port_mmio = ahci_port_base(link->ap);
u8 *d2h_fis = pp->rx_fis + RX_FIS_D2H_REG;
struct ata_taskfile tf;
bool online;
int rc;
+ u32 save_cmd, tmp;
DPRINTK("ENTER\n");
ahci_stop_engine(ap);
+ save_cmd = readl(port_mmio + PORT_CMD);
+
/* clear D2H reception area to properly wait for D2H FIS */
ata_tf_init(link->device, &tf);
tf.command = ATA_BUSY;
@@ -1443,6 +1447,11 @@ static int ahci_hardreset(struct ata_link *link, unsigned int *class,
rc = sata_link_hardreset(link, timing, deadline, &online,
ahci_check_ready);
+ /* Revert the saved cmd value, if not match with original */
+ tmp = readl(port_mmio + PORT_CMD);
+ if (tmp != save_cmd)
+ writel(save_cmd, port_mmio + PORT_CMD);
+
ahci_start_engine(ap);
if (online)