[PATCH v4 0/2] platform/x86: dell-uart-backlight: handle stray EC byte in responses
From: chitranshmandhaniya
Date: Sat Oct 17 2026 - 03:37:50 EST
From: Chitransh Mandhaniya <Chitransh_Mandhaniya@xxxxxxxx>
On some Dell All-in-One machines the EC sporadically inserts a spurious
byte after the command echo in UART backlight response frames. This
causes a checksum mismatch and the driver returns -EIO to userspace.
Patch 1 is a preparatory refactor: extract the byte-level response
parsing into a dedicated dell_uart_bl_receive_data() helper with no
functional change.
Patch 2 adds single-attempt stray-byte recovery inside that helper.
When a checksum mismatch occurs on a frame longer than the minimum
size, the suspect byte is dropped, the buffer is shifted down, and
status remains -EBUSY so serdev re-delivers the real checksum byte
naturally.
Tested on Dell OptiPlex AIO 7410 65W (board 0TKWC4) where the EC
inserts a stray byte on every get-brightness response.
v3 -> v4:
- Perform resync inside dell_uart_bl_receive_data() rather than in
the wrapper; status stays -EBUSY so serdev re-delivers the
checksum byte without additional handling in the caller
v2 -> v3:
- Guard resync with resp_idx == resp_len to prevent memmove on a
truncated or out-of-range length field
v1 -> v2:
- Extract dell_uart_bl_receive_data() helper instead of using a
for-loop with a pass counter
- Split into two patches: refactor then feature
Chitransh Mandhaniya (2):
platform/x86: dell-uart-backlight: extract dell_uart_bl_receive_data()
helper
platform/x86: dell-uart-backlight: recover from stray EC response byte
.../platform/x86/dell/dell-uart-backlight.c | 52 +++++++++++++------
1 file changed, 37 insertions(+), 15 deletions(-)
--
2.43.0