From patchwork Wed Dec 7 14:24:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Tissoires X-Patchwork-Id: 30880 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp215005wrr; Wed, 7 Dec 2022 06:26:47 -0800 (PST) X-Google-Smtp-Source: AA0mqf4CtGdbzyS2wJ6cPIRIViYsBAyKML1mGZ8fdza4jnyvimYHscI/WeE3vnBACBc+B002Ja2n X-Received: by 2002:a17:906:442:b0:7ad:7d4a:ec2c with SMTP id e2-20020a170906044200b007ad7d4aec2cmr61773660eja.710.1670423206925; Wed, 07 Dec 2022 06:26:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670423206; cv=none; d=google.com; s=arc-20160816; b=yfn2GiQ0DJblQTavQV4yqp8SwMo/vLD1bA/6HD9KQETBId9OSw2aWQdvaAULwGF8XT OsZMC5V9w0c4nEDmZveLduRKt/pbeVVq0/THNSatdLN0IrZRlrbvNcGXDzZnY9OF3QQA hHajVthb4D78j2iEp4p2sQieB28H2U/yUvnTf9nsYSigBHmR54JgqQJNkooS8/iR0anH kKVgAwIlltBLSb6tLGEVhce3xhYwdQcRtpeXR4Ie37fLYGbvTXtqcGGnwkGdcT3glmlw fkb6NuLhIai9w9Qr5v+OyFH060ZHIIc05cmL80uMl4NEf9SPR8q5Cl5djcYD9LjQI9O7 OjeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=TmWV6JJXX2IbwOxPwXg6rSo3yOZsgsIg/Im1bYjsqiQ=; b=sVqafAr9y5zBBxh6b5Jj5M5dAy5mFe9B4AXlXbT1PBXQbtnpuBBdOL6c0ZizzeXsxE 4kFN2CjWZPERvUyArdqycM2yo2XAVAKyXILquFS8+CX9Eyz2vHoIPbG5nJQpTiQ+hFnh lTymhqYFg6zzq1Szrf7eL6QqENmnsYdU9zf2gebE+JIuS5XHCxcYnv7EOaX/7q2b5lOJ fGKgs0gh/MWLUq+wRafJchGR/nv1n4RBQRNCCQQ0qc9oTdzlG+CnhElusXXnszPZDoxt GvgVTNm2vwGrFm5QUviToUkb7vzXkcitK7H2WiPhpgF08htlkN/0ocoqDQLgxOvFyGZv 1AxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=F9RTEVrK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i17-20020a1709064fd100b007bbf9652314si18842259ejw.435.2022.12.07.06.26.22; Wed, 07 Dec 2022 06:26:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=F9RTEVrK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229825AbiLGOZj (ORCPT + 99 others); Wed, 7 Dec 2022 09:25:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51730 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229612AbiLGOZh (ORCPT ); Wed, 7 Dec 2022 09:25:37 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 59A8011C36 for ; Wed, 7 Dec 2022 06:24:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1670423084; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TmWV6JJXX2IbwOxPwXg6rSo3yOZsgsIg/Im1bYjsqiQ=; b=F9RTEVrKM2NK8sY81D7NC70ibe44kmKRFjYeb3eR+GztzbPmUVUybjh/PGq2YN760CErXh OocQIs5wEjPpS3g3ZlWrYm0nRpywau4+RjUbDD9ih+AnGSbXalTeZe4s8m59AAVkH47xXk Ypn9UFf5Azu58ygLbQTkky5niSAo5qY= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-627-195Ayh0-O2SviCiQ6OnBhQ-1; Wed, 07 Dec 2022 09:24:41 -0500 X-MC-Unique: 195Ayh0-O2SviCiQ6OnBhQ-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6147E1C0A58E; Wed, 7 Dec 2022 14:24:40 +0000 (UTC) Received: from plouf.redhat.com (unknown [10.39.193.117]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0ECC42027061; Wed, 7 Dec 2022 14:24:38 +0000 (UTC) From: Benjamin Tissoires To: Jiri Kosina , =?utf-8?q?Filipe_La=C3=ADns?= , "Rafael J . Wysocki" , Bastien Nocera , Thorsten Leemhuis Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Benjamin Tissoires Subject: [PATCH v1 1/2] Revert "HID: logitech-hidpp: Remove special-casing of Bluetooth devices" Date: Wed, 7 Dec 2022 15:24:32 +0100 Message-Id: <20221207142433.1158329-2-benjamin.tissoires@redhat.com> In-Reply-To: <20221207142433.1158329-1-benjamin.tissoires@redhat.com> References: <20221207142433.1158329-1-benjamin.tissoires@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1751565684812792631?= X-GMAIL-MSGID: =?utf-8?q?1751565684812792631?= This reverts commit 8544c812e43ab7bdf40458411b83987b8cba924d. We need to revert commit 532223c8ac57 ("HID: logitech-hidpp: Enable HID++ for all the Logitech Bluetooth devices") because that commit might make hid-logitech-hidpp bind on mice that are not well enough supported by hid-logitech-hidpp, and the end result is that the probe of those mice is now returning -ENODEV, leaving the end user with a dead mouse. Given that commit 8544c812e43a ("HID: logitech-hidpp: Remove special-casing of Bluetooth devices") is a direct dependency of 532223c8ac57, revert it too. Note that this also adapt according to commit 908d325e1665 ("HID: logitech-hidpp: Detect hi-res scrolling support") to re-add support of the devices that were removed from that commit too. I have locally an MX Master and I tested this device with that revert, ensuring we still have high-res scrolling. Signed-off-by: Benjamin Tissoires --- drivers/hid/hid-logitech-hidpp.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/hid/hid-logitech-hidpp.c b/drivers/hid/hid-logitech-hidpp.c index 9afbc68bf063..f11890f65c06 100644 --- a/drivers/hid/hid-logitech-hidpp.c +++ b/drivers/hid/hid-logitech-hidpp.c @@ -4367,6 +4367,15 @@ static const struct hid_device_id hidpp_devices[] = { { /* MX5500 keyboard over Bluetooth */ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_LOGITECH, 0xb30b), .driver_data = HIDPP_QUIRK_HIDPP_CONSUMER_VENDOR_KEYS }, + { /* M-RCQ142 V470 Cordless Laser Mouse over Bluetooth */ + HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_LOGITECH, 0xb008) }, + { /* MX Master mouse over Bluetooth */ + HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_LOGITECH, 0xb012) }, + { /* MX Ergo trackball over Bluetooth */ + HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_LOGITECH, 0xb01d) }, + { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_LOGITECH, 0xb01e) }, + { /* MX Master 3 mouse over Bluetooth */ + HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_LOGITECH, 0xb023) }, { /* And try to enable HID++ for all the Logitech Bluetooth devices */ HID_DEVICE(BUS_BLUETOOTH, HID_GROUP_ANY, USB_VENDOR_ID_LOGITECH, HID_ANY_ID) }, From patchwork Wed Dec 7 14:24:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Tissoires X-Patchwork-Id: 30881 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp215554wrr; Wed, 7 Dec 2022 06:27:53 -0800 (PST) X-Google-Smtp-Source: AA0mqf4rvYbPHIyb1Z6sKoGwN3oncyaxuKLAM7Hc6YqunwieZlM2XLjrlbBe6gEF2iBz4+C09Oj6 X-Received: by 2002:a05:6402:d74:b0:46d:1a33:2197 with SMTP id ec52-20020a0564020d7400b0046d1a332197mr6178476edb.282.1670423273437; Wed, 07 Dec 2022 06:27:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670423273; cv=none; d=google.com; s=arc-20160816; b=d/571v+Rl5cbFltXR0GqXF4nKDXcQzMc1h1Tto6q/5+hOB0ykKMEjuixrGdL9m87ck neERSrD3PvBYJG6CwN15cTiwTFcKSIfkonLzwdnjZFg4F9pvOcYTa9H6taHc661V9Jlt /Ph/U4TwZIkn6pm+wH80DExULkCxtogTDWEn0iLPQvT6EAWauQtCI6BaWtnzHwtwhIWC 5oPn8o+WHubpQvHmoIfafvIngYTJGod9GuGOJ+qFBfVON1BS0xjZZF53gva5VSg/bQvr YIM/DFuRrRkMkb6qhQsT8UVATaKtNhdDFAZkLX4innktNqtj3Nsc3O4Uy91pIvpYLeDe J1iw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=9NVnDQLtbjn77YDKLnB8ntVnNNT30a6KgFCsUYPTGIE=; b=oyq+2MzdMhVSXsPUZ+QrWhoDzXksV8FBM4rzC0BR4BcqIngv2v2rmr2aGOTULMpULc tVYz/N13N0jnxteYx4IBbgqR+RA7gISYdgKmqXAThW5RRSqPa4zblJkIgU2Jb0fn+4c0 0OzF+wXK9WadYkpBHGkiAnVaIpvHsYxFVSp/TJOVIzW4WIsK0MtgD0mIGQ4fP+Utxctb 573xBQTxESM54FZkdFDjfp4Ml2hShMpgVvKZlJIfsLG7qYjXTsTfsVjDiYpPh0UwS6gO kgdHErw8Sc8o0Si/tccV6VOOMPwxZRy52BmyeROz+i3a1sj7Xz/gIjJ+1sxvVaz+sIUC 655Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=fJSsYcnH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gt15-20020a1709072d8f00b007bad1338dd3si18599630ejc.851.2022.12.07.06.27.29; Wed, 07 Dec 2022 06:27:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=fJSsYcnH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230155AbiLGO0B (ORCPT + 99 others); Wed, 7 Dec 2022 09:26:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51722 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229836AbiLGOZl (ORCPT ); Wed, 7 Dec 2022 09:25:41 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6CECD1147F for ; Wed, 7 Dec 2022 06:24:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1670423083; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9NVnDQLtbjn77YDKLnB8ntVnNNT30a6KgFCsUYPTGIE=; b=fJSsYcnHqCqYAdlfUbFNDgqxgSTyDDNisUfxOir31Gzl2SMeBWDwFnyKBTGL8BGI1F7pWl H9edR9BNCt4YmYvB7xt/F259hVPxQ1S0bhr6oUMa3DmSUGKjef8Q/WrEAX30+yBM+L7sBN kZf2bZT9uItqIPpww/BpWND68BpfVDI= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-495-oEbsQfYbN1WcYW-T-XkgdQ-1; Wed, 07 Dec 2022 09:24:42 -0500 X-MC-Unique: oEbsQfYbN1WcYW-T-XkgdQ-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id EFEB83C10EC8; Wed, 7 Dec 2022 14:24:41 +0000 (UTC) Received: from plouf.redhat.com (unknown [10.39.193.117]) by smtp.corp.redhat.com (Postfix) with ESMTP id A29F22027061; Wed, 7 Dec 2022 14:24:40 +0000 (UTC) From: Benjamin Tissoires To: Jiri Kosina , =?utf-8?q?Filipe_La=C3=ADns?= , "Rafael J . Wysocki" , Bastien Nocera , Thorsten Leemhuis Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Benjamin Tissoires Subject: [PATCH v1 2/2] Revert "HID: logitech-hidpp: Enable HID++ for all the Logitech Bluetooth devices" Date: Wed, 7 Dec 2022 15:24:33 +0100 Message-Id: <20221207142433.1158329-3-benjamin.tissoires@redhat.com> In-Reply-To: <20221207142433.1158329-1-benjamin.tissoires@redhat.com> References: <20221207142433.1158329-1-benjamin.tissoires@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1751565754004879456?= X-GMAIL-MSGID: =?utf-8?q?1751565754004879456?= This reverts commit 532223c8ac57605a10e46dc0ab23dcf01c9acb43. As reported in [0], hid-logitech-hidpp now binds on all bluetooth mice, but there are corner cases where hid-logitech-hidpp just gives up on the mouse. This leads the end user with a dead mouse. Given that we are at -rc8, we are definitively too late to find a proper fix. We already identified 2 issues less than 24 hours after the bug report. One in that ->match() was never designed to be used anywhere else than in hid-generic, and the other that hid-logitech-hidpp has corner cases where it gives up on devices it is not supposed to. So we have no choice but postpone this patch to the next kernel release. [0] https://lore.kernel.org/linux-input/CAJZ5v0g-_o4AqMgNwihCb0jrwrcJZfRrX=jv8aH54WNKO7QB8A@mail.gmail.com/ Signed-off-by: Benjamin Tissoires --- drivers/hid/hid-logitech-hidpp.c | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/drivers/hid/hid-logitech-hidpp.c b/drivers/hid/hid-logitech-hidpp.c index f11890f65c06..c6e4a96e882e 100644 --- a/drivers/hid/hid-logitech-hidpp.c +++ b/drivers/hid/hid-logitech-hidpp.c @@ -4269,21 +4269,6 @@ static void hidpp_remove(struct hid_device *hdev) mutex_destroy(&hidpp->send_mutex); } -static const struct hid_device_id unhandled_hidpp_devices[] = { - /* Logitech Harmony Adapter for PS3, handled in hid-sony */ - { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_HARMONY_PS3) }, - /* Handled in hid-generic */ - { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_DINOVO_EDGE_KBD) }, - {} -}; - -static bool hidpp_match(struct hid_device *hdev, - bool ignore_special_driver) -{ - /* Refuse to handle devices handled by other HID drivers */ - return !hid_match_id(hdev, unhandled_hidpp_devices); -} - #define LDJ_DEVICE(product) \ HID_DEVICE(BUS_USB, HID_GROUP_LOGITECH_DJ_DEVICE, \ USB_VENDOR_ID_LOGITECH, (product)) @@ -4376,9 +4361,6 @@ static const struct hid_device_id hidpp_devices[] = { { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_LOGITECH, 0xb01e) }, { /* MX Master 3 mouse over Bluetooth */ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_LOGITECH, 0xb023) }, - - { /* And try to enable HID++ for all the Logitech Bluetooth devices */ - HID_DEVICE(BUS_BLUETOOTH, HID_GROUP_ANY, USB_VENDOR_ID_LOGITECH, HID_ANY_ID) }, {} }; @@ -4392,7 +4374,6 @@ static const struct hid_usage_id hidpp_usages[] = { static struct hid_driver hidpp_driver = { .name = "logitech-hidpp-device", .id_table = hidpp_devices, - .match = hidpp_match, .report_fixup = hidpp_report_fixup, .probe = hidpp_probe, .remove = hidpp_remove,