]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
usb: ucsi_acpi: Fix command completion handling
authorChristian A. Ehrhardt <lk@c--e.de>
Sun, 21 Jan 2024 20:41:22 +0000 (21:41 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 23 Feb 2024 08:51:31 +0000 (09:51 +0100)
commitf5e02ca478fa03bccaf8548c58d3eefd192ee1d3
tree6508c50843d4140d0b10a4412317cb8a044b2c2c
parent33713945cc92ea9c4a1a9479d5c1b7acb7fc4df3
usb: ucsi_acpi: Fix command completion handling

commit 2840143e393a4ddc1caab4372969ea337371168c upstream.

In case of a spurious or otherwise delayed notification it is
possible that CCI still reports the previous completion. The
UCSI spec is aware of this and provides two completion bits in
CCI, one for normal commands and one for acks. As acks and commands
alternate the notification handler can determine if the completion
bit is from the current command.

The initial UCSI code correctly handled this but the distinction
between the two completion bits was lost with the introduction of
the new API.

To fix this revive the ACK_PENDING bit for ucsi_acpi and only complete
commands if the completion bit matches.

Fixes: f56de278e8ec ("usb: typec: ucsi: acpi: Move to the new API")
Cc: stable@vger.kernel.org
Signed-off-by: "Christian A. Ehrhardt" <lk@c--e.de>
Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/20240121204123.275441-3-lk@c--e.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/typec/ucsi/ucsi_acpi.c