From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Felix Rueegg <felix.rueegg@gmail.com>
Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] input: ff-memless: don't schedule already playing effect to play again
Date: Tue, 4 Mar 2014 09:07:32 -0800 [thread overview]
Message-ID: <20140304170731.GA30486@core.coreip.homeip.net> (raw)
In-Reply-To: <1393760143-5986-1-git-send-email-felix.rueegg@gmail.com>
Hi Felix,
On Sun, Mar 02, 2014 at 12:35:43PM +0100, Felix Rueegg wrote:
> When an effect with zero replay length, zero replay delay
> and zero envelope attack length is uploaded, it is played and then scheduled to play
> again one timer tick later. This triggers a warning (URB submitted while
> active) in combination with the xpad driver.
>
> Skipping the rescheduling of this effect fixes the issue.
Won't the same issue happen if we happen to schedule a different effect
that would start at "now" time? We should not be "dropping" the new
effect, at least not in core.
It looks to me xpad.c needs [more] love.
>
> Signed-off-by: Felix Rueegg <felix.rueegg@gmail.com>
> ---
> drivers/input/ff-memless.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/input/ff-memless.c b/drivers/input/ff-memless.c
> index 74c0d8c..2e06948 100644
> --- a/drivers/input/ff-memless.c
> +++ b/drivers/input/ff-memless.c
> @@ -139,10 +139,13 @@ static void ml_schedule_timer(struct ml_device *ml)
> if (!test_bit(FF_EFFECT_STARTED, &state->flags))
> continue;
>
> - if (test_bit(FF_EFFECT_PLAYING, &state->flags))
> + if (test_bit(FF_EFFECT_PLAYING, &state->flags)) {
> next_at = calculate_next_time(state);
> - else
> + if (next_at == now)
> + continue;
> + } else {
> next_at = state->play_at;
> + }
>
> if (time_before_eq(now, next_at) &&
> (++events == 1 || time_before(next_at, earliest)))
> --
> 1.9.0
>
Thanks.
--
Dmitry
next prev parent reply other threads:[~2014-03-04 17:07 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-02 11:35 [PATCH] input: ff-memless: don't schedule already playing effect to play again Felix Rueegg
2014-03-02 13:17 ` Elias Vanderstuyft
[not found] ` <1452937.KaXPu2ynQ6@sigyn>
2014-03-02 13:36 ` Fwd: " Elias Vanderstuyft
2014-03-02 13:37 ` Michal Malý
2014-03-04 17:07 ` Dmitry Torokhov [this message]
2014-03-06 18:05 ` Felix Rueegg
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=20140304170731.GA30486@core.coreip.homeip.net \
--to=dmitry.torokhov@gmail.com \
--cc=felix.rueegg@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).