HID: surface-hid: Add support for hot-removal
authorMaximilian Luz <luzmaximilian@gmail.com>
Fri, 27 May 2022 02:34:42 +0000 (04:34 +0200)
committerHans de Goede <hdegoede@redhat.com>
Mon, 13 Jun 2022 15:25:08 +0000 (17:25 +0200)
commit2c2c3a07086c910719dc7135f1d871d2c6c022fc
tree19785dbf7b2ddfc5be6ae7bf3a2eea81021121c4
parentb49ba26bec452d3065e09327fbda79d7120a9f9d
HID: surface-hid: Add support for hot-removal

Add support for hot-removal of SSAM HID client devices.

Once a device has been hot-removed, further communication with it should
be avoided as it may fail and time out. While the device will be removed
as soon as we detect hot-removal, communication may still occur during
teardown, especially when unregistering notifiers.

While hot-removal is a surprise event that can happen at any time, try
to avoid communication as much as possible once it has been detected to
prevent timeouts that can slow down device removal and cause issues,
e.g. when quickly re-attaching the device.

Signed-off-by: Maximilian Luz <luzmaximilian@gmail.com>
Link: https://lore.kernel.org/r/20220527023447.2460025-8-luzmaximilian@gmail.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
drivers/hid/surface-hid/surface_hid_core.c