Commit 1c954a4d authored by Tejun Heo's avatar Tejun Heo Committed by Jeff Garzik

ahci: clean up PORT_IRQ_BAD_PMP enabling

Now that we have pp->intr_mask, move PORT_IRQ_BAD_PMP enabling to
ahci_pmp_attach/detach() where it belongs.
Signed-off-by: default avatarTejun Heo <htejun@gmail.com>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent 75da6d2b
...@@ -1620,11 +1620,8 @@ static void ahci_thaw(struct ata_port *ap) ...@@ -1620,11 +1620,8 @@ static void ahci_thaw(struct ata_port *ap)
writel(tmp, port_mmio + PORT_IRQ_STAT); writel(tmp, port_mmio + PORT_IRQ_STAT);
writel(1 << ap->port_no, mmio + HOST_IRQ_STAT); writel(1 << ap->port_no, mmio + HOST_IRQ_STAT);
/* turn IRQ back on, ignore BAD_PMP if PMP isn't attached */ /* turn IRQ back on */
tmp = pp->intr_mask; writel(pp->intr_mask, port_mmio + PORT_IRQ_MASK);
if (!ap->nr_pmp_links)
tmp &= ~PORT_IRQ_BAD_PMP;
writel(tmp, port_mmio + PORT_IRQ_MASK);
} }
static void ahci_error_handler(struct ata_port *ap) static void ahci_error_handler(struct ata_port *ap)
...@@ -1667,21 +1664,29 @@ static void ahci_post_internal_cmd(struct ata_queued_cmd *qc) ...@@ -1667,21 +1664,29 @@ static void ahci_post_internal_cmd(struct ata_queued_cmd *qc)
static void ahci_pmp_attach(struct ata_port *ap) static void ahci_pmp_attach(struct ata_port *ap)
{ {
void __iomem *port_mmio = ahci_port_base(ap); void __iomem *port_mmio = ahci_port_base(ap);
struct ahci_port_priv *pp = ap->private_data;
u32 cmd; u32 cmd;
cmd = readl(port_mmio + PORT_CMD); cmd = readl(port_mmio + PORT_CMD);
cmd |= PORT_CMD_PMP; cmd |= PORT_CMD_PMP;
writel(cmd, port_mmio + PORT_CMD); writel(cmd, port_mmio + PORT_CMD);
pp->intr_mask |= PORT_IRQ_BAD_PMP;
writel(pp->intr_mask, port_mmio + PORT_IRQ_MASK);
} }
static void ahci_pmp_detach(struct ata_port *ap) static void ahci_pmp_detach(struct ata_port *ap)
{ {
void __iomem *port_mmio = ahci_port_base(ap); void __iomem *port_mmio = ahci_port_base(ap);
struct ahci_port_priv *pp = ap->private_data;
u32 cmd; u32 cmd;
cmd = readl(port_mmio + PORT_CMD); cmd = readl(port_mmio + PORT_CMD);
cmd &= ~PORT_CMD_PMP; cmd &= ~PORT_CMD_PMP;
writel(cmd, port_mmio + PORT_CMD); writel(cmd, port_mmio + PORT_CMD);
pp->intr_mask &= ~PORT_IRQ_BAD_PMP;
writel(pp->intr_mask, port_mmio + PORT_IRQ_MASK);
} }
static int ahci_pmp_read(struct ata_device *dev, int pmp, int reg, u32 *r_val) static int ahci_pmp_read(struct ata_device *dev, int pmp, int reg, u32 *r_val)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment