Skip to content

Commit 6415758

Browse files
Josh-Tsaiquinchou77
authored andcommitted
fwk: ucsi: don't swap the ucsi port if the port is invalid
There is a side effect in this change 95b5094. EC swaps the invalid ucsi port and causes the "Imprecise data bus error". This change modified the logic to ensure the EC does not swap the invalid UCSI port. BRANCH=fwk-main BUG=https://app.clickup.com/t/86euq44h3 TEST=Run the HLK test can get the pass result Signed-off-by: Josh Tsai <Josh_Tsai@compal.com> (cherry picked from commit 103201c1071b3c5fb9c1240a9c7735a790449943)
1 parent 51c7225 commit 6415758

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

  • zephyr/program/framework/src

zephyr/program/framework/src/ucsi.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,10 @@ int ucsi_write_tunnel(void)
134134
change_connector_indicator = 0;
135135

136136
/* Print the invalid port for debugging */
137-
if (ucsi_debug_enable && change_connector_indicator > PD_PORT_COUNT)
138-
CPRINTS("UCSI write invalid type-c port:%d", change_connector_indicator);
139-
else {
137+
if (change_connector_indicator > PD_PORT_COUNT) {
138+
if (ucsi_debug_enable)
139+
CPRINTS("UCSI write invalid type-c port:%d", change_connector_indicator);
140+
} else {
140141
if (change_connector_indicator == 0) {
141142
/* The command should broadcast to all PD chips */
142143
cmd_need_broadcast = true;

0 commit comments

Comments
 (0)