Messages in this thread | | | Date | Fri, 17 Aug 2012 23:39:42 +0200 | From | Jiri Slaby <> | Subject | Re: [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
| |