Re: [PATCH] Input: evdev: avoid storing newest SYN_REPORT when dropping all events

From: Dmitry Torokhov
Date: Mon Dec 28 2015 - 18:41:31 EST


Hi Aniroop,

On Thu, Dec 24, 2015 at 11:25 AM, Aniroop Mathur <a.mathur@xxxxxxxxxxx> wrote:
> The newest event can be SYN_REPORT in case of dropping all old events when
> buffer is full, but as now there is no device data available to read so
> lets drop SYN_REPORT as well and store only SYN_DROPPED.
>

We can not drop the SYN_REPORT event in this case as userspace needs
it to determine if the events that are coming after SYN_DROPPED are
part of a full packet or if they belong to a partial packet. From
Documentation/input/event-codes.txt:

* SYN_DROPPED:
- Used to indicate buffer overrun in the evdev client's event queue.
Client should ignore all events up to and including next SYN_REPORT
event and query the device (using EVIOCG* ioctls) to obtain its
current state.

Thanks.

--
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/