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=1796238428; b=Qo6b8AqhZ18grmNLY7yvV2q6IeJdoIWpe/oQVqT/R9cIcV5DEf7K0RoPMbpmERxIyxKA 7wg73OtdZ2dEPZGMh3I0LcfVKqCCOqGiiMIl1yNIRj9y1qiyRHcd8/cDehkR38RrHrF8H VbTNHR58rhZrstTxNjhlPqRY26j+i3icRHn4qBl1J56YVz7kFFT3X9IQm9ukko/THcBJA UNPLr9qXobFxpgNCXOMEFmPU65FuqLXEHB6kNHaYi5vp7v/oolpyJlZjkGr4JZ+yxqRZl FOcFgA7LPmwMqqAUp+Od01Kvmddkscjz5a6x5ZSci6194YtfPuwHaRvu9fC6Hl02n1A== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796238428; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=/FZnfzcje0LZQ/REbNVbQT6owHr+nPjCulK/lXA9yok=; b=Ik2FJn3WTbTllLAxsIaA8hV68nk0EzhfHELMSTsQ6IF1oqXpm/P2M5sTfSs4SdGp8usr VTvv8frVx9JGzPbQ7RCVvESJFYjqqUWI3BEu0H9hrw4eYJcMFFMQ2kl6ow7yunfshQySK Q/u9MCMdLVHo2gvWq7Mog/Gi8P/Uwi4zfgTJRRFdSUF6TGmTO2myX5jYJgsWKpE/gK+Ue 7rBfwoq1UjS4ABeisxrHL/X3xg0gZJH9uP5cVmk1g7AWyGtT8XEUuHfpdoBVQQkqEvfcK LIk3cTaXe5R41rvqrllIfxJLh89FSTuO1Gj4Hmw6WGoRKacwNnJd5PYDb/ie1LWjpUw== 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=dWKmZPFv; 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 0C386606A322 for ; Wed, 2 Dec 2026 19:07:07 +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=dWKmZPFv Received: by smtp.kernel.org (Postfix) with ESMTPSA id A4B761F000C1; Wed, 2 Dec 2026 19:07:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796238427; bh=/FZnfzcje0LZQ/REbNVbQT6owHr+nPjCulK/lXA9yok=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=dWKmZPFvmImStl8ng20N1EuIXl29RZtnFYoX3pLodlY/VinJW2Bq1dL9PRpVT1rYe k2B1LRyaqI8mBjpfjavc4+HbU+HL/APxnYDrZeylC3+QRooQoboidGgFvAD8emgO58 mQ3uAgw0GVxXQtaaVHQmz8w6gWlWeWTAaOgRSdcnl3OVMFHuymq/IRAO1Aoab6ajbG pj7yl8Zjt/HHR6n+B6zVUJs9idxkjixvLdL0OJkQIRGvFBGI1MOWoCI2g6YthZbywZ a3dd7R1t/4SSoEfO8rHehCyBNr9vvU0PeCKUjd2J1YiWKbZVREf2BbFzGPvALBVnUy CmRVDZDDf7AAg== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v6 06/13] HID: haptic: Convert to a loadable plugin module Reply-To: sashiko-reviews@lists.linux.dev To: "Rong Zhang" Cc: linux-input@vger.kernel.org, dmitry.torokhov@gmail.com In-Reply-To: <20261203-hid-haptic-kmod-v6-6-95a1273b9e40@rong.moe> References: <20261203-hid-haptic-kmod-v6-0-95a1273b9e40@rong.moe> <20261203-hid-haptic-kmod-v6-6-95a1273b9e40@rong.moe> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Wed, 02 Dec 2026 19:07:07 +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: - [Medium] HID: input: drv->input_configured() runs before haptic FF checks -- commit 8be6fb5c6f2eedc7e241b2c32350b9e02e719950 Author: Rong Zhang HID: haptic: Convert to a loadable plugin module This commit converts hid-haptic into a loadable hid-plugin module and moves the haptic initialization hooks from hid-multitouch into hid-input. Link: https://lore.kernel.org/linux-input/auypydfkhx2eg7vp764way4batdilzc35= inqda3exwzs3tk3ff@oagat6g46zto/ > diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c > index 80cdd2f2beffe..847621d53a61b 100644 > --- a/drivers/hid/hid-input.c > +++ b/drivers/hid/hid-input.c [ ... ] > @@ -2409,21 +2424,38 @@ int hidinput_connect(struct hid_device *hid, unsi= gned int connect_mask) > =20 > hidinput_change_resolution_multipliers(hid); > =20 > + haptic_ff =3D hid_haptic_input_configured(hid, NULL) >=3D 0; > + > list_for_each_entry_safe(hidinput, next, &hid->inputs, list) { > + bool first =3D list_is_first(&hidinput->list, &hid->inputs); > + > if (drv->input_configured && > drv->input_configured(hid, hidinput)) > goto out_unwind; > =20 > + if (first) { > + driver_ff =3D hid_has_ff_input(hid) || !(connect_mask & HID_CONNECT_F= F); > + if (haptic_ff && driver_ff) { > + hid_info(hid, "prefer driver's FF over haptic\n"); > + haptic_ff =3D false; > + } > + } > + > if (!hidinput_has_been_populated(hidinput)) { > /* no need to register an input device not populated */ > hidinput_cleanup_hidinput(hid, hidinput); > continue; > } > =20 > - if (list_is_first(&hidinput->list, &hid->inputs) && > - (connect_mask & HID_CONNECT_FF) && hid->ff_init && > - !hid_has_ff_input(hid)) > - hid->ff_init(hid); > + if (first && !driver_ff && hid->ff_init) > + driver_ff =3D !hid->ff_init(hid); > + > + if (haptic_ff && driver_ff) { > + hid_info(hid, "prefer PIDFF over haptic\n"); > + haptic_ff =3D false; > + } else if (haptic_ff) { > + haptic_ff =3D hid_haptic_input_configured(hid, hidinput) >=3D 0; > + } > =20 > if (input_register_device(hidinput->input)) > goto out_unwind; [Severity: Medium] Can calling drv->input_configured() before hid_haptic_input_configured() and the driver_ff checks leave the multitouch device configured with INPUT_MT_TOTAL_FORCE and td->is_haptic_touchpad set when haptic FF is skipped or fails to initialize? Before this commit, mt_input_configured() ran hid_haptic_input_configured() and updated td->is_haptic_touchpad before calling mt_touch_input_configured(). Now, hid_haptic_input_configured() with NULL only checks prerequisites, so haptic->input_dev is still equal to hi->input when drv->input_configured() runs: drivers/hid/hid-multitouch.c:mt_touch_input_configured() { ... if (td->is_haptic_touchpad && hid_haptic_connected_to_input(hdev, input)) app->mt_flags |=3D INPUT_MT_TOTAL_FORCE; ... ret =3D input_mt_init_slots(input, td->maxcontacts, app->mt_flags); ... } If haptic FF is then skipped because driver_ff is true, or if hid_haptic_init() fails inside hid_haptic_input_configured(hid, hidinput), the input device is registered with INPUT_MT_TOTAL_FORCE enabled (changing ABS_PRESSURE pointer emulation) without FF_HAPTIC or INPUT_PROP_PRESSUREPAD, and td->is_haptic_touchpad stays true for the life of the device. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261203-hid-haptic= -kmod-v6-0-95a1273b9e40@rong.moe?part=3D6