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=1796264102; b=noUf5WR9Uh2agNoDNH30Zv5DPgUhHAg8/KmiijrCtThJIudmnn9rqjhwlzRVr7h23Fj7 RAgVOmbGOHDGOv1UBwiKIOI5Wt41XAXBtxxVoPYjpzr5KiNVMxy+mUotLiq3tn305y1bx lpd6adJI1V8HcLxZ15NQsWOQ42Gl4TvznBdBuSCY/X4lb73HDeyTxkRsop7fIyUrMnn4J 7PRb/no8Wilsso2gQIO6nFh+SrwMaPuDWXs/robOkajMpv/vAuEYJiv9oNTRZe9kjncfd qzWNoyNSuvbUTA6mA1r4/+uipn1P0PpIh7EBOFrK/VM1ZyUGf/IBKYt2PyaJky70vrA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796264102; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=HwpwEzNp1lH812b5eWrmNNwEJPoYd+GgCxE0crpZ7Ag=; b=SKnNOEs5AOCjCFB6eoso2zhq5xjobnRrIaN46xpzP6Re3EHEMW5nhLnBNkTSRDOaV+Yx rvGevKJISsjuBFvoAPawEuYOnnUQBwIMpMdaRKYqNcRiotCAnnBspp+IL4wnEZadDbbh+ KLkIT4ISQwkvm7vHKvaTfzySp7gtOW8FI6LYXCLD9N0DKM0INXnqlNlGfRJ0O21+OXTFt iiJlcqtUjAxS6aVp9A0PxYhNx7wJB+iBPsWYlyOV9/AA/bkgYoL15V3X57X6FDlWT7jj3 +GIzchSbnDLaae1gLjImmLRQH/OX5NwpPoMRZFlZCj6DQ2I5oPKZfSJOkPHfH33gbDg== 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=iRu43ANJ; 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 A1983606A322 for ; Thu, 3 Dec 2026 02:15:02 +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=iRu43ANJ Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2EDED1F00893; Thu, 3 Dec 2026 02:15:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796264102; bh=HwpwEzNp1lH812b5eWrmNNwEJPoYd+GgCxE0crpZ7Ag=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=iRu43ANJZB6BP2+i2cc5pIiaUcRzEYgxokuffi76SevUo7OlID06wAVZ7dvuiwY/5 a+Q48LNokkWYNyxfyXj81kv8FVB48D0uEIR7qdt5K72sdQtYEBvH7q1VqFo3PFm/Xb UWSvq/AYy5aw4+8lE+5tXRakyxpuVQktlo6BLBKlGiXUdh2ehoF/qyYY9+NluOGGw+ GsX8+N+YtmfNXwzYd42+ddTB/aicuIdf1rrMOuArirPZNg3FErMN44l1YrAwNXYVms pcnA+5wtm7ZPtl6LkXfDYYgRVg9M53Wtmx5AKgh/jVqCy/a7qiHm6rUk1DcGo7Gla1 Im1/yWeo+LzKw== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v11 2/6] HID: intel-thc-hid: intel-ipts: bring up the port Reply-To: sashiko-reviews@lists.linux.dev To: "Emfox Zhou" Cc: linux-input@vger.kernel.org, dmitry.torokhov@gmail.com In-Reply-To: <20261203020433.2631656-2-emfox@debian.org> References: <20261203020433.2631656-2-emfox@debian.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Thu, 03 Dec 2026 02:15:01 +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: intel-thc-hid: unchecked state in thc_ipts_port_stop() on unwind -- commit 663780af800a067405da9392130d2229f813c4d6 Author: Emfox Zhou HID: intel-thc-hid: intel-ipts: bring up the port This commit adds the Intel Touch Host Controller IPTS mode PCI driver and protocol support to select the SPI port, reset the controller, read its configuration block over PIO, apply SPI timing, and enable the touch engine. > diff --git a/drivers/hid/intel-thc-hid/intel-ipts/ipts-protocol.c b/drive= rs/hid/intel-thc-hid/intel-ipts/ipts-protocol.c > new file mode 100644 > index 0000000000000..5d3d8d4005b8f > --- /dev/null > +++ b/drivers/hid/intel-thc-hid/intel-ipts/ipts-protocol.c [ ... ] > +int thc_ipts_port_start(struct thc_ipts *idev) > +{ > + u32 hz, mode, cfg, div; > + bool supported; > + int ret; > + > + ret =3D thc_interrupt_quiesce(idev->thc, true); > + if (ret) > + return ret; > + > + ret =3D thc_port_select(idev->thc, THC_PORT_TYPE_SPI); > + if (ret) > + return ret; > + > + ret =3D thc_port_supported(idev->thc, &supported); > + if (ret) > + return ret; > + if (!supported) > + return -ENODEV; [ ... ] > + ret =3D thc_port_reset(idev->thc, false); > + if (ret) > + return ret; > + > + /* Out of reset from here: a teardown has to put it back. */ > + WRITE_ONCE(idev->state, THC_IPTS_RESET); [ ... ] > + ret =3D thc_interrupt_quiesce(idev->thc, false); > + if (ret) > + return ret; > + > + ret =3D thc_ipts_touch_set(idev, true); > + if (ret) > + return ret; > + WRITE_ONCE(idev->state, THC_IPTS_CONFIG); > + > + return 0; > +} > + > +/** > + * thc_ipts_port_stop - tear one port down > + * @idev: port to stop > + */ > +void thc_ipts_port_stop(struct thc_ipts *idev) > +{ > + if (READ_ONCE(idev->state) >=3D THC_IPTS_CONFIG) > + thc_ipts_touch_set(idev, false); > + > + /* Keep the touch IC in reset until the next start. */ > + thc_port_reset(idev->thc, true); > + thc_interrupt_quiesce(idev->thc, true); > + WRITE_ONCE(idev->state, THC_IPTS_DOWN); > +} [Severity: Medium] Should thc_ipts_port_stop() check idev->state before calling thc_port_reset() and thc_interrupt_quiesce()? thc_ipts_probe() calls thc_ipts_port_stop() whenever thc_ipts_port_start() fails. If thc_ipts_port_start() returns early before releasing reset (such as -ENODEV when !supported), idev->state is still THC_IPTS_DOWN, yet thc_ipts_port_stop() still asserts DEVRST on the port. Similarly, because thc_ipts_port_start() quiesces interrupts on entry and only unquiesces them right before THC_IPTS_CONFIG, any failure in between causes thc_ipts_port_stop() to call thc_interrupt_quiesce(idev->thc, true) on an already-quiesced controller, triggering the "THC interrupt already quiesce" dev_warn() in thc_interrupt_quiesce(). --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/cover.1796215044.gi= t.emfox@debian.org?part=3D2