linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Aniroop Mathur <a.mathur@samsung.com>
Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
	aniroop.mathur@gmail.com
Subject: Re: [PATCH] [v8]Input: evdev: fix bug of dropping valid packet after syn_dropped event
Date: Thu, 21 Jan 2016 11:17:25 -0800	[thread overview]
Message-ID: <20160121191725.GA39970@dtor-ws> (raw)
In-Reply-To: <1453397839-942-1-git-send-email-a.mathur@samsung.com>

Hi Anoroop,

On Thu, Jan 21, 2016 at 11:07:19PM +0530, Aniroop Mathur wrote:
> If last event dropped in the old queue was EVi_SYN/SYN_REPORT, then lets
> generate EV_SYN/SYN_REPORT immediately after queing EV_SYN/SYN_DROPPED
> so that clients would not ignore next valid full packet events.
> 
> Signed-off-by: Aniroop Mathur <a.mathur@samsung.com>
> ---
>  drivers/input/evdev.c | 46 ++++++++++++++++++++++++++++++++++------------
>  1 file changed, 34 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c
> index e9ae3d5..821b68a 100644
> --- a/drivers/input/evdev.c
> +++ b/drivers/input/evdev.c
> @@ -156,7 +156,12 @@ static void __evdev_flush_queue(struct evdev_client *client, unsigned int type)
>  static void __evdev_queue_syn_dropped(struct evdev_client *client)
>  {
>  	struct input_event ev;
> +	struct input_event *last_ev;
>  	ktime_t time;
> +	unsigned int mask = client->bufsize - 1;
> +
> +	/* capture last event stored in the buffer */
> +	last_ev = &client->buffer[(client->head - 1) & mask];

I have still the same comment. How do you know that event at last_ev
position is in fact valid and unconsumed yet event. Also, you need to
figure out not only if queue contains last SYN event, but also to handle
the case where the queue is empty and client has consumed either full or
partial packet at the time you are queueing the drop.

Also please enumerate what changes you done between version n and n+1 so
I do not have to compare them line by line trying to figure it out
myself.

Thanks.

-- 
Dmitry

  reply	other threads:[~2016-01-21 19:17 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-21 17:37 [PATCH] [v8]Input: evdev: fix bug of dropping valid packet after syn_dropped event Aniroop Mathur
2016-01-21 19:17 ` Dmitry Torokhov [this message]
2016-01-23 17:59   ` Aniroop Mathur
2016-01-23 18:39     ` Dmitry Torokhov
2016-01-23 20:05       ` Aniroop Mathur
2016-01-25 18:01         ` Aniroop Mathur
2016-02-11 18:01           ` Aniroop Mathur
2016-10-04 18:38         ` Aniroop Mathur

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=20160121191725.GA39970@dtor-ws \
    --to=dmitry.torokhov@gmail.com \
    --cc=a.mathur@samsung.com \
    --cc=aniroop.mathur@gmail.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).