[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAG8rG2xZd2VnAbw=-V_cd76Zv0ZJkdpYyJ-GWA5C-kkHfZ_ZiQ@mail.gmail.com>
Date: Fri, 2 May 2014 19:25:39 +0200
From: Antonios Motakis <a.motakis@...tualopensystems.com>
To: Alex Williamson <alex.williamson@...hat.com>
Cc: kvm-arm <kvmarm@...ts.cs.columbia.edu>,
Linux IOMMU <iommu@...ts.linux-foundation.org>,
VirtualOpenSystems Technical Team <tech@...tualopensystems.com>,
alvise rigo <a.rigo@...tualopensystems.com>,
KVM devel mailing list <kvm@...r.kernel.org>,
Christoffer Dall <christoffer.dall@...aro.org>,
Will Deacon <will.deacon@....com>,
Kim Phillips <kim.phillips@...escale.com>,
Stuart Yoder <stuart.yoder@...escale.com>,
Catalin Marinas <catalin.marinas@....com>,
Mark Rutland <mark.rutland@....com>,
open list <linux-kernel@...r.kernel.org>
Subject: Re: [RFC PATCH v5 11/11] VFIO_PLATFORM: Support for maskable and
automasked interrupts
On Mon, Apr 28, 2014 at 7:46 PM, Alex Williamson
<alex.williamson@...hat.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.motakis@...tualopensystems.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 majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists