From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f172.google.com (mail-pl1-f172.google.com [209.85.214.172]) (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 4B8B036A03F for ; Thu, 13 Aug 2026 22:17:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786659472; cv=none; b=tnif8qmwbW+7yR03AMnhZSUNiu9iuh4CIPEDM/L5CerB20IMfsuhoXcINw6DdLNTFF6dvcAALPkldW2gAePmdVRLnpRajIVpNmfsGW48uhkzP1c5L2HVtRGnoMeXUglnUs8NK/yyp1VJBgae77WILvOOGygB+SW5Hsy4wBoZ18c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786659472; c=relaxed/simple; bh=TA2JFuIy/fuSlYx4xuT7o/z/Lw0EPN0pp1ZHO+tJAZw=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=bt4oyxwkLQjuIP1yRteyVPxN4cF5uXhSgEgQxVxQ9aosXq/qzRM5HA05L8+JqFtCtC0+fXSEV+GxZ7Dfi/DHBMJBPn7zJ63dSbzi9baMCiu7nyCvwyXHEEeF4UNcCMnmfX7j5O9mCFEc9INn2XXHqnAukQi4Ce+XNxpx+SC9ZF0= 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=ebgyOAz5; arc=none smtp.client-ip=209.85.214.172 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="ebgyOAz5" Received: by mail-pl1-f172.google.com with SMTP id d9443c01a7336-2caed617615so5840535ad.3 for ; Thu, 13 Aug 2026 15:17:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1786659471; x=1787264271; 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=KekC4GuPmwV8Nnpa9b5NSEKgqsHC/WYKFKjjf0H4XNY=; b=ebgyOAz5VUfCGqoMeBh7pgGMedLQ7DnTKVQhN4QFK0t/MGiiNMhXa15BPy0Mlq2eBl EZcscgNdIpx74lob5ngQteChxT0uxk/UgR9MBvap4aXSeljZgmh/qZ2No9MXQ9/8HSh4 N2jKvGjKOQWRWOlymp48y1TVszAvqcFYVMO4H6ZMqfbGbQXNabyrh7rwWQKjjVNXvHLK AtYh8V94NaaGZlrbeyAu5OTFCIgI0WZzzxTrBjw41IYleoqrL1uhg9Z3IBDNdqTbvK6B bYU/1w57Dv6vP34mHOYOgmDeC0wptN2P6CaGjXhhcexqnDvMj1X4PVx/waT2AYwaMesQ 9mkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786659471; x=1787264271; 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=KekC4GuPmwV8Nnpa9b5NSEKgqsHC/WYKFKjjf0H4XNY=; b=Jwt9vHgFHPi6CeBRUMaLOigv0BH+4o6cp5V8iEV7D9S/UbzZvDdiEFH0GsCbx7+YvJ Gvd2COpWa3aEyEmt9hATOZ9hwuIV7pWHs37rBCIO23hBOguLexBP/xjsFjfl+E3PmhoT K4Jk8DG1oui4EKHWYudpDf3hHlo6lIIBd39c6S0QPB+idc2fLT7fJIohh5ncxPh0Fp0/ m1JMS4UqSoJqotZlfwB4pS7WHIUbFxbqQS/73849iUFPs+HDyuBKIPteZRZAHwdY4khG E9F5PlrZ15U0DkF23WzAvC4r5AxM76Zn/SlqbjaaI4aSIn6fq30+dhTP4/DYBs9CbjNA 1UbQ== X-Forwarded-Encrypted: i=1; AHgh+RrKXCUjkyT4ToE7haSQXdVVpo33RkJCAdAmIddhgXgkFIyVBLWPxy9syMMCAFlpHab7siTQguZmA4I2Xow=@vger.kernel.org X-Gm-Message-State: AOJu0YyWD4KBY26UPeP50ehu6zROt3FWyn6FMgZP4bZrPfPClX5XSNgt k8aupJPvPG2nTAM9vD1wMkM4TuKX6fK/CnjymJW5l0jXlLKgg/FrOPpK1pQXniG4 X-Gm-Gg: AR+sD12V0LzntgtWNrWyKUwv4179iRX1LnPho83f1r3qhhSosSOXOBB+VIEczuAiLjk FPpSf5Xzx5PKGahhAhQWCwhAScHtkkVwPGS1vhGZtSctM6WspQrGBCui3/9OlGiN4Cls/2EaLyp CWb083ZiIicytFwXBnReLYqtpR7sOgijKEAI7lzwJSkIcgZTX9D8vkVJfysXvyovI0n6rQLFk8D yy/ZHcYl8aQ9m3dESM+xGg1Fs4Ru5vx45V03mQc+MFWsjc9D+cfLO/CvVMbSo7aGMxwZfL4p6d+ gweon+g2iGGeXMavyJOB3X/nl3CPFvbfEW7cFsg0W37zdT11DLcNX0eqaaG62rJN+kewOr7d8fM WVivVVVLgDgLyNoAz5SrU7ovivvK0ZA0xRI1/tV/wFi00unl0p7G4AYr6R+ZetrvVcU4PHtUx9l RkPSwGZ0n097HIF8T7wd9B7uQDbnbiv6jsF2WJTraWkLOqhXxvHuORuZ9sZ3A+Ew2XAuMHCjSES tciu9s0zyP/4ATjnfGWHUZa2LSUaA== X-Received: by 2002:a05:6a21:600e:b0:3cb:b2e6:9032 with SMTP id adf61e73a8af0-3cc71d55f44mr1074965637.8.1786659470553; Thu, 13 Aug 2026 15:17:50 -0700 (PDT) Received: from sonic ([2804:18:167:9e8c:e6b5:fa0:d068:30e3]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-31ebc667bfesm11463318eec.2.2026.08.13.15.17.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Aug 2026 15:17:49 -0700 (PDT) From: Hilgad Montelo To: kenneth.t.chan@gmail.com, hansg@kernel.org, ilpo.jarvinen@linux.intel.com Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, Hilgad Montelo Subject: [PATCH v2 0/3] platform/x86: panasonic-laptop: CF-33 hotkey fixes Date: Thu, 13 Aug 2026 19:17:41 -0300 Message-ID: <20260813221744.25668-1-hilgad.montelo@gmail.com> X-Mailer: git-send-email 2.53.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 two non-working buttons on the Panasonic Toughbook CF-33 Mk1 and an independent bug found along the way, all in drivers/platform/x86/panasonic-laptop.c. Patch 1 fixes the bezel Rotation Lock button, which turns out to signal via raw i8042 scancodes that alias the real Left-GUI key, rather than via ACPI notify like the driver's other hotkeys. Patch 2 adds support for the bezel A1/A2 buttons, which are wired to a second ACPI device (MAT003C/TBTN) that nothing currently binds to. Found by disassembling the platform's ACPI tables, since these buttons produced no signal through any of evdev, ACPI notify, WMI, or ACPI GPE interrupt counters. Patch 3 fixes a latent off-by-one heap overflow in the existing HKEY SINF-parsing code, independently triggered by this hardware's exact SQTY/SINF sizes and caught via UBSan while testing patch 2. It's unrelated to the CF-33-specific work but is included here since it was found in the course of it and touches the same file. Changes in v2: - Patch 1: fix a bug in panasonic_i8042_filter() found after this series was first posted. The filter's scancode switch masked off the top bit (data & 0x7f) so a key's make and break codes share a case label; that's correct for the volume keys (both make and break are meant to be fully swallowed there) but it also made the genuine Left-GUI/Meta break code (0xdb) collide with its make code (0x5b), since 0xdb & 0x7f == 0x5b too. The filter misidentified every real release of the physical Left-GUI/Meta key as a possible start of the rotate-lock sequence, silently dropped it, and left the kernel's input core believing the key was still held - reproducible on hardware as GNOME/Mutter treating every subsequent keystroke as a stuck-Super-modified shortcut. Fixed by requiring an exact match against the make code before entering the wait state; any other byte (i.e. the real break code) now falls through to the default path and is replayed untouched, as it always should have been. All three verified on real CF-33 Mk1 hardware, including across a reboot with the combined patch set installed via DKMS, and v2's fix specifically verified via raw i8042 event capture on /dev/input/event3 across five separate Windows-key taps interleaved with normal typing, confirming clean make/break pairs and no more stuck-modifier behavior. Hilgad Montelo (3): platform/x86: panasonic-laptop: Handle CF-33 rotation-lock button platform/x86: panasonic-laptop: Add driver for CF-33 A1/A2 buttons (TBTN) platform/x86: panasonic-laptop: Fix sentinel write past pcc->sinf[] drivers/platform/x86/panasonic-laptop.c | 264 +++++++++++++++++++++++- 1 file changed, 261 insertions(+), 3 deletions(-) -- 2.53.0