Initially there was a LOR between hardware driver's and evdev client list locks as they were taken in different order at driver's interrupt and evdev open()/close() handlers.
The LOR was fixed with introduction of evdev_register_mtx() function which allowed to use a hardware driver's lock as evdev client list lock.
This works well with PS/2 and USB but not with I2C. Unlike PS/2 and USB, I2C open()/close() handlers want to do unbound sleeps while waiting for I2C bus to release and just to perform IO.
sysutil/iichid solved this problem with using a taskqueue.
This change uses different approach. It uses epoch(9) in interrupt handler for traversing evdev client list to avoid the LOR thus making possible to convert evdev client list lock to sleepable sx.
Besides that this change allows open() handler to be interrupted by a signal
It is possible that the client list lock is taken by other process for too long due to e.g. IO timeouts. Allow user to terminate open() in this case.
This revision is subset of https://reviews.freebsd.org/D27777