aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/ahci_xgene.c
diff options
context:
space:
mode:
authorSuman Tripathi <stripathi@apm.com>2016-02-06 00:55:23 -0500
committerTejun Heo <tj@kernel.org>2016-02-11 09:54:04 -0500
commitd867b95f965457b9e85fb061ef8e3fdc029116ed (patch)
tree200ca18b681ca23d2aeeddc7da6cb665f29063e0 /drivers/ata/ahci_xgene.c
parentf070d6715509dafc0af223577c896fe3d204ca88 (diff)
ata: Remove the AHCI_HFLAG_EDGE_IRQ support from libahci.
The flexibility to override the irq handles in the LLD's are already present, so controllers implementing a edge trigger latch can implement their own interrupt handler inside the driver. This patch removes the AHCI_HFLAG_EDGE_IRQ support from libahci and moves edge irq handling to ahci_xgene. tj: Minor update to description. Signed-off-by: Suman Tripathi <stripathi@apm.com> Signed-off-by: Tejun Heo <tj@kenrel.org>
Diffstat (limited to 'drivers/ata/ahci_xgene.c')
-rw-r--r--drivers/ata/ahci_xgene.c40
1 files changed, 39 insertions, 1 deletions
diff --git a/drivers/ata/ahci_xgene.c b/drivers/ata/ahci_xgene.c
index e2c6d9e0c5ac..8b8ccb6434e2 100644
--- a/drivers/ata/ahci_xgene.c
+++ b/drivers/ata/ahci_xgene.c
@@ -548,6 +548,43 @@ softreset_retry:
548 return rc; 548 return rc;
549} 549}
550 550
551static irqreturn_t xgene_ahci_irq_intr(int irq, void *dev_instance)
552{
553 struct ata_host *host = dev_instance;
554 struct ahci_host_priv *hpriv;
555 unsigned int rc = 0;
556 void __iomem *mmio;
557 u32 irq_stat, irq_masked;
558
559 VPRINTK("ENTER\n");
560
561 hpriv = host->private_data;
562 mmio = hpriv->mmio;
563
564 /* sigh. 0xffffffff is a valid return from h/w */
565 irq_stat = readl(mmio + HOST_IRQ_STAT);
566 if (!irq_stat)
567 return IRQ_NONE;
568
569 irq_masked = irq_stat & hpriv->port_map;
570
571 spin_lock(&host->lock);
572
573 /*
574 * HOST_IRQ_STAT behaves as edge triggered latch meaning that
575 * it should be cleared before all the port events are cleared.
576 */
577 writel(irq_stat, mmio + HOST_IRQ_STAT);
578
579 rc = ahci_handle_port_intr(host, irq_masked);
580
581 spin_unlock(&host->lock);
582
583 VPRINTK("EXIT\n");
584
585 return IRQ_RETVAL(rc);
586}
587
551static struct ata_port_operations xgene_ahci_v1_ops = { 588static struct ata_port_operations xgene_ahci_v1_ops = {
552 .inherits = &ahci_ops, 589 .inherits = &ahci_ops,
553 .host_stop = xgene_ahci_host_stop, 590 .host_stop = xgene_ahci_host_stop,
@@ -779,7 +816,8 @@ skip_clk_phy:
779 hpriv->flags = AHCI_HFLAG_NO_NCQ; 816 hpriv->flags = AHCI_HFLAG_NO_NCQ;
780 break; 817 break;
781 case XGENE_AHCI_V2: 818 case XGENE_AHCI_V2:
782 hpriv->flags |= AHCI_HFLAG_YES_FBS | AHCI_HFLAG_EDGE_IRQ; 819 hpriv->flags |= AHCI_HFLAG_YES_FBS;
820 hpriv->irq_handler = xgene_ahci_irq_intr;
783 break; 821 break;
784 default: 822 default:
785 break; 823 break;