On Mon, Apr 28, 2014 at 7:46 PM, Alex Williamson <alex.william...@redhat.com> wrote: > > On Mon, 2014-04-28 at 17:52 +0200, Antonios Motakis wrote: > > Adds support to mask interrupts, and also for automasked interrupts. > > Level sensitive interrupts are exposed as automasked interrupts and > > are masked and disabled automatically when they fire. > > > > Signed-off-by: Antonios Motakis <a.mota...@virtualopensystems.com> > > --- > > drivers/vfio/platform/vfio_platform_irq.c | 117 > > ++++++++++++++++++++++++-- > > drivers/vfio/platform/vfio_platform_private.h | 2 + > > 2 files changed, 113 insertions(+), 6 deletions(-) > > > > diff --git a/drivers/vfio/platform/vfio_platform_irq.c > > b/drivers/vfio/platform/vfio_platform_irq.c > > index 433edc1..e38982f 100644 > > --- a/drivers/vfio/platform/vfio_platform_irq.c > > +++ b/drivers/vfio/platform/vfio_platform_irq.c > > @@ -52,9 +52,16 @@ int vfio_platform_irq_init(struct vfio_platform_device > > *vdev) > > struct vfio_platform_irq irq; > > int hwirq = platform_get_irq(vdev->pdev, i); > > > > - irq.flags = VFIO_IRQ_INFO_EVENTFD; > > + spin_lock_init(&irq.lock); > > + > > + irq.flags = VFIO_IRQ_INFO_EVENTFD | VFIO_IRQ_INFO_MASKABLE; > > + > > + if (irq_get_trigger_type(hwirq) & IRQ_TYPE_LEVEL_MASK) > > + irq.flags |= VFIO_IRQ_INFO_AUTOMASKED; > > + > > irq.count = 1; > > irq.hwirq = hwirq; > > + irq.masked = false; > > > > vdev->irq[i] = irq; > > } > > @@ -66,19 +73,39 @@ void vfio_platform_irq_cleanup(struct > > vfio_platform_device *vdev) > > { > > int i; > > > > - for (i = 0; i < vdev->num_irqs; i++) > > + for (i = 0; i < vdev->num_irqs; i++) { > > vfio_set_trigger(vdev, i, -1); > > > > + if (vdev->irq[i].masked) > > + enable_irq(vdev->irq[i].hwirq); > > This looks suspicious. set_trigger(,, -1) calls free_irq() and here we > enable_irq(). Shouldn't the nexe user's call to request_irq() be > sufficient to re-enable it? Thanks, >
This is actually called when we unbind from the device, so it is indeed not needed. > Alex > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/