Currently, evdev_push(), the core of evdev KPI, takes several locks during execution.
That can lead to deadlock in keyboard driver if it has been reentered from special single-threaded context (KDB/DDB) as locks are left taken by previous caller and this caller can not complete his task and drop locks while KDB/DDB is active.
One way to avoid this deadlock is to make evdev_push() lock-less:
- Internal evdev locks are aliased to external caller's (driver) lock so they are already taken when evdev_push() is called
- Userland notifications that can take private locks are made asynchronously from callout that polls internal evdev state in 20Hz (tunable) interval