Skip to content

ucsi.c: GET_ERROR_STATUS check reads message_in[1] twice #89

Open

Description

@lcd1232

In zephyr/program/framework/src/ucsi.c (fwk-sakura-20260429, also on the sunflower-dahlia and lilac branches):

uint16_t error_information =
	(pd_chip_ucsi_info[i].message_in[1] << 8) |
	pd_chip_ucsi_info[i].message_in[1];

uint16_t error_information =
(pd_chip_ucsi_info[i].message_in[1] << 8) |
pd_chip_ucsi_info[i].message_in[1];

Looks like the low byte should be message_in[0]. As is, errors that only set bits 0-7 (incompatible partner, CC comm error, contract negotiation fail, overcurrent) give 0 here, so when a GET_ERROR_STATUS is broadcast to both PD chips, the response with the actual error can get dropped in favour of the other chip's empty one.

Only hits the broadcast path, so probably rare.

Activity

  1. mitar commented on Nov 22, 2026

    @mitar

    The one-line fix as proposed here is a commit on my branch, and it runs on my Laptop 13 Pro with the AMD Ryzen AI 300 Series mainboard. Linux there still logs ucsi_acpi USBC000:00: unknown error 256 at plugs, with and without it, because 256 is the error status which the PD controllers report, so the change does not show in that log.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions