All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mathieu Poirier <mathieu.poirier@linaro.org>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: arve@android.com, linux-input@vger.kernel.org,
	kernel-team@android.com, john.stultz@linaro.org
Subject: Re: [PATCH v3] sysrq: supplementing reset sequence with timeout functionality
Date: Mon, 01 Apr 2013 13:22:02 -0600	[thread overview]
Message-ID: <5159DE5A.4090909@linaro.org> (raw)
In-Reply-To: <20130331073654.GE7919@core.coreip.homeip.net>

On 13-03-31 01:36 AM, Dmitry Torokhov wrote:
> @@ -748,10 +758,13 @@ static bool sysrq_handle_keypress(struct sysrq_state *sysrq,
>  		if (was_active)
>  			schedule_work(&sysrq->reinject_work);
>  
> -		if (sysrq_detect_reset_sequence(sysrq, code, value)) {
> -			/* Force emergency reboot */
> -			__handle_sysrq(sysrq_xlate[KEY_B], false);
> -		}
> +		if (!sysrq_detect_reset_sequence(sysrq, code, value))
> +			del_timer(&sysrq->keyreset_timer);

I tested this code and it doesn't work.  When all the keys in a reset
combo are asserted and held down the code and value of the last key
keeps on being generated.  Since the only time
'sysrq_detect_reset_sequence' returns true is when

'++state->reset_seq_cnt == state->reset_seq_len &&
                                                !state->reset_canceled'

the very next input event to come in (after a key combo has been
discovered) cancel the timer.

I will send a 'v4' version of my initial patch that will:
- cancel the timer when more keys are pressed
- trigger a reset right away when no timeout value has been specified.
- deal with the miscellaneous name changes.

> +		else if (sysrq_reset_downtime_ms)
> +			mod_timer(&sysrq->keyreset_timer,
> +				jiffies + msecs_to_jiffies(sysrq_reset_downtime_ms));
> +		else
> +			sysrq_do_reset(0);


      reply	other threads:[~2013-04-01 19:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-22 14:36 [PATCH v3] sysrq: supplementing reset sequence with timeout functionality mathieu.poirier
2013-03-31  7:36 ` Dmitry Torokhov
2013-04-01 19:22   ` Mathieu Poirier [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=5159DE5A.4090909@linaro.org \
    --to=mathieu.poirier@linaro.org \
    --cc=arve@android.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=john.stultz@linaro.org \
    --cc=kernel-team@android.com \
    --cc=linux-input@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.