[PATCH v3 4/9] ata: ahci: add ack callback to multi irq handler

sven.auhagen at voleatech.de sven.auhagen at voleatech.de
Mon Nov 9 12:39:43 EST 2020


From: Sven Auhagen <sven.auhagen at voleatech.de>

In order to support custom actions at the end of the irq handler
a multi_irq_host_ack callback is added to the struct ahci_host_priv.

Suggested-by: Hans de Goede <hdegoede at redhat.com>
Reviewed-by: Hans de Goede <hdegoede at redhat.com>
Signed-off-by: Sven Auhagen <sven.auhagen at voleatech.de>
---
 drivers/ata/ahci.h    | 2 ++
 drivers/ata/libahci.c | 4 ++++
 2 files changed, 6 insertions(+)

diff --git a/drivers/ata/ahci.h b/drivers/ata/ahci.h
index 98b8baa47dc5..d8109e06794c 100644
--- a/drivers/ata/ahci.h
+++ b/drivers/ata/ahci.h
@@ -371,6 +371,8 @@ struct ahci_host_priv {
 	/* only required for per-port MSI(-X) support */
 	int			(*get_irq_vector)(struct ata_host *host,
 						  int port);
+
+	int			(*multi_irq_host_ack)(int irq, struct ata_port *ap);
 };
 
 extern int ahci_ignore_sss;
diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c
index ea5bf5f4cbed..cf9839135a57 100644
--- a/drivers/ata/libahci.c
+++ b/drivers/ata/libahci.c
@@ -1897,6 +1897,7 @@ static void ahci_port_intr(struct ata_port *ap)
 static irqreturn_t ahci_multi_irqs_intr_hard(int irq, void *dev_instance)
 {
 	struct ata_port *ap = dev_instance;
+	struct ahci_host_priv *hpriv = ap->host->private_data;
 	void __iomem *port_mmio = ahci_port_base(ap);
 	u32 status;
 
@@ -1909,6 +1910,9 @@ static irqreturn_t ahci_multi_irqs_intr_hard(int irq, void *dev_instance)
 	ahci_handle_port_interrupt(ap, port_mmio, status);
 	spin_unlock(ap->lock);
 
+	if (hpriv->multi_irq_host_ack)
+		hpriv->multi_irq_host_ack(irq, ap);
+
 	VPRINTK("EXIT\n");
 
 	return IRQ_HANDLED;
-- 
2.20.1




More information about the linux-arm-kernel mailing list