mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Florian Krischer <florian.krischer@fkr.dev>
To: Svyatoslav Ryhel <clamor95@gmail.com>
Cc: Lee Jones <lee@kernel.org>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
	Florian Krischer <florian.krischer@fkr.dev>
Subject: [PATCH v10 fixup 2/2] input: serio: asus-transformer-ec: fix keyboard response framing
Date: Mon, 21 Sep 2026 19:52:38 +0200	[thread overview]
Message-ID: <20260921175234.3137985-3-florian.krischer@fkr.dev> (raw)
In-Reply-To: <20260721095233.420823-1-clamor95@gmail.com>

Real SL101 hardware exposes two issues in the v10 keyboard response
handling.

First, keyboard command responses may carry OBF without KEY or KBC.
The downstream ASUS driver treats valid non-AUX OBF responses as
keyboard data. Dropping these packets prevents PS/2 ACK responses from
reaching atkbd.

Second, the EC count byte is the number of bytes following the count
byte, not the total packet size. For example, the SL101 returns the
keyboard reset response:

  03 09 fa aa

where 03 counts status 09, ACK fa and BAT-success aa.

v9 used data[0] - 1 after skipping the count and status bytes. v10
changed this to data[0] - 2 while tightening the packet bound, which
drops the final payload byte. Keep the v10 bound but restore the
correct payload count.

Tested on an ASUS Eee Pad Slider SL101 with EC firmware SL101-0202.
Together with the SL101 8-byte event-read fixup, the physical sliding
keyboard completes atkbd initialization and works.

Signed-off-by: Florian Krischer <florian.krischer@fkr.dev>
---
 drivers/input/serio/asus-transformer-ec-kbc.c | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

--- a/drivers/input/serio/asus-transformer-ec-kbc.c
+++ b/drivers/input/serio/asus-transformer-ec-kbc.c
@@ -26,20 +26,26 @@
 		return NOTIFY_DONE;
 	else if (action & ASUSEC_AUX_MASK)
 		port_idx = 1;
-	else if (action & (ASUSEC_KBC_MASK | ASUSEC_KEY_MASK))
+	else if (action & ASUSEC_OBF_MASK)
+		/*
+		 * Keyboard command responses can carry only OBF, without KEY or
+		 * KBC set. The original SL101 driver treated every valid non-AUX,
+		 * non-SMI/SCI OBF packet as keyboard data, including PS/2 ACKs.
+		 */
 		port_idx = 0;
 	else
 		return NOTIFY_DONE;

 	/*
-	 * The data[0] is the length of the packet including itself. The data[]
-	 * buffer has to be at least 3 bytes (length + ctrl + 1 data byte) and
-	 * must not exceed the EC entry size.
+	 * data[0] is the number of bytes following the count byte: one status
+	 * byte plus the payload. The SL101 EC, for example, reports keyboard
+	 * reset as 03 09 fa aa (status 09, ACK fa, BAT aa). Skip the count and
+	 * status bytes and forward every payload byte to serio.
 	 */
 	if (data[0] < 2 || data[0] > ASUSEC_ENTRY_SIZE)
 		return NOTIFY_BAD;

-	n = data[0] - 2;
+	n = data[0] - 1;
 	data += 2;

 	if (port_idx == 0) {
--

  parent reply	other threads:[~2026-09-21 17:52 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-21  9:52 [PATCH v10 0/7] mfd: Add support for Asus Transformer embedded controller Svyatoslav Ryhel
2026-07-21  9:52 ` [PATCH v10 1/7] dt-bindings: embedded-controller: document ASUS Transformer EC Svyatoslav Ryhel
2026-07-21  9:52 ` [PATCH v10 2/7] mfd: Add driver for ASUS Transformer embedded controller Svyatoslav Ryhel
2026-07-23  6:25   ` Uwe Kleine-König
2026-07-25 13:23     ` Svyatoslav Ryhel
2026-07-29 12:33       ` Uwe Kleine-König
2026-07-21  9:52 ` [PATCH v10 3/7] input: serio: Add driver for ASUS Transformer dock keyboard and touchpad Svyatoslav Ryhel
2026-07-21  9:52 ` [PATCH v10 4/7] input: keyboard: Add driver for ASUS Transformer dock multimedia keys Svyatoslav Ryhel
2026-08-19  9:20   ` Svyatoslav Ryhel
2026-09-06 17:22     ` Svyatoslav Ryhel
2026-09-21  7:34       ` Svyatoslav Ryhel
2026-07-21  9:52 ` [PATCH v10 5/7] leds: Add driver for ASUS Transformer LEDs Svyatoslav Ryhel
2026-07-21  9:52 ` [PATCH v10 6/7] power: supply: Add driver for ASUS Transformer battery Svyatoslav Ryhel
2026-07-21  9:52 ` [PATCH v10 7/7] power: supply: Add charger driver for Asus Transformers Svyatoslav Ryhel
2026-09-21 17:52 ` [PATCH v10 fixup 0/2] ASUS Transformer EC: SL101 keyboard event/response fixes Florian Krischer
2026-09-21 17:52 ` [PATCH v10 fixup 1/2] mfd: asus-transformer-ec: use 8-byte event reads on SL101 Florian Krischer
2026-09-22  6:22   ` Svyatoslav Ryhel
2026-09-21 17:52 ` Florian Krischer [this message]
2026-09-22  6:25   ` [PATCH v10 fixup 2/2] input: serio: asus-transformer-ec: fix keyboard response framing Svyatoslav Ryhel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260921175234.3137985-3-florian.krischer@fkr.dev \
    --to=florian.krischer@fkr.dev \
    --cc=clamor95@gmail.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=lee@kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®