aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/ahci.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ata/ahci.c')
-rw-r--r--drivers/ata/ahci.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index 694eabcb932f..6633c7422fc4 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -1620,11 +1620,8 @@ static void ahci_thaw(struct ata_port *ap)
1620 writel(tmp, port_mmio + PORT_IRQ_STAT); 1620 writel(tmp, port_mmio + PORT_IRQ_STAT);
1621 writel(1 << ap->port_no, mmio + HOST_IRQ_STAT); 1621 writel(1 << ap->port_no, mmio + HOST_IRQ_STAT);
1622 1622
1623 /* turn IRQ back on, ignore BAD_PMP if PMP isn't attached */ 1623 /* turn IRQ back on */
1624 tmp = pp->intr_mask; 1624 writel(pp->intr_mask, port_mmio + PORT_IRQ_MASK);
1625 if (!ap->nr_pmp_links)
1626 tmp &= ~PORT_IRQ_BAD_PMP;
1627 writel(tmp, port_mmio + PORT_IRQ_MASK);
1628} 1625}
1629 1626
1630static void ahci_error_handler(struct ata_port *ap) 1627static void ahci_error_handler(struct ata_port *ap)
@@ -1667,21 +1664,29 @@ static void ahci_post_internal_cmd(struct ata_queued_cmd *qc)
1667static void ahci_pmp_attach(struct ata_port *ap) 1664static void ahci_pmp_attach(struct ata_port *ap)
1668{ 1665{
1669 void __iomem *port_mmio = ahci_port_base(ap); 1666 void __iomem *port_mmio = ahci_port_base(ap);
1667 struct ahci_port_priv *pp = ap->private_data;
1670 u32 cmd; 1668 u32 cmd;
1671 1669
1672 cmd = readl(port_mmio + PORT_CMD); 1670 cmd = readl(port_mmio + PORT_CMD);
1673 cmd |= PORT_CMD_PMP; 1671 cmd |= PORT_CMD_PMP;
1674 writel(cmd, port_mmio + PORT_CMD); 1672 writel(cmd, port_mmio + PORT_CMD);
1673
1674 pp->intr_mask |= PORT_IRQ_BAD_PMP;
1675 writel(pp->intr_mask, port_mmio + PORT_IRQ_MASK);
1675} 1676}
1676 1677
1677static void ahci_pmp_detach(struct ata_port *ap) 1678static void ahci_pmp_detach(struct ata_port *ap)
1678{ 1679{
1679 void __iomem *port_mmio = ahci_port_base(ap); 1680 void __iomem *port_mmio = ahci_port_base(ap);
1681 struct ahci_port_priv *pp = ap->private_data;
1680 u32 cmd; 1682 u32 cmd;
1681 1683
1682 cmd = readl(port_mmio + PORT_CMD); 1684 cmd = readl(port_mmio + PORT_CMD);
1683 cmd &= ~PORT_CMD_PMP; 1685 cmd &= ~PORT_CMD_PMP;
1684 writel(cmd, port_mmio + PORT_CMD); 1686 writel(cmd, port_mmio + PORT_CMD);
1687
1688 pp->intr_mask &= ~PORT_IRQ_BAD_PMP;
1689 writel(pp->intr_mask, port_mmio + PORT_IRQ_MASK);
1685} 1690}
1686 1691
1687static int ahci_pmp_read(struct ata_device *dev, int pmp, int reg, u32 *r_val) 1692static int ahci_pmp_read(struct ata_device *dev, int pmp, int reg, u32 *r_val)