Unifying receivers (recvr_type_dj) announce paired devices through DJ "device paired" notifications, which carry the full bitmask of reports the device supports. Before commit 74808f9115ce ("HID: logitech-dj: add support for non unifying receivers"), HID++ reports for a slot without a known device were dropped. That commit made HID++ 0x41 "device connected" notifications for such slots create the device instead, so that non-DJ receivers, which do not send DJ pairing notifications, can be supported. This also applies to Unifying receivers. For Unifying receivers this produces a broken device. The HID++ notification only identifies the device type, and logi_hidpp_dev_conn_notif_equad() only sets reports for keyboards and mice. Unifying trackballs, touchpads, numpads and presenters get an empty report descriptor, so no driver can bind to them, and keyboards with a built-in touchpad such as the K400 lose their mouse reports. Since the slot is then populated, the correct DJ pairing notification for it is ignored until the receiver is unplugged. This happens whenever such a notification arrives for a slot the driver does not know about yet, for example after the receiver was probed while a KVM switch had focus on another host, or after a device was paired while the receiver was switched away. HID++ connect notifications are sent when a device reconnects, and when userspace (e.g. Solaar on startup) asks the receiver to re-announce its devices. On Unifying receivers, queue the unknown-device work instead, which enumerates the paired devices through DJ notifications. Fixes: 74808f9115ce ("HID: logitech-dj: add support for non unifying receivers") Cc: stable@vger.kernel.org Assisted-by: LLM Signed-off-by: Mark Pariente --- drivers/hid/hid-logitech-dj.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/hid/hid-logitech-dj.c b/drivers/hid/hid-logitech-dj.c index 6e8db01d27ec..383c762c503f 100644 --- a/drivers/hid/hid-logitech-dj.c +++ b/drivers/hid/hid-logitech-dj.c @@ -1766,7 +1766,13 @@ static int logi_dj_hidpp_event(struct hid_device *hdev, if (dj_dev) { logi_dj_recv_forward_report(dj_dev, data, size); } else { - if (hidpp_report->sub_id == REPORT_TYPE_NOTIF_DEVICE_CONNECTED) + /* + * DJ receivers announce devices through DJ pairing + * notifications, which carry the full list of supported + * reports, so query those instead. + */ + if (djrcv_dev->type != recvr_type_dj && + hidpp_report->sub_id == REPORT_TYPE_NOTIF_DEVICE_CONNECTED) logi_hidpp_recv_queue_notif(hdev, hidpp_report); else logi_dj_recv_queue_unknown_work(djrcv_dev); -- 2.56.0