linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Henrik Rydberg" <rydberg@euromail.se>
To: Jeffrey Brown <jeffbrown@android.com>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	djkurtz@google.com, linux-input@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 4/4] input: evdev: Make device readable only when it contains a complete packet.
Date: Tue, 5 Apr 2011 14:03:27 +0200	[thread overview]
Message-ID: <20110405120327.GA19300@polaris.bitmath.org> (raw)
In-Reply-To: <BANLkTinLcXsZpHm3_uzRUEdrJQsbozgghA@mail.gmail.com>

> >> 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.

> >> 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.

Thanks,
Henrik

  reply	other threads:[~2011-04-05 12:03 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-02  6:54 [PATCH v2 1/4] input: Set default events per packet Jeff Brown
2011-04-02  6:54 ` [PATCH v2 2/4] hid: hid-input: Remove obsolete default events per packet setting Jeff Brown
2011-04-05 12:20   ` Henrik Rydberg
2011-04-02  6:54 ` [PATCH v2 3/4] input: evdev: Indicate buffer overrun with SYN_DROPPED Jeff Brown
2011-04-04 21:33   ` Dmitry Torokhov
2011-04-04 21:52     ` Jeffrey Brown
2011-04-05 11:41     ` Henrik Rydberg
2011-04-02  6:54 ` [PATCH v2 4/4] input: evdev: Make device readable only when it contains a complete packet Jeff Brown
2011-04-04 21:36   ` Dmitry Torokhov
2011-04-04 22:16     ` Jeffrey Brown
2011-04-04 22:46       ` Dmitry Torokhov
2011-04-05  0:34         ` Jeffrey Brown
2011-04-05 12:03           ` Henrik Rydberg [this message]
2011-04-05 16:32             ` Dmitry Torokhov
2011-04-05 16:38           ` Dmitry Torokhov
2011-04-11 20:15             ` Jeffrey Brown
2011-04-05 12:16 ` [PATCH v2 1/4] input: Set default events per packet Henrik Rydberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110405120327.GA19300@polaris.bitmath.org \
    --to=rydberg@euromail.se \
    --cc=djkurtz@google.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=jeffbrown@android.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).