From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796497714; b=Glx3VZ1b/acrszoGZeemaCcjIfpGCgs8UISv57+IfqbD//i5bl1lgtb9JpljoNElD0sF aSnsIbbHnDcHWDAFaTYuI+jiAJoCZF/yIu2citqcFU78RzndxbDTxeKMpBUdZeti4Zsf9 oT6Q9lxB1X4NcRaz7+a+ipM/oRCMfbP/ixRoJ3HNdJXhe7lJbHmdVAQ0FAQyIQV2iE2hF pcOPNE6WsCOSSxnn1zdyaXSs2RM4D3LNzHYIKaphqNbM51d2/wjH6vXZ3xz0VvApJgZx6 sChu4MOIKwEv6Sp/USZRSRIffLW5cDHDZ46U2WGv2IeXNT0cKSB2CtIlQSPRdPoBDXg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796497714; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=DRReeVqQ7ao+l+Ft2pdD/hH7bhlZZ86Oek4+n+neXJk=; b=o10KSrG8kryIV2Qbn+AwvNJ8peOouBGEcYxDaF9eSHes4geaDVYA5QeO52otmqJ5pzD5 duJWSoAVLYa8qbzgsn9OTJ0vhTd+RKEHHeVpAYj6GTpoxd1NE9meq4QW8ULi0PpZ/qM80 uDN8DC4OYbTxxRCi5XoxHsOWBf2KOdNVUkSLORYHxVHt3Dd+pe99e1OcLJP5bR9B+rnqJ WGN78+Pm+DkURdAMNb8tRHqzBPLjcFAU66cKXZEjYwOXBaN5DNKGKpNwsHTX1bQbkq1sq N28Wi4roCadZzBXrwiih+CI37o74C0hf4t6agmjxF04qI66ripamFpvwafzYXo7OQrA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=UCzzv4RK; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4DE77606A335 for ; Sat, 5 Dec 2026 19:08:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=UCzzv4RK Received: by smtp.kernel.org (Postfix) with ESMTPSA id BB7E31F00A10; Sat, 5 Dec 2026 19:08:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796497713; bh=DRReeVqQ7ao+l+Ft2pdD/hH7bhlZZ86Oek4+n+neXJk=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=UCzzv4RK65oO4y+1y6F8snf/HuRjucTZa6vvF3pzCTW/9/JUQhNAAtT7WAo8fK6Kp nxw5pjH7Cmd8fQ5qj8AKHTtB2/Tm62l8UE2dzjz0VcbWc9XVvfhL9C9jZZTR0jLDnO KKcNNRE4JRmRCseJn5Wtq5wDvWZMM4jXVwsIm8FxRVOoqhBG5h25PTn9hQg/ZUW8i9 h/RYnxpOiSxcEiciFuiWkI6xqhVoO3nIL02+VQ+cnoiVh6Z8RtjVgPfJZjgCHdhfzD bO7eY05mK7hknV/eCUw63ZAMFID0uayyqnI/G3uBstML6tOa4vRf7I6NvVdNgu/4TS 6SyIkljsikf3Q== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v7 10/13] HID: haptic: Decouple from hid-multitouch and support other devices Reply-To: sashiko-reviews@lists.linux.dev To: "Rong Zhang" Cc: linux-input@vger.kernel.org, dmitry.torokhov@gmail.com In-Reply-To: <20261206-hid-haptic-kmod-v7-10-3eea47035836@rong.moe> References: <20261206-hid-haptic-kmod-v7-0-3eea47035836@rong.moe> <20261206-hid-haptic-kmod-v7-10-3eea47035836@rong.moe> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Sat, 05 Dec 2026 19:08:33 +0000 X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 3 potential issues to consider: - [Medium] HID: haptic: input_ff_create() clobbers dev->event and breaks EV_LED output - [Medium] HID: mt_input_mapping() drops HID_HP_SIMPLECONTROLLER manual trigger report - [Medium] HID: haptic: hid_haptic_check_prerequisites() misses hid-multitouch stylus -- commit d155e51e55b92ebbcc18762778f9eccc7eddda48 Author: Rong Zhang HID: haptic: Decouple from hid-multitouch and support other devices This commit decouples hid-haptic from hid-multitouch by adding fallback input device selection based on whether the Simple Haptic Controller is a Collection Application or a Collection Logical, and logs an info message when the haptic force-feedback device is connected. Link: https://usb.org/sites/default/files/hutrr63b_-_haptics_page_redline_0= .pdf [1] Link: https://learn.microsoft.com/en-us/windows-hardware/design/component-g= uidelines/input-haptics-implementation-guide [2] Link: https://learn.microsoft.com/en-us/windows-hardware/design/component-g= uidelines/haptic-pen-implementation-guide [3] > diff --git a/drivers/hid/hid-haptic.c b/drivers/hid/hid-haptic.c > index 40bb641fc1f5d..aae4ff1f0ccaa 100644 > --- a/drivers/hid/hid-haptic.c > +++ b/drivers/hid/hid-haptic.c [ ... ] > @@ -566,19 +567,55 @@ static int hid_haptic_init(struct hid_device *hdev,= struct hid_haptic_device *ha > static int hid_haptic_check_prerequisites(struct hid_device *hdev, > struct hid_haptic_device *haptic, struct hid_input *hi) > { [ ... ] > + if (haptic->manual_trigger_report->application =3D=3D HID_HP_SIMPLECONT= ROLLER || > + hdev->quirks & HID_QUIRK_MULTI_INPUT) { > + if (list_is_first(&hi->list, &hdev->inputs)) > + return 0; [Severity: Medium] Can a standalone HID_HP_SIMPLECONTROLLER collection on a hid-multitouch device reach this check if its mt_class does not set export_all_inputs? In hidinput_configure_usage(), device->driver->input_mapping() runs before HID_UP_HAPTIC is dispatched to hid_haptic_input_mapping() and ignores the usage on a negative return. When export_all_inputs is false (e.g. MT_CLS_DEFAULT), mt_input_mapping() rejects HID_HP_SIMPLECONTROLLER. As a result, haptic->manual_trigger_report remains NULL and hid_haptic_check_prerequisites() fails with -ENOENT, leaving haptic force-feedback uninitialized on those devices. > + } else { > + list_for_each_entry(report, &hi->reports, hidinput_list) { > + if (report =3D=3D haptic->manual_trigger_report) > + return 0; > + } > + } [Severity: Medium] Does requiring exact pointer equality against haptic->manual_trigger_report miss the stylus hid_input on composite Windows 8 touchscreen and haptic pen devices bound to hid-multitouch? In hidinput_connect(), input reports are mapped before output reports. For a HID_DG_PEN application containing a HID_DG_STYLUS physical collection, mt_input_mapping() overwrites hi->application to HID_DG_STYLUS while leaving report->application as HID_DG_PEN. When manual_trigger_report is mapped next under HID_QUIRK_INPUT_PER_APP, hidinput_match_application() compares hidinput->application (HID_DG_STYLUS) against report->application (HID_DG_PEN) and puts manual_trigger_report on a separate hid_input. That separate hid_input is either discarded by hidinput_cleanup_hidinput() (dropping haptic force-feedback) or populated with only BTN_STYLUS by mt_input_configured() (attaching FF_HAPTIC to a separate input device). Matching report->application against haptic->manual_trigger_report->application, or avoiding the mismatch in hid-multitouch, would attach force-feedback to the stylus. [ ... ] > @@ -586,17 +623,22 @@ static int hid_haptic_check_prerequisites(struct hi= d_device *hdev, > static int __hid_haptic_input_configured(struct hid_device *hdev, > struct hid_haptic_device *haptic, struct hid_input *hi) > { > + bool driver_integration; > int ret; > =20 > ret =3D hid_haptic_check_prerequisites(hdev, haptic, hi); > if (ret) > return ret; > =20 > + driver_integration =3D haptic->input_dev =3D=3D hi->input; > + > ret =3D hid_haptic_init(hdev, haptic, hi->input); [Severity: Medium] Will hid_haptic_init() break EV_LED output now that hid-haptic can attach to generic HID input devices such as composite keyboard and haptic devices? hidinput_allocate() sets dev->event =3D hidinput_input_event, which handles both EV_LED output and EV_FF (by delegating to input_ff_event()). However, hid_haptic_init() calls input_ff_create(), which unconditionally overwrites dev->event with input_ff_event(). Because input_ff_event() returns 0 for non-EV_FF events, all EV_LED output such as Caps Lock or indicator LEDs is silently dropped on the attached input device. Restoring dev->event after input_ff_create() would keep EV_LED working. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261206-hid-haptic= -kmod-v7-0-3eea47035836@rong.moe?part=3D10