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=1796497341; b=XwXq5ceGsrRLX2astfjng3pAMTldH2vddONP8cVxklbe9FrVpJ8gLxl0rni8Ix3IqJGO l0wviynxxtLPzwU/Sicp6lBmMR0gQK8jLPrAvGDVYpylgUxyEdBDiUHBYb8ltQWiJdjWz DV4JMNJvQSaizgcS9CG0gNakVzwAjJ/i9E3Mm7YlwY1ELbCerSL44y+llO2hj7P3uU7t8 ZvxTeoMwmGphbUg65WcaO2AX1HIytr5YfqZpL6+N3lemq9Q/kRTzJcRc9hbRC6L0gIePR j8TVqtfd3WmYuGZx5DpG1l01X8gkH40mq1zojTPUAvg/P354ERWqMoXOi79l/qklEdg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796497341; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=Xif1Y4DeH8tFvatOcBNQkLx+p+yJyVlPI7mFt0X+Y/4=; b=LiomhQGtZ6HPaCHSZHdLhpXuakQb67KovYD3YAlDAqyduNwRep1GOCEpzuvKOCbby01l scplUKmsYmq7kYDPCnNdakPhVy+r1HwdOhCxVNcBc5mh3FFjR4ir9ARx3+bQ0kxwSm7e8 ZSQq0CIJCoxXDtoGmP9IuqU6KlGjNMY6Sj1JHr8wrpajEuDYnW3RubBffdn6/12x7uWhv Vj/WpzkXic+Clpnx279968vXckhkOYGQ8R4+D0AVDUWPo21Z+dvswodRpQnAx/ORYxitI QI/MMspBXN2hVu39crjONgxLUcti4/SILTKDgGTXWFQ4SDDlDU60iJBWaVbMyx1WczA== 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=ohSD7bcA; 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 3F22F606A31F for ; Sat, 5 Dec 2026 19:02:21 +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=ohSD7bcA Received: by smtp.kernel.org (Postfix) with ESMTPSA id BCB081F00936; Sat, 5 Dec 2026 19:02:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796497340; bh=Xif1Y4DeH8tFvatOcBNQkLx+p+yJyVlPI7mFt0X+Y/4=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=ohSD7bcA2Uqo7Bo+8P+bXOC7O91qwgo9++VBa/IQxKeT796wXT20rUBg6lniXXNBW zkXnY1N+FlFUjsMdWbnLvrEFnIpzqcpeCoRJZP3yWV2yP43h3AQOyMfVgu7cPOawMn p0Hov4GY5OnOAHL++MdrRtFocVfaWPxebf6cs5ZXXAov1PvHDheoBwGDItXWDLkX3j qwhAJz/a8r66w6ns8T/oMkbKWkT5pzv9sE1WuSthB/K8ypjFRu+mKdwdOxsg0AhHOg ns0Pm2U4rmKrZTuZkfeCXfDJNt8bqlbPBMqf3VTe9Xa9EOVkzydxE5tTD1wyvG+j3j kxxKc3rSR2W7g== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v7 04/13] HID: haptic: Postpone GET_REPORT to init 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-4-3eea47035836@rong.moe> References: <20261206-hid-haptic-kmod-v7-0-3eea47035836@rong.moe> <20261206-hid-haptic-kmod-v7-4-3eea47035836@rong.moe> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Sat, 05 Dec 2026 19:02:20 +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: haptic: GET_REPORT response dropped in hid_haptic_get_reports() -- commit e9a0e0a74b863b6170a9e69a6a306d7df96ed6bd Author: Rong Zhang HID: haptic: Postpone GET_REPORT to init This commit moves the GET_REPORT request for the haptic auto-trigger feature report from hid_haptic_feature_mapping() to hid_haptic_init() via a new hid_haptic_get_reports() helper, and parses default_auto_trigger in parse_auto_trigger_field(). > diff --git a/drivers/hid/hid-haptic.c b/drivers/hid/hid-haptic.c > index c396a817ec6e5..43e9aa60fca9d 100644 > --- a/drivers/hid/hid-haptic.c > +++ b/drivers/hid/hid-haptic.c [ ... ] > @@ -402,6 +398,16 @@ static void hid_haptic_destroy(struct ff_device *ff) > haptic->hid_usage_map =3D NULL; > } > =20 > +static void hid_haptic_get_reports(struct hid_device *hdev, struct hid_h= aptic_device *haptic) > +{ > + hid_device_io_start(hdev); > + > + hid_hw_request(hdev, haptic->auto_trigger_report, HID_REQ_GET_REPORT); > + > + hid_hw_wait(hdev); > + hid_device_io_stop(hdev); > +} > + > int hid_haptic_init(struct hid_device *hdev, > struct hid_haptic_device *haptic, > struct input_dev *dev) > @@ -438,6 +444,9 @@ int hid_haptic_init(struct hid_device *hdev, > HID_HP_WAVEFORMSTOP & HID_USAGE; > =20 > mutex_init(&haptic->auto_trigger_mutex); > + > + hid_haptic_get_reports(hdev, haptic); > + > for (r =3D 0; r < haptic->auto_trigger_report->maxfield; r++) > parse_auto_trigger_field(haptic, haptic->auto_trigger_report->field[r]= ); [Severity: Medium] Can the GET_REPORT response for auto_trigger_report be silently dropped her= e? Previously this ran in report_features() before any hid_input was registere= d. Now hid_haptic_init() runs from drv->input_configured() inside the hidinput_connect() loop, which calls input_register_device() for each hid_input as it iterates. On a composite device where an earlier hid_input is registered first, userspace can open it and call hid_hw_open(), enabling hardware input repor= ts before hid_haptic_get_reports() runs: CPU0 (hidinput_connect) CPU1 (input IRQ) hid_haptic_get_reports() hid_device_io_start(hdev) up(&hdev->driver_input_lock) __hid_input_report() down_trylock(&driver_input_lock) hid_hw_request(..., GET_REPORT) __hid_request() hid_input_report() down_trylock() -> -EBUSY <-- response silently dropped Both __hid_request() and hid_ctrl() ignore the -EBUSY return from hid_input_report(), so parse_auto_trigger_field() reads zeroed field->value= [] entries. That leaves default_auto_trigger, hid_usage_map[], and duration_map[] unpopulated, breaking mode switching and waveform uploads. Fetching the report synchronously with hid_hw_raw_request() and feeding it = to hid_report_raw_event() while keeping driver_input_lock held (as mt_get_feature() does) avoids releasing the lock and prevents this race. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261206-hid-haptic= -kmod-v7-0-3eea47035836@rong.moe?part=3D4