From: Jiri Slaby <jslaby@suse.cz>
To: mathieu.poirier@linaro.org
Cc: linux-kernel@vger.kernel.org, arve@android.com,
kernel-team@android.com, dmitry.torokhov@gmail.com,
john.stultz@linaro.org
Subject: Re: [PATCH] [RFC]: drivers/tty: Folding Android's keyreset driver in sysRQ
Date: Fri, 17 Aug 2012 23:39:42 +0200 [thread overview]
Message-ID: <502EBA1E.2030807@suse.cz> (raw)
In-Reply-To: <1345154810-1509-1-git-send-email-mathieu.poirier@linaro.org>
On 08/17/2012 12:06 AM, mathieu.poirier@linaro.org wrote:
> +static int do_keyreset_event(struct sysrq_state *state,
> + unsigned int code, int value)
> +{
> + int ret;
> + int processed = 0;
> +
> + /* Is the code is of interestest to us */
> + if (!test_bit(code, state->keybit))
> + return processed;
> +
> + /* No need to take care of key up events */
> + if (!test_bit(code, state->key) == !value)
> + return processed;
> +
> + /* Record new entry */
> + __change_bit(code, state->key);
Hmm, this function is not atomic. Can do_keyreset_event be called
simultaneously from different CPUs? I suppose not...
> + if (value && !state->restart_disabled &&
> + state->key_down_ctn == state->key_down_target) {
> + state->restart_disabled = 1;
> + if (atomic_read(&restart_requested))
> + panic(KERN_ERR "keyboard reset failed, %d - panic\n",
> + atomic_read(&restart_requested));
panic() does not take KERN_* prefixes.
regards,
--
js
suse labs
prev parent reply other threads:[~2012-08-17 21:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-16 22:06 mathieu.poirier
2012-08-17 13:36 ` Alan Cox
2012-08-17 21:39 ` Jiri Slaby [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=502EBA1E.2030807@suse.cz \
--to=jslaby@suse.cz \
--cc=arve@android.com \
--cc=dmitry.torokhov@gmail.com \
--cc=john.stultz@linaro.org \
--cc=kernel-team@android.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mathieu.poirier@linaro.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
Powered by JetHome