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=1796183643; b=sZKGIfiJKylWpoZ6bt3tHKcVXSY2ke7ogRpejW9CPUMw2sgqFHgrHg+i59Pr6qDQ+UGd aOYFLQhKTCd8B6vzDysbFBHnXonYdt+BnFUPjlZC68PJj12Pjyr5aJNhPYn5Fma9W3X0e aNbjgpkSkCWeD/gfAs9zsdkF1CG1Dd2scP3Qag6h4r3JxpkkHuSZNDxLIDXPKHmKcZDuW WfAkvrmfQlpKtD4GN1VS38/tTCNEuoqkGkcccR0VjiiwtWQxKlyBlfWTPzZZMm+KFnkR5 aGdnAsGWNEPzfhyXw9+BzCd1bm28+qGZmkTkdr6CvhmaVP5Z4ijHQf7qYyJdOOVh8KQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796183643; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=JIi1ValfWV8tRDFeiDJd3JvkREC9fYE4U8ktrC2IYBo=; b=n5BcpotvXqFMXiY5aq1a9OPmNPrfUWWC1N1fo0bTtmuGgjguWFbXvp50yAUukEJM2LLJ pNMiKhfZ5JKlGe9yxV3PoMO/w4nKlpkWaknnnGGwkdxgP4TZ0Q1YlRHKKrY1VVq6cL3Dk ONRO/3lk72g4A6PFckpXlscK+v8LiRwSrF9fOt5harNlW9Zvh0OFoksqjZJhGPgFIxrDo b7h8V71acy196LtLmz3vI07fuCwJpJs8F6rad35zqDEfgtRO824q2sfBiVWD8KiY/Cfsp 3gAT2r4vCkoKFnNi9Ibwb7VXZTxX5qokIxbQq7uvjTPqvCbubHAzwGtMhsxP59Jb/fQ== 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=KkhKVNKb; 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 C1D10606A31A; Wed, 2 Dec 2026 03:54:03 +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=KkhKVNKb Received: by smtp.kernel.org (Postfix) with ESMTPSA id 163661F00893; Wed, 2 Dec 2026 03:54:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796183643; bh=JIi1ValfWV8tRDFeiDJd3JvkREC9fYE4U8ktrC2IYBo=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=KkhKVNKbTpv/lTiuDBQul2BMywhFFf9kLCOs5nttj6fzE5VAHwbPNCtul8Can/ZT1 3yMlWz/ukW5ux6zbF5YHSQ/kWLdbj3Vbzj+aBgFblUTQojzXM3l+c0opYbLzp6/i5F pJ+O+1A/Z5bGqoh0t+tzhw5xPF2kyUp1ArRKbu2oyxlbrXj+RGiGnopf2569Zd7foZ eia/0tFPimOLHrLk8ksrt3hKR5hglffmNFtSFgbBc4gdL89NvqghW1rWx8cJ9WaouT hIQjQVnjYdFc53eMJktO7h1PyhvPsbKXImJZHa1dlY5SfHqaA2sBL/9XwSWKC+JJ1k Tj3I+Cs19u1+w== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v3 5/7] Input: novatek-nvt-ts - add NT36536 packet decoding Reply-To: sashiko-reviews@lists.linux.dev To: "Qianhui Xu" Cc: linux-input@vger.kernel.org, devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org, dmitry.torokhov@gmail.com In-Reply-To: <20261202034023.1744045-5-xiaqinghuan@mail.ustc.edu.cn> References: <20261202034023.1744045-1-xiaqinghuan@mail.ustc.edu.cn> <20261202034023.1744045-5-xiaqinghuan@mail.ustc.edu.cn> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Wed, 02 Dec 2026 03:54:02 +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 2 potential issues to consider: - [Medium] Input: novatek-nvt-ts - unconditional ABS_MT_TOUCH_MAJOR in nvt_ts_probe() - [Medium] Input: novatek-nvt-ts - off-by-one checksum offset in nvt_ts_nt36xxx_checksum_ok() -- commit b01eacb36161b3ebd050547d6646c94da403101e Author: Qianhui Xu Input: novatek-nvt-ts - add NT36536 packet decoding This commit adds a per-chip report callback, implements touch packet decoding with checksum validation for NT36xxx controllers, and skips the parameter block read when the chip data does not advertise a chip id. > diff --git a/drivers/input/touchscreen/novatek-nvt-ts-core.c b/drivers/in= put/touchscreen/novatek-nvt-ts-core.c > index d0e2c8bf22157..d1035f6058ed6 100644 > --- a/drivers/input/touchscreen/novatek-nvt-ts-core.c > +++ b/drivers/input/touchscreen/novatek-nvt-ts-core.c [ ... ] > @@ -81,6 +86,77 @@ static irqreturn_t nvt_ts_irq(int irq, void *dev_id) > input_mt_sync_frame(data->input); > input_sync(data->input); > =20 > + return 0; > +} > + > +/* > + * NT36xxx checksum: the byte at NVT_TS_NT36XXX_CHECKSUM is the two's > + * complement of the sum of the first 64 bytes of the report. > + */ > +static bool nvt_ts_nt36xxx_checksum_ok(const u8 *buf) > +{ > + u8 sum =3D 0; > + int i; > + > + for (i =3D 0; i < NVT_TS_NT36XXX_CHECKSUM; i++) > + sum +=3D buf[i]; > + > + return (u8)(~sum + 1) =3D=3D buf[NVT_TS_NT36XXX_CHECKSUM]; > +} [Severity: Medium] Is NVT_TS_NT36XXX_CHECKSUM off by one here? Because nvt_ts_spi_read() already strips the 2-byte SPI header via memcpy(buf, rx + 2, count), buf[0] is the first report byte (index 1 in the raw 109-byte SPI buffer). When the touch records were shifted from offset 1 to offset 0, NVT_TS_NT36XXX_CHECKSUM remained 64 (and NVT_TS_NT36XXX_PACKET_SIZE remained 109) instead of shifting to 63 (and 108). As a result, nvt_ts_nt36xxx_checksum_ok() sums buf[0..63]=E2=80=94wh= ich already includes the checksum byte at buf[63]=E2=80=94and compares the resu= lt against buf[64], causing valid touch packets to fail verification with -EIO. [ ... ] > @@ -227,9 +324,22 @@ int nvt_ts_probe(struct device *dev, const struct nv= t_ts_bus_ops *bus_ops, > input->open =3D nvt_ts_start; > input->close =3D nvt_ts_stop; > =20 > - input_set_abs_params(input, ABS_MT_POSITION_X, 0, width - 1, 0, 0); > - input_set_abs_params(input, ABS_MT_POSITION_Y, 0, height - 1, 0, 0); > + if (width) > + input_set_abs_params(input, ABS_MT_POSITION_X, 0, width - 1, 0, 0); > + else > + input_set_capability(input, EV_ABS, ABS_MT_POSITION_X); > + if (height) > + input_set_abs_params(input, ABS_MT_POSITION_Y, 0, height - 1, 0, 0); > + else > + input_set_capability(input, EV_ABS, ABS_MT_POSITION_Y); > + input_set_abs_params(input, ABS_MT_TOUCH_MAJOR, 0, 255, 0, 0); [Severity: Medium] Should ABS_MT_TOUCH_MAJOR only be registered for controllers that report contact width? Unconditionally advertising ABS_MT_TOUCH_MAJOR is a regression for NT11205 and NT36672A: nvt_ts_report_nt11205() only reports slot state and X/Y coordinates, so ABS_MT_TOUCH_MAJOR stays at 0 across all touches and userspace input stacks that consume this axis see a permanent zero contact width. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261202034023.1744= 045-1-xiaqinghuan@mail.ustc.edu.cn?part=3D5