linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Laura Abbott <labbott@fedoraproject.org>
Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-usb@vger.kernel.org
Subject: Re: [PATCH] Input: xpad - Fix double URB submission races
Date: Wed, 29 Jul 2015 23:45:45 -0700	[thread overview]
Message-ID: <20150730064545.GA35939@dtor-ws> (raw)
In-Reply-To: <1438205243-14722-1-git-send-email-labbott@fedoraproject.org>

Hi Laura,

On Wed, Jul 29, 2015 at 02:27:23PM -0700, Laura Abbott wrote:
@@ -791,6 +796,9 @@ static int xpad_play_effect(struct input_dev *dev, void *data, struct ff_effect
>  {
>  	struct usb_xpad *xpad = input_get_drvdata(dev);
>  
> +	if (test_and_set_bit(OUT_IRQ_SUBMITTED, &xpad->odata_flags))
> +		return 0;
> +

So this results in basically ignoring the request if urb is "busy" which
is not the best way of handling this. You need to note that there is
pending effect to be played and submit it after currently executing
request completes.

The same needs to be done for led toggling request.

Thanks.

-- 
Dmitry

      reply	other threads:[~2015-07-30  6:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-29 21:27 [PATCH] Input: xpad - Fix double URB submission races Laura Abbott
2015-07-30  6:45 ` Dmitry Torokhov [this message]

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=20150730064545.GA35939@dtor-ws \
    --to=dmitry.torokhov@gmail.com \
    --cc=labbott@fedoraproject.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@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).