lkml.org 
[lkml]   [2011]   [Apr]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 4/4] input: evdev: Make device readable only when it contains a complete packet.
On Tue, Apr 05, 2011 at 02:03:27PM +0200, Henrik Rydberg wrote:
> > >> Should use client->head here so that the SYN_DROPPED is readable.
> > >
> > > It is readable, but we do not want to signal on it.
> >
> > I think we do want to signal on it. We should signal whenever the
> > device becomes readable.
> >
> > Signaling on dropped is useful in the case where a misbehaving device
> > driver fails to ever call input_sync. If that happens, we might
> > enqueue a dropped event and then never wake up the client which makes
> > the issue hard to diagnose.
>
> A device that never wakes up the client seems like a detectable
> symptom. I agree with Dmitry, the dropped event is more of a note in
> passing, and as such can stay in the pipe until a real EV_SYN event
> comes along.

Also we have evbug module to report raw event stream from theinput core
without evdev involvement. It should show missing SYN_REPORT should such
a driver appear.

>
> > >> I don't think it's safe to modify last_syn outside of the spin lock.
> > >> This should be done above.
> > >
> > > This is the only writer, plus we are running under event_lock with
> > > interrupts off, so it is safe.
> >
> > The value will be read concurrently by evdev_fetch_next_event. So if
> > this were safe, then we wouldn't need the spin lock at all.
>
> The spinlock ensures atomic read/write of the event buffer. The
> position into the buffer does not need the lock.
>
> > At the very least for the sake of consistency, I think we should keep
> > the buffer manipulations within the guarded region.
>
> Sounds reasonable.

OK, we can pull kill_fasync inside spin_lock/unlock pair, it should
change nothing.

--
Dmitry


\
 
 \ /
  Last update: 2011-04-05 18:35    [W:0.064 / U:0.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site