From nobody Mon Sep 29 21:52:37 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cbFKf0Cb6z68vFp; Mon, 29 Sep 2025 21:52:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cbFKd6Xxhz45pR; Mon, 29 Sep 2025 21:52:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759182757; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5axy7U/hbwFF6+7i+Geyf7VobX7V2ZqHxf2bmpQCmT8=; b=UiziqBgLEITBNcvZzxWd9oVWQPr73iE4rvlLD1Aiz6usgBLEGCJyujg16JXDmutNFQNKUN b29oCtvGmYdt+xB5Tu80cSOdLg22OepsXV7iQ7s3vQhQTtR9qx8io9Ed7O8ZNu1UOcj52+ +qdZDPYneR4gAMezeERFW6QC0FCWY6aohmFQ5aHPTVtWzT2T+sqPel8tDBFOFYkw7qViNI rL6rMXYnw+9RYRxMOJtiizIbxBR5SKd5/TvzFL/bsNvsmNT97DnFv9LT1PKKYVHWoWL+P4 ixU+JGJJwHhh0QRwra/eEaigZj4EANcpTkYS4uf6VsZAYA/VbzeZrZsyl0lGTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759182757; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5axy7U/hbwFF6+7i+Geyf7VobX7V2ZqHxf2bmpQCmT8=; b=eZZjP1N7SEqjFVouuukcl6577ytGvlyCeSl/u8QkqpQgklmOkDJ7rI7gjr+YDgKVZ7Bp9a +raxxenGYks40tgJHwZlW4SVweOkczeXesorpHSZoIrk2smALrU3tKqgHTgDayL0rASVEh 9piIBShKyhbgWwTdcUD7hHA82waGkwON1S6nteYhLtWninzkUE3M2Fx97DLohC6AxDt1G2 WMEjdo+QqpHPKWmIq4pL08sS4sULi6fDa+MwOw+Vl1lUxPVpnMLtT1Tj9WDmglY+5ko9Yw WzAklx6Nahg7v9v2E5clcwvVpxGbMTJ/Jjpi74pFQDduYmUVLXBPC3s3fJ0TCg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759182757; a=rsa-sha256; cv=none; b=nLM/6a0u25qTbKYQty2c80Ee/US/YY4NUe44CMIEsZVjttRHIwbwCN2/dcwhbTBIsrzE1h LhJR/sb0/RrSqd9eK+0AWI8j1UI4VVzzB4ZVWSmCERXY9GIZVFh+P0ADykbB+NENazURSi BjNmgk7eGRxewAPn2OPABHq6W8Wrf6selz7pnBQceV9KiEXuzV5VW9uvZBItyMw5ebK9ct wLtf8opOocKNEMdU/63SbufH8gLB4HiCBigTnO+OU9Wc6RJ8Mpe8/vzKVQeNWFvY9ZcJRx lY/HWGVSQcxksf3avH2aqoovq/Xuny2+lfC8bthFqNaTIsyS5ejjAZQJczFKAg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cbFKd5y2wz1M8W; Mon, 29 Sep 2025 21:52:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 58TLqbdI051759; Mon, 29 Sep 2025 21:52:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58TLqbdG051756; Mon, 29 Sep 2025 21:52:37 GMT (envelope-from git) Date: Mon, 29 Sep 2025 21:52:37 GMT Message-Id: <202509292152.58TLqbdG051756@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: c18032ba3172 - stable/15 - iichid(4): Always use wMaxInputLength bytes as input report length List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: c18032ba3172ec139056d71952b885b35f9fe107 Auto-Submitted: auto-generated The branch stable/15 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=c18032ba3172ec139056d71952b885b35f9fe107 commit c18032ba3172ec139056d71952b885b35f9fe107 Author: Vladimir Kondratyev AuthorDate: 2025-09-22 08:37:19 +0000 Commit: Vladimir Kondratyev CommitDate: 2025-09-29 21:50:43 +0000 iichid(4): Always use wMaxInputLength bytes as input report length Lower values may result in non-acknowledged interrupts. E.g. ITE5570 device found in ASUS TUF. Greater values may result in read failures. E.g. GXTP7863 device found on MateBookPro 2023. Investigated by: huanghwh@gmail.com PR: 289353 MFC after: 1 week fixes: 36027361f9cf ("iichid: Stop using split I²C bus transactions") (cherry picked from commit 8f496952e3e6cdd531675a44b84b3f1954532afb) --- sys/dev/iicbus/iichid.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/sys/dev/iicbus/iichid.c b/sys/dev/iicbus/iichid.c index fdb4816b8bd9..6d95d6d2d4f8 100644 --- a/sys/dev/iicbus/iichid.c +++ b/sys/dev/iicbus/iichid.c @@ -816,12 +816,13 @@ iichid_intr_setup(device_t dev, device_t child __unused, hid_intr_t intr, sc = device_get_softc(dev); /* - * Do not rely just on wMaxInputLength, as some devices (which?) - * may set it to a wrong length. Also find the longest input report - * in report descriptor, and add two for the length field. + * Start with wMaxInputLength to follow HID-over-I2C specs. Than if + * semi-HID device like ietp(4) requested changing of input buffer + * size with report descriptor overloading, find the longest input + * report in the descriptor, and add two for the length field. */ - rdesc->rdsize = 2 + - MAX(rdesc->isize, le16toh(sc->desc.wMaxInputLength)); + rdesc->rdsize = rdesc->rdsize == 0 ? + le16toh(sc->desc.wMaxInputLength) : rdesc->isize + 2; /* Write and get/set_report sizes are limited by I2C-HID protocol. */ rdesc->grsize = rdesc->srsize = IICHID_SIZE_MAX; rdesc->wrsize = IICHID_SIZE_MAX;