Skip to content

Refactor and Update the tcti-x-helper#2899

Draft
wxleong wants to merge 1 commit into
tpm2-software:masterfrom
wxleong:fix-tcti-helper
Draft

Refactor and Update the tcti-x-helper#2899
wxleong wants to merge 1 commit into
tpm2-software:masterfrom
wxleong:fix-tcti-helper

Conversation

@wxleong

@wxleong wxleong commented Sep 24, 2024

Copy link
Copy Markdown
Member
  • Moved common transmit/receive FIFO protocol code to tcti-helper-common.
  • Refined the FIFO protocol implementation.
  • Updated unit test implementation so that changes to the FIFO protocol no longer require modifications to all dependent unit tests.

Resolves #2891, resolves #2620

Comment thread src/tss2-tcti/tcti-helper-common.c Fixed
Comment thread src/tss2-tcti/tcti-helper-common.c Fixed
Comment thread src/tss2-tcti/tcti-helper-common.c Fixed
@wxleong
wxleong force-pushed the fix-tcti-helper branch 7 times, most recently from 6a34882 to 96e137c Compare October 1, 2024 01:18
@wxleong
wxleong force-pushed the fix-tcti-helper branch 3 times, most recently from 4f76b2c to 9682496 Compare October 4, 2024 02:04
- Moved common transmit/receive FIFO protocol code to tcti-helper-common.
- Refined the FIFO protocol implementation.
- Updated unit test implementation so that changes to the FIFO protocol
  no longer require modifications to all dependent unit tests.

Signed-off-by: wenxin.leong <wenxin.leong@infineon.com>
LOG_ERROR ("Failed to send the command");
return rc;
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here we should check for STS_VALID | EXPECT, not ?

LOG_ERROR ("Failed to send the command");
return rc;
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here we should again check for STS_VALID | EXPECT

}

/* Await TPM readiness */
expected_status_bits = TCTI_HELPER_COMMON_TPM_STS_VALID | TCTI_HELPER_COMMON_TPM_STS_DATA_EXPECT;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here, the expected status should be STS_VALID | !EXPECT

I wonder why this still works ?

return TSS2_RC_SUCCESS;
}

TSS2_RC Tcti_Helper_Common_Transmit (TCTI_HELPER_COMMON_CONTEXT *ctx, size_t size, const uint8_t *cmd_buf)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are missing the retry-logic in this function.
It always goes directly to "return error"

@AndreasFuchsTPM AndreasFuchsTPM added this to the 4.2.0 milestone Sep 3, 2025
@AndreasFuchsTPM
AndreasFuchsTPM marked this pull request as draft October 30, 2025 13:52
@AndreasFuchsTPM AndreasFuchsTPM modified the milestones: 4.2.0, 4.3.0 Oct 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SPI-Helper: Checking expect bit requires checking stsValid as well Improve Robustness of tcti-spi-helper

3 participants