Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1273201

[PATCH v4 03/13] VFIO: platform: test forwarded state when selecting the IRQ handler

From Eric Auger <eric.auger@linaro.org>
Newsgroups linux.kernel
Subject [PATCH v4 03/13] VFIO: platform: test forwarded state when selecting the IRQ handler
Date 2015-11-19 16:00 +0100
Message-ID <qwyQO-2dv-37@gated-at.bofh.it> (permalink)
References <qwyQN-2dv-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Add a new forwarded flag in vfio_platform_irq.  In case the IRQ
is forwarded, the VFIO platform IRQ handler does not need to
disable the IRQ anymore.

When setting the IRQ handler we now also test the forwarded state. In
case the IRQ is forwarded we select the vfio_irq_handler.

Signed-off-by: Eric Auger <eric.auger@linaro.org>

---

v2:
- add a new forwarded flag and do not use irqd_irq_forwarded anymore
---
 drivers/vfio/platform/vfio_platform_irq.c     | 3 ++-
 drivers/vfio/platform/vfio_platform_private.h | 1 +
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/vfio/platform/vfio_platform_irq.c b/drivers/vfio/platform/vfio_platform_irq.c
index ab7658a..d4462fd 100644
--- a/drivers/vfio/platform/vfio_platform_irq.c
+++ b/drivers/vfio/platform/vfio_platform_irq.c
@@ -265,7 +265,8 @@ static int vfio_platform_set_irq_trigger(struct vfio_platform_device *vdev,
 	struct vfio_platform_irq *irq = &vdev->irqs[index];
 	irq_handler_t handler;
 
-	if (vdev->irqs[index].flags & VFIO_IRQ_INFO_AUTOMASKED)
+	if (vdev->irqs[index].flags & VFIO_IRQ_INFO_AUTOMASKED &&
+			!irq->forwarded)
 		handler = vfio_automasked_irq_handler;
 	else
 		handler = vfio_irq_handler;
diff --git a/drivers/vfio/platform/vfio_platform_private.h b/drivers/vfio/platform/vfio_platform_private.h
index 979c191..55e8043 100644
--- a/drivers/vfio/platform/vfio_platform_private.h
+++ b/drivers/vfio/platform/vfio_platform_private.h
@@ -39,6 +39,7 @@ struct vfio_platform_irq {
 	struct virqfd		*unmask;
 	struct virqfd		*mask;
 	struct irq_bypass_producer producer;
+	bool			forwarded;
 };
 
 struct vfio_platform_region {
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v4 00/13] ARM IRQ forward control based on IRQ bypass manager Eric Auger <eric.auger@linaro.org> - 2015-11-19 16:00 +0100
  [PATCH v4 13/13] KVM: arm/arm64: implement IRQ bypass consumer functions Eric Auger <eric.auger@linaro.org> - 2015-11-19 16:00 +0100
  [PATCH v4 03/13] VFIO: platform: test forwarded state when selecting the IRQ handler Eric Auger <eric.auger@linaro.org> - 2015-11-19 16:00 +0100
  [PATCH v4 05/13] VFIO: platform: add vfio_platform_set_forwarded Eric Auger <eric.auger@linaro.org> - 2015-11-19 16:00 +0100
  [PATCH v4 06/13] VFIO: platform: add vfio_platform_irq_is_active Eric Auger <eric.auger@linaro.org> - 2015-11-19 16:00 +0100
  [PATCH v4 11/13] KVM: arm/arm64: vgic: implement clear active for non shared mapped IRQ Eric Auger <eric.auger@linaro.org> - 2015-11-19 16:00 +0100
  [PATCH v4 01/13] KVM: arm/arm64: select IRQ_BYPASS_MANAGER Eric Auger <eric.auger@linaro.org> - 2015-11-19 16:10 +0100

csiph-web