lkml.org 
[lkml]   [2011]   [Aug]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] uio/gen-pci: don't enable interrupts in ISR
On Mon, Aug 08, 2011 at 07:19:31PM +0200, Hans J. Koch wrote:
> On Mon, Aug 08, 2011 at 09:24:31AM +0300, Michael S. Tsirkin wrote:
> > On Fri, Aug 05, 2011 at 02:15:07AM +0200, Hans J. Koch wrote:
> > > On Fri, Aug 05, 2011 at 12:04:13AM +0300, Michael S. Tsirkin wrote:
> > > > On Thu, Aug 04, 2011 at 10:46:06PM +0200, Sebastian Andrzej Siewior wrote:
> > > > > As reported by Anthony in a short way:
> > > > >
> > > > > |irq 17 handler uio_interrupt+0x0/0x68 enabled interrupts
> > > > > |NIP [c0069d84] handle_irq_event_percpu+0x260/0x26c
> > > > >
> > > > > The problem here is that spin_unlock_irq() enables the interrupts which
> > > > > is a no-no in interrupt context because they always run with interrupts
> > > > > disabled. This is the case even if IRQF_DISABLED has not been specified
> > > > > since v2.6.35. Therefore this patch uses simple spin_locks().
> > > > >
> > > > > Looking at it further here is only one spot where the lock is hold. So
> > > > > giving the fact that an ISR is not reentrant and is not executed on two
> > > > > cpus at the same time why do we need a lock here?
> > > >
> > > > I'm not sure anymore. I think the idea was to use
> > > > it for synchronization down the road somehow,
> > > > but it never materialized. Let's drop that lock completely.
> > >
> > > That sounds reasonable.
>
> Should I hack up a patch to remove the lock, or do you have anything in your
> pipeline?


Please do.

> > >
> > > >
> > > > > The driver lacks of ->irqcontrol function so I guess the interrupt is
> > > > > enabled via direct PCI-access in userland.
> > > >
> > > > Through sysfs.
> > >
> > > How? With /sys/devices/pci.../enable ?
> > >
> > > Thanks,
> > > Hans
> >
> > No. By writing to the command register using
> > /sys/bus/pci/devices/.../config
>
> Hope that works at all times...
> Anyway, the spin_lock in uio_pci_generic.c definetly doesn't help.
>
> Thanks,
> Hans

True.


\
 
 \ /
  Last update: 2011-08-09 13:39    [W:0.062 / U:2.080 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site