Skip to content

[Backport v4.3-branch] MCTP over I2C+GPIO fixes - #117354

Open
github-actions[bot] wants to merge 3 commits into
v4.3-branchfrom
backport-116105-to-v4.3-branch
Open

[Backport v4.3-branch] MCTP over I2C+GPIO fixes#117354
github-actions[bot] wants to merge 3 commits into
v4.3-branchfrom
backport-116105-to-v4.3-branch

Conversation

@github-actions

Copy link
Copy Markdown

Backport 60f7fee~3..60f7fee from #116105.

Original PR description:


Some fixes, all around some "protocol confusion"[1]:

  • Off-by-one reading if a buggy controller issued a longer reading than expected;
  • A buggy controller could ask a read with no packet to be read

[1] "Protocol" here is the simple protocol used by the target to accept readings from the controller. It was supposed to write to a "register" and read either the length of the available packet or the packet data. But a buggy controller could confuse the target, so some checks are added.

Fixes: #117353

An off by one bug was present on I2C+GPIO check of packet size. It would
normally not be a problem if the controller respected the protocol and
asked to read only the available bytes. However, a buggy controller
could end up reading one byte more from the buffer containing the
packet.

While at it, ensure that a buggy controller that keeps on reading won't
wrap over the counter (a unint8_t variable) and restart reading the
current packet.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
(cherry picked from commit 66bfe3b)
If a buggy controller issues a read request but the target doesn't have
a packet to be read, bail out instead of reading from NULL.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
(cherry picked from commit a097178)
To handle tx from the target, the I2C+GPIO support simulates a
register/address protocol: controller writes one byte (register address)
and reads another (or several) with the contents.

However, a buggy controller may confuse the target as the target keeps
last read register in its own state machine even after the reading was
performed.

This patch makes the controller cleanup its state machine after
receiving an I2C stop, so it's always read for next reading.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
(cherry picked from commit 60f7fee)
@github-actions github-actions Bot added the Backport Backport PR and backport failure issues label Aug 25, 2026
@github-project-automation github-project-automation Bot moved this to To do in Backports Aug 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Backport Backport PR and backport failure issues

Projects

Status: To do

Development

Successfully merging this pull request may close these issues.

1 participant