From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f52.google.com (mail-pj1-f52.google.com [209.85.216.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8EABD2F5498 for ; Tue, 1 Sep 2026 06:36:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788244576; cv=none; b=CEePgUaawxV8toxV+QYwuhkGKXNDrgLzBiE7kpjyIo61N2A81d9VrXxZRE86TGeNrVlkB6vjnJgjIdEs469FRx+KOXlc3YXPsJe1Wz5Kq0uCj7Llp92YFG0EWc/Ajg1y6kdYCQVswHDLfsftvOaLlc9NKyzNkEPE2+iLC38JyJU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788244576; c=relaxed/simple; bh=P6MeT8W7qtZhiqChdyIm/E7LrwCHu6XwLN9XJu1c7vg=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=K6fo7Pav9BfZn8hhYYiEzfWtlsFBGsRXnSFCec/feH8iaAoD75QBeJyTDfGPla2vc2gHUjC/4RKS/9Tn6gQc3cb1aEcRX1jnIbP3B5NR99CAD7G1J6d9ztWQUvdVVayfxvtinJgFl8pNqvmdDbQ0i/RTEQcmR9d9VXK+ihzUhUM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=bJk3TrV4; arc=none smtp.client-ip=209.85.216.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="bJk3TrV4" Received: by mail-pj1-f52.google.com with SMTP id 98e67ed59e1d1-3966791a6eeso5325729a91.3 for ; Mon, 31 Aug 2026 23:36:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1788244575; x=1788849375; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=8vuUnYwdPlWQZL61wKlADov8uSdQzUztFQCSWnijrRI=; b=bJk3TrV4CkOeS74KQirafpyU0cNlgmo7dkZTrHbLp4niNREcKgzbsaED+Dz+NdqVkB e7sVNEgMR04LvXK2ASebcns9vBevBtUpYq95Taxg0+kXbbQiSk5GzJmruV1p06A23BiU +0tzt2AF60acjqjQPKgteSrA7kVIeZNTgUSbvM0Jlhv2APOB9xSX9lmVLVznH4so68XY l+QegFjVesZrJGhTfrOAl+hkqMPu3yBaABjVkx/sasIIly1sDnyMQ+NHW9FWTkVYWAQQ QFWAXedqX/sh3nJlsK3LggYdrJ0S6Due65ObMHG+ClOm7bHJNlt+Lm+vqgIkUcmCABR9 /iLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1788244575; x=1788849375; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=8vuUnYwdPlWQZL61wKlADov8uSdQzUztFQCSWnijrRI=; b=czT0ZqnS64TtkPgV9Tt27RytWjFcjX6kCdNgE5UunxxA48pfAs6JlZz+r1bvTRURA1 PVVdfsdfU5GCgwcORpgM+JKljbhNKUd08UXxkeO7hBqHBuDSgl3ARmrIw9t3p6q7Ng39 wW3ryFILTVxXmuxzmnC8op9skXBNXBRRJbnyL6DINoVwUws2Te8JPn6Ebeq5YCQPMOFq GiVVe84WyxJNUJ3Y5x0hCGtRpNI8WMAKYNv1UGKferSeiI+9u3tT7/Lz1X23lytBPCF3 5+8oFCtaifV4SgZWXyr+oPYJUboYbuPe549HaeDw5H0TZVVEfuy49PhL7WeQ8GZz1igi RX3w== X-Forwarded-Encrypted: i=1; AKwUvBwL5pozo9uqzE62EL0RCNpVe6GhiP0RPyHkLHpYs0PdYLCNo+XWAzleMCVloYfezhf1yTmcqjGNUOAHiT8=@vger.kernel.org X-Gm-Message-State: AFuF++kbTunO5sNJoySVXo0k+2RFP9yxcMZ2SQWLndYwBng57wxqNBbL BZgowwTqGhAtMTd96Ac6mKS9FTpmyzo+V96y6K2cUBcdlmiz16ifEMIM X-Gm-Gg: AYBFou2c1SIOyLTFuGf3WWXE5EdHO04IS7DKQ/7ecBKgYJ7qe2XdoUXL0QapQB4QuNT ZVsBOKtu33/hjC4BbFS8QkerXqbjBKGGs3YWHqe35D8IdpTBxfFoy7Iut7EfI4blo5f/SDxwXZN qfkfzHdrcoCwKhqL8gT/J+fP+eX+406B+hS8FtcUve6mm+xm9uoTeaMoeWJrLlzAGBJMckRagDB EVbvU5D2+7ZnaCLjRyNgUX6onvynQm25Rg4WE/DklqovsenblXUva3qeZdpF1ro1ywZuV/bJFR/ lR/F78NiE2bvPtUihbcR6Pe07wEx7CopxCWK50Uil8qXCcU8ODGCl0XVqc1M846CyBF09Wg3pkQ UFWA0zlpX1xQXlT9XuqZFnxvyfVO7XhPusTcZeVxB2cVsSLs9Q/M7zlHECezXZpJl4Fa5QqA4YG oiumNUq8IJcR8ohogXfiOumG6fOUJYokR5iBrwHZKgzpj/BC5YyEXH687jwkgpoccy/0ZwB9/QL ynmWPfOQrwqfg== X-Received: by 2002:a17:90b:2e48:b0:398:e969:87ef with SMTP id 98e67ed59e1d1-39907ec6baamr9073478a91.24.1788244574741; Mon, 31 Aug 2026 23:36:14 -0700 (PDT) Received: from localhost.localdomain ([103.16.69.192]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-142e0dc854dsm32694425c88.10.2026.08.31.23.36.11 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 31 Aug 2026 23:36:14 -0700 (PDT) From: Aditya Dash To: Benjamin Tissoires , "Derek J. Clark" , Jiri Kosina , Mark Pearson Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 0/7] HID: hid-lenovo-go: fix controller configuration Date: Tue, 1 Sep 2026 12:06:01 +0530 Message-ID: X-Mailer: git-send-email 2.55.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit This series fixes several issues in the controller configuration and calibration paths in hid-lenovo-go. 1/7 fixes the calibration attributes, where the command and sub-command are swapped. 2/7 fixes two right-controller attributes: imu_enabled selects the bypass feature, and reset targets the left controller. The configuration interface initializes its command completion after the HID hardware starts and opens. 3/7 moves that initialization before both hardware operations. Before 4/7, any decoded configuration reply completes the shared completion. The driver then ignores the result of the wait, so an unrelated reply, a firmware error, an interrupted wait, or a timeout can still be reported as success. 4/7 tracks one pending request in the driver data and matches replies by command ID, command, sub-command, and device. It initializes the new completion and spinlock at the pre-hardware point established by 3/7. It also returns request errors to the caller. The firmware has no sequence number, so a late reply with the same tuple can still match a newer request. The remaining patches fix calibration status handling. The calibration status table defines 0x00 as unknown, 0x01 as success, and 0x02 as failure. A Legion Go 1 returned 0x08 after a Stop was sent while no calibration was active. The driver stores the raw value as a status-text index, so a later read returns -EINVAL. 5/7 preserves the defined values and maps larger status values to failure. 6/7 rejects 'unknown' as an action. The action table contains it at index zero, but the options attribute advertises only 'start' and 'stop'. A previous result can also hide a new calibration attempt: failure -> start -> failure The status appears unchanged for the whole operation. 7/7 clears the selected status to unknown before submitting a Start. Stop leaves the status unchanged. I built every patch against kernel 7.2.1-ogc3.1.fc44.x86_64 with W=1 and KCFLAGS=-Werror. I tested the exact final module on an Original Legion Go. The configuration interface bound without a kernel fault. An idle Stop result of 0x08 was reported as failure. Writing 'unknown' returned -EINVAL without an output report or status change. A later Start produced failure -> unknown -> failure; the final report contained result 0x02 and error 0x0007. The five unselected statuses stayed unchanged. --- Changes in v3: - Initialize command completion state before hid_hw_start() and hid_hw_open(). - Remove the unreachable zero-length calibration action path after rejecting 'unknown'. v2 review: https://lore.kernel.org/all/CAFqHKTnQiTQc6joz-Y6tmjR=C5giF-MuHeBwu3rw+bmFVMQtqw@mail.gmail.com/ v2: https://lore.kernel.org/all/cover.1788096666.git.mradityadash@gmail.com/ Changes in v2: - Drop the FPS DPI patch; the existing request is correct. - Drop the v1 Boolean calibration-result mapping. Preserve values 0x00 through 0x02 and map only larger failure values. - Move the existing pending command state into the driver data and initialize it in cfg_probe(). - Use scoped IRQ-save guards and validate the report size and ID together. - Drop the v1 no-wait calibration path. Correct requests receive their matching SET replies within the existing 50 ms timeout. - Reject 'unknown' and clear only the selected status on Start. v1: https://lore.kernel.org/all/20260821214810.87826-1-mradityadash@gmail.com/ Aditya Dash (7): HID: hid-lenovo-go: use the correct calibration commands HID: hid-lenovo-go: use the right controller selectors HID: hid-lenovo-go: initialize command completion before hardware HID: hid-lenovo-go: return configuration request errors HID: hid-lenovo-go: normalize calibration failure status HID: hid-lenovo-go: reject unknown calibration action HID: hid-lenovo-go: clear calibration status on start drivers/hid/hid-lenovo-go.c | 191 +++++++++++++++++++++++++++--------- 1 file changed, 142 insertions(+), 49 deletions(-) base-commit: 1292bca0f8d835d2ad96d309595b2e97f3106d3d -- 2.55.0