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=1795975830; b=nceN70wGd4TmQ5gwa6aJT48YtVda2YmYyxw0C1faXtmcQe1rXUv46hCv0JC4xSTwCcLJ YJ03cShVbgThkrJ3RzYbJ5B4zvSfTYwGEVLQIphxykZqWkUctW4/0wOng3+r7GQ0Q0jKM x6AbEkjkdj2sSDtX08+gVG46jdlp0FdPukaYYgYZ7ic8pN6KiEnfVHefcnvMTnvsAX3Bh 06bGYkGfJStO+h3WLoUqCeA2y1Zid7jGUK+G0fLsRSFhnmChIsRESjp1zRyx7IvvTrsEd PDxqvVuiizqup9YYRVg0FOsFVLCZ+zM/UfHGBtJkFode1fanbJefTz2KMk/tc+aqO4Q== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795975830; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=SmPEVViugD9jq0/I9aQJmItHx15HxIYA0Lwm/jOeoeM=; b=nUYl7Ua8KE3nHW2HLrgJzVGgK2iKtkWwykoqZmlP4idT6kZYNh7pB+I25ANZA9PS2ShO 3OE6yA8OQM94X4kfpRl7wbBRNdi1ObC+lGWu6hLU/wwUy61zqktcrLXGZBM7owqQ51tAA VOoOyZO4oEoSdiNQG763wMwb5ntiwc/jD3ATa5TUbcAai6A52zVJ3uchUm0m+r7bgNJvF R2SJu8mF3WtVmTTnuKaCbMV2Q7NtKpiDb9qFhmmpOD1CQKaqEfqbxUyjAmGV3lVF31SLy IU73VrTfiRlO/3qIIjT1KEQ8jRGTiME7CmqJreldIcvURc9Lqje+oYERZam+UK1Iq8A== 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=DEmJii+4; 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 F27A8606A31C for ; Sun, 29 Nov 2026 18:10:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=DEmJii+4 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 60DC11F00896; Sun, 29 Nov 2026 18:10:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795975829; bh=SmPEVViugD9jq0/I9aQJmItHx15HxIYA0Lwm/jOeoeM=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=DEmJii+4xx8akOnRsBl9+NmUcBf54eCvoOV4P/9IJUyNMIYijOr1prwuNq6hoCqTz 0nyHw+CQlv3hyrkEoo1/FMI9CeKq8bUvM4kHgSWT11fb4lmc6c+Gw+l4mpJkU7xEB0 ad32g4+CcFKEi0JxzLEp5apyKQUdf8uz1viuszozfgFCQKRBuP/b4kiuJVtpXFxwMc 4GvEoXV/UOJRtLkrCqtXd91tUYyQ6zfRXwhE/whBjQ0urvCSCQcfQn4n5EkO+F2kcC xIkRTmhXBM5x1tB5C6rFUjciuOM1/xuiklKnnuGn+7SzWXH9ui+Tdy0wx1xeYvtcqV Bq2sCk67SOMdA== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v5 03/13] HID: haptic, multitouch: Check haptic prerequisite properly Reply-To: sashiko-reviews@lists.linux.dev To: "Rong Zhang" Cc: linux-input@vger.kernel.org, dmitry.torokhov@gmail.com In-Reply-To: <20261130-hid-haptic-kmod-v5-3-4903f73d8cac@rong.moe> References: <20261130-hid-haptic-kmod-v5-0-4903f73d8cac@rong.moe> <20261130-hid-haptic-kmod-v5-3-4903f73d8cac@rong.moe> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Sun, 29 Nov 2026 18:10:28 +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 1 potential issue to consider: - [High] HID: multitouch: inverted guard in mt_input_configured() skips haptic init -- commit 9de6cdc8393811c21adee3b9cba77ef4b2490c87 Author: Rong Zhang HID: haptic, multitouch: Check haptic prerequisite properly This commit tightens haptic touchpad prerequisite checks by validating that all HID_DG_TIPPRESSURE usages share matching force units and annotations on= a single HID_DG_TOUCHPAD input device, and gates runtime haptic calls on the matched input device. > diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c > index f63d6f6550bd8..e017eff9b784f 100644 > --- a/drivers/hid/hid-multitouch.c > +++ b/drivers/hid/hid-multitouch.c [ ... ] > @@ -1954,14 +1954,8 @@ static int mt_input_configured(struct hid_device *= hdev, struct hid_input *hi) > struct hid_report *report; > int ret; > =20 > - if (td->is_haptic_touchpad && (td->mtclass.name =3D=3D MT_CLS_WIN_8 || > - td->mtclass.name =3D=3D MT_CLS_WIN_8_FORCE_MULTI_INPUT || > - td->mtclass.name =3D=3D MT_CLS_WIN_8_KEEP_LATENCY_ON_CLOSE)) { > - if (hid_haptic_input_configured(hdev, td->haptic, hi) =3D=3D 0) > - td->is_haptic_touchpad =3D false; > - } else { > - td->is_haptic_touchpad =3D false; > - } > + if (!td->is_haptic_touchpad) > + td->is_haptic_touchpad =3D !hid_haptic_input_configured(hdev, td->hapt= ic, hi); [Severity: High] Does the !td->is_haptic_touchpad check invert the condition and prevent hid_haptic_input_configured() from initializing haptic touchpads? During input mapping, mt_touch_input_mapping() already sets td->is_haptic_touchpad from hid_haptic_check_pressure_unit(): drivers/hid/hid-multitouch.c:mt_touch_input_mapping() { ... case HID_DG_TIPPRESSURE: set_abs(hi->input, ABS_MT_PRESSURE, field, cls->sn_pressure); td->is_haptic_touchpad =3D hid_haptic_check_pressure_unit(td->haptic, hi, field); ... } When hid_haptic_check_pressure_unit() succeeds and caches haptic->input_dev, td->is_haptic_touchpad is already true on entry to mt_input_configured(), so hid_haptic_input_configured() and hid_haptic_init() are skipped. Conversel= y, when td->is_haptic_touchpad is false on entry, haptic->input_dev is NULL or ERR_PTR(-EPROTO), so hid_haptic_check_prerequisites() fails and hid_haptic_init() is unreachable. In addition, non-haptic touchpads that report HID_DG_TIPPRESSURE in grams or newtons without haptic trigger reports are never cleared by hid_haptic_check_prerequisites(), leaving td->is_haptic_touchpad true on an uninitialized haptic device. This call is later removed in commit "HID: haptic: Convert to a loadable plugin module", but it breaks haptic initialization at this point in the series and in stable backports of this commit. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261130-hid-haptic= -kmod-v5-0-4903f73d8cac@rong.moe?part=3D3