lkml.org 
[lkml]   [2012]   [Aug]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] [RFC]: drivers/tty: Folding Android's keyreset driver in sysRQ
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


\
 
 \ /
  Last update: 2012-08-18 00:21    [W:0.096 / U:0.852 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site