Re: [PATCH] [RFC]: drivers/tty: Folding Android's keyreset driverin sysRQ

From: Jiri Slaby
Date: Fri Aug 17 2012 - 17:39:46 EST


On 08/17/2012 12:06 AM, mathieu.poirier@xxxxxxxxxx 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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/